[plt-scheme] stopping doubleclick selection breaking for hyphens and colons when editing scheme

From: spdegabrielle at gmail.com (spdegabrielle at gmail.com)
Date: Thu Sep 13 16:12:01 EDT 2007

thanks!

just realised that I should have included the period too. it doesnt
seem to be used in drscheme code, but I just noticed it in the jscheme
debugging thread that is running concurrently to this one.
thanks
s

On 9/13/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> Ah, right. Someday, I should make those editing commands (in Scheme
> mode) actually know about the scheme token syntax (ala the coloring).
> Checked in.
>
> Thanks,
> Robby
>
> On 9/13/07, Stephen De Gabrielle <spdegabrielle at gmail.com> wrote:
> > I've done a more comprehensive version -  it doesn't seem to break
> > anything and works nicely for me.
> >
> > ;  (define init-wordbreak-map
> > ;    (λ (map)
> > ;      (let ([v (send map get-map #\-)])
> > ;        (send map set-map
> > ;              #\-
> > ;              '(line)))))
> >    (define init-wordbreak-map
> >    (λ (map)
> >      (send map set-map  #\< '(line selection))  ; interfaces e.g.the
> > canvas<%> interface
> >      (send map set-map  #\> '(line selection))  ; interfaces, casts
> > e.g. string->path
> >      (send map set-map  #\% '(line selection))  ; intefraces, classes
> >      (send map set-map  #\? '(line selection))  ; predicates
> >      (send map set-map  #\' '(line selection))  ; literal symbols
> >      (send map set-map  #\! '(line selection))  ; assignments e.g. set
> >      (send map set-map  #\- '(line selection))  ; hyphens
> >      (send map set-map  #\: '(line selection)))) ; valid identifiers with
> colons
> >
> >   Cheers,
> >
> > Stephen
> >
> >
> >
> > On 9/13/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> > > Thanks! Looks right to me (and Matthew concurs) so I've checked it in to
> SVN.
> > >
> > > That code is *very* old, so I'm not sure how that binding of v crept
> > > in there. Probably a PEBCAK some 10 years ago ;)
> > >
> > > Robby
> > >
> > > On 9/13/07, Stephen De Gabrielle <spdegabrielle at gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I've been editing stuff, and was finding it frustrating that compound
> > > > scheme keywords were note selected with a double click - the selection
> > > > broke at the hypen(s)
> > > >
> > > > So I edited framework/private/scheme.ss:
> > > >
> > > >   (define init-wordbreak-map
> > > >     (λ (map)
> > > >       (let ([v (send map get-map #\-)])
> > > >         (send map set-map
> > > >               #\-
> > > >               '(line selection)))))
> > > >
> > > > Adding 'selection' to the list of things that hyphen (#\-) did not
> break.
> > > >
> > > > Is this the right way to do it?  I could not find an alternative -
> > > > like a configuration file.
> > > >
> > > > I can't immediately see why v is assigned in the let?
> > > >         [v (send map get-map #\-)]
> > > > it doesn't seem to be used or passed?
> > > >
> > > > I do the following for the same effect with colons ;
> > > >   (define init-wordbreak-map
> > > >     (λ (map)
> > > >       (send map set-map  #\- '(line selection))
> > > >       (send map set-map  #\: '(line selection))))
> > > >
> > > > It doesn't seem to break anything (yet)
> > > >
> > > > Cheers,
> > > >
> > > > Stephen
> > > >
> > > >
> > > >
> > > > --
> > > > Stephen De Gabrielle
> > > > s.degabrielle at ucl.ac.uk
> > > > Telephone +44 (0)20 7679 5242 (x45242)
> > > > Mobile                  079 851 890 45
> > > > http://www.uclic.ucl.ac.uk/annb/MaSI.html
> > > > University College London Interaction Centre
> > > > Remax House - 31/32 Alfred Place
> > > > London - WC1E 7DP
> > > >
> > > > _________________________________________________
> > > >   For list-related administrative tasks:
> > > >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > > >
> > > >
> > >
> >
> >
> > --
> > Cheers,
> >
> > Stephen
> >
> >
> >
> > --
> > Stephen De Gabrielle
> > s.degabrielle at ucl.ac.uk
> > Telephone +44 (0)20 7679 5242 (x45242)
> > Mobile                  079 851 890 45
> > http://www.uclic.ucl.ac.uk/annb/MaSI.html
> > University College London Interaction Centre
> > Remax House - 31/32 Alfred Place
> > London - WC1E 7DP
> >
>


-- 
Cheers,

Stephen



--
Stephen De Gabrielle
s.degabrielle at ucl.ac.uk
Telephone +44 (0)20 7679 5242 (x45242)
Mobile                  079 851 890 45
http://www.uclic.ucl.ac.uk/annb/MaSI.html
University College London Interaction Centre
Remax House - 31/32 Alfred Place
London - WC1E 7DP

Posted on the users mailing list.