help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to deal with comment in a new lang mode


From: Seweryn Kokot
Subject: Re: how to deal with comment in a new lang mode
Date: Mon, 03 Nov 2008 16:02:17 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

rgb <rbielaws@i1.net> writes:

>> PS is there a command to compact the ending parens?
>>
>>   Xah
>> ∑http://xahlee.org/
>>
> When I work on code I like the closing parens to line up below the
> matching open paren.
> So I wrote a patch to calculate-lisp-indent that puts a closing paren
> in the 'correct' column.
>
> Then, because most people don't like all those closing parens on lines
> by themselves, I wrote 2 other functions.
>
> expand-trailing-parens & collect-trailing-parens
>
> I think you want the collect-trailing-parens function but you might
> like the expand function sometimes too.
>
> There are no interdependencies so just grab whichever you like from my
> wikki page.
> These are about half way down the page.
>
> http://www.emacswiki.org/cgi-bin/wiki/Rick_Bielawski

Thanks for these useful functions.

In Emacs 22 `etp' function works only when removing t argument:
(newline-and-indent t)  -->  (newline-and-indent)

Also it's better to add 2 optional arguments in to avoid unwanted messages

    (while (re-search-forward "^\\s *)" nil t) ; ctp fun

    (while (re-search-forward ")" nil t) ; etp fun

-- 
regards,
Seweryn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]