[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matching Delimiters

    Date: Fri, 6 Dec 85 15:34 EST
    From: Ramin Zabih <RDZ@MIT-MC.ARPA>

    In Symbolics 3670 Zwei in Release 6.1, IP-TCP 29.13, 6-1-Patches 1.2,
    AISite 11.3, microcode TMC5-IO4-MIC 336, FEP 127,
    FEP0:>v127-lisp.flod(2), FEP0:>v127-loaders.flod(2),
    FEP0:>v127-debug.flod(1), FEP0:>v127-info.flod(2), on Lisp Machine Duane Allman:

    I'm probably only about the 10th person to ask this, but here goes
    anyway.  Is it possible to make delimiters that are not parenthesis
    (such as [] and {}) work the same way that parentheses do?  In
    particular, can the matching delimiter be made to flash?  Can editing
    commands like control-meta-f and control-meta-b be made to understand
    new delimiters?

To make new delimiters, you need something like:

zwei:(defmethod (fancy-editor :add-new-delimiters) ()
       (set-char-syntax list-close *mode-list-syntax-table* #/])
       (set-char-syntax list-open *mode-list-syntax-table* #/[))

With this, the delimiters will flash and control-meta-f and control-meta-b will 
work.  The only problem is that it thinks all opens and closes are equal, so
you will be able to close an open parenthesis with a close bracket.  If 
this bothers you, you'll need to look at the :matching-char-to-blink method of 
lisp-syntax-mixin and go from there.

Good luck,

Kyra Lowther