Lisp HUG Maillist Archive

Editor: Square Brackets

Hello all,

can the LW editor be made to recognize square brackets as alternative
list syntax, similar to what

(modify-syntax-entry ?\[ "(]" lisp-mode-syntax-table)
(modify-syntax-entry ?\] ")[" lisp-mode-syntax-table)

does in Emacs?

Marcus


Re: Editor: Square Brackets

I would not expect it, what you need is one reader macro and that's
not all too much I guess.

Regards
Friedrich


Re: Editor: Square Brackets

At 24/09/2005 12:47, Marcus Breiing wrote:
>Hello all,
>
>can the LW editor be made to recognize square brackets as alternative
>list syntax, similar to what

Hello,

I would like this too.
How are doing those that use the symbolic SQL [] syntax in the LW editor?

Francis


>(modify-syntax-entry ?\[ "(]" lisp-mode-syntax-table)
>(modify-syntax-entry ?\] ")[" lisp-mode-syntax-table)
>
>does in Emacs?
>
>Marcus


Re: Editor: Square Brackets

Francis Leboutte <f.leboutte@algo.be> writes:

> At 24/09/2005 12:47, Marcus Breiing wrote:
> >Hello all,
> >
> >can the LW editor be made to recognize square brackets as alternative
> >list syntax, similar to what
> 
> Hello,
> 
> I would like this too.
> How are doing those that use the symbolic SQL [] syntax in the LW editor?
> 
> Francis
> 
> 
> >(modify-syntax-entry ?\[ "(]" lisp-mode-syntax-table)
> >(modify-syntax-entry ?\] ")[" lisp-mode-syntax-table)
> >
> >does in Emacs?
> >
> >Marcus
> 
I'm currently using the following, 
it doesn't work everywhere but it does the job.

  (editor:bind-string-to-key ")" #\] :mode "Lisp")
  (editor:bind-string-to-key "(" #\[ :mode "Lisp")
  (editor:bind-string-to-key "[" #\( :mode "Lisp")
  (editor:bind-string-to-key "]" #\) :mode "Lisp")
  (editor:bind-string-to-key ")" #\])
  (editor:bind-string-to-key "(" #\[)
  (editor:bind-string-to-key "[" #\( )
  (editor:bind-string-to-key "]" #\) )


Cheers,
   Sean.

-- 
"My doctor says that I have a malformed public-duty gland and a
 natural  deficiency in moral fibre," he muttered to himself, "and
 that I am therefore excused from saving Universes."
 - Life, the Universe, and Everything     Douglas Adams.

Confidentiality Notice: http://ucs.co.za/conf.html


Re: Editor: Square Brackets

Wonderful Dmitriy!
Thanks,
Francis

At 26/09/2005 10:50, Dmitriy Ivanov wrote:
>Hello Francis,
>
>| At 24/09/2005 12:47, Marcus Breiing wrote:
>|> Hello all,
>|>
>|> can the LW editor be made to recognize square brackets as alternative
>|> list syntax, similar to what
>|
>| Hello,
>|
>| I would like this too.
>| How are doing those that use the symbolic SQL [] syntax in the LW
>| editor?
>|
>| Francis
>|
>|
>|> (modify-syntax-entry ?\[ "(]" lisp-mode-syntax-table)
>|> (modify-syntax-entry ?\] ")[" lisp-mode-syntax-table)
>|>
>|> does in Emacs?
>
>Below is an excerpt from YstokSQL (originated from SQL/ODBC).
>
>(defun enable-sql-reader-syntax ()
>  "Globally enable SQL bracket syntax."
>  ...
>   #+lispworks   ; why can't it be that elegant in MCL and ACL?
>   (progn (editor::set-vector-value
>           (slot-value editor::*default-syntax-table* 'editor::table) #\[ 2)
>          (editor::set-vector-value
>           (slot-value editor::*default-syntax-table* 'editor::table) #\]
>3)))
>
>(defun disable-sql-reader-syntax ()
>  "Globally disable SQL bracket syntax."
>   ...
>   #+lispworks
>   (progn (editor::set-vector-value
>           (slot-value editor::*default-syntax-table* 'editor::table) #\[ 7)
>          (editor::set-vector-value
>           (slot-value editor::*default-syntax-table* 'editor::table) #\]
>7)))
>--
>HTH,
>Dmitriy Ivanov
>lisp.ystok.ru


Re: Editor: Square Brackets

Thanks Dmitriy,
works like a charm.

Marcus

>   (progn (editor::set-vector-value
>           (slot-value editor::*default-syntax-table* 'editor::table) #\[ 2)
>          (editor::set-vector-value
>           (slot-value editor::*default-syntax-table* 'editor::table) #\]
> 3)))



Updated at: 2020-12-10 08:50 UTC