Lisp HUG Maillist Archive

Indents in the editor

Is there a way to format the form below so that lines after the first  
are offset by 2 spaces?

(deflexer mylexer
           ("'.*'"          'string)
           ("#.*$"          'comment)
           ("[ \t\r\f]+"    'ws)
           (":="            'assign)
           ("[\[]"          'lbrack)
           ("[\]]"          'rbrack)
           ("[\,]"          'comma)
           ("[\:]"          'colon)
           ("[\;]"          'semicolon)
           ("[+-]?[0-9]*[\.][0-9]+([eE][+-]?[0-9]+)?" 'float)
           ("[+-]?[0-9]+"   'integer)
           ("[a-zA-Z0-9_]+" 'id)
           ("."             'unknown))

	Thanks, Joel

--
http://wagerlabs.com/






Re: Indents in the editor

If deflexer is defined as

   (defmacro deflexer (name &body lexemes) ...)

it should indent the way you want.  If not, check the documentation  
for editor:setup-indent.

   - Gary Palter
     Principal Software Engineer
     Clozure Associates
     Cell:  617-947-0536


On Apr 25, 2007, at 10:57 AM, Joel Reymont wrote:

>
> Is there a way to format the form below so that lines after the  
> first are offset by 2 spaces?
>
> (deflexer mylexer
>           ("'.*'"          'string)
>           ("#.*$"          'comment)
>           ("[ \t\r\f]+"    'ws)
>           (":="            'assign)
>           ("[\[]"          'lbrack)
>           ("[\]]"          'rbrack)
>           ("[\,]"          'comma)
>           ("[\:]"          'colon)
>           ("[\;]"          'semicolon)
>           ("[+-]?[0-9]*[\.][0-9]+([eE][+-]?[0-9]+)?" 'float)
>           ("[+-]?[0-9]+"   'integer)
>           ("[a-zA-Z0-9_]+" 'id)
>           ("."             'unknown))
>
> 	Thanks, Joel
>
> --
> http://wagerlabs.com/
>
>
>
>


Re: Indents in the editor

Joel Reymont wrote:
> 
> Is there a way to format the form below so that lines after the first 
> are offset by 2 spaces?

See editor:setup-indent in the Editor user guide
> 
> (deflexer mylexer
>           ("'.*'"          'string)
>           ("#.*$"          'comment)
>           ("[ \t\r\f]+"    'ws)
>           (":="            'assign)
>           ("[\[]"          'lbrack)
>           ("[\]]"          'rbrack)
>           ("[\,]"          'comma)
>           ("[\:]"          'colon)
>           ("[\;]"          'semicolon)
>           ("[+-]?[0-9]*[\.][0-9]+([eE][+-]?[0-9]+)?" 'float)
>           ("[+-]?[0-9]+"   'integer)
>           ("[a-zA-Z0-9_]+" 'id)
>           ("."             'unknown))
> 
>     Thanks, Joel
> 
> -- 
> http://wagerlabs.com/
> 
> 
> 
> 


-- 
Chris Riesbeck

Home page: http://www.cs.northwestern.edu/~riesbeck/
Calendar: http://calendar.yahoo.com/criesbeck


Re: Indents in the editor

(editor:setup-indent "deflexer" 2 2 2)

John


On Apr 25, 2007, at 10:57 AM, Joel Reymont wrote:

> Is there a way to format the form below so that lines after the  
> first are offset by 2 spaces?
>
> (deflexer mylexer
>           ("'.*'"          'string)
>           ("#.*$"          'comment)
>           ("[ \t\r\f]+"    'ws)
>           (":="            'assign)
>           ("[\[]"          'lbrack)
>           ("[\]]"          'rbrack)
>           ("[\,]"          'comma)
>           ("[\:]"          'colon)
>           ("[\;]"          'semicolon)
>           ("[+-]?[0-9]*[\.][0-9]+([eE][+-]?[0-9]+)?" 'float)
>           ("[+-]?[0-9]+"   'integer)
>           ("[a-zA-Z0-9_]+" 'id)
>           ("."             'unknown))



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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