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: Rupert Swarbrick
Subject: Re: how to deal with comment in a new lang mode
Date: Sat, 01 Nov 2008 18:59:22 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

Xah <xahlee@gmail.com> writes:

> On Nov 1, 6:47 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
>> Xah wrote:
>> > PS is there a command to compact the ending parens?
>
> Kevin Rodgers wrote:
>> C-M-% ) C-q C-j SPC + ) RET )) RET
>
> Rupert Swarbrick wrote:
>> Well, I tend to go to the last one and C-a C-\ <backspace>
>> repeatedly. Well in fact, it's usually
>>   C-x C-( C-a C-\ <backspace> C-x C-) C-x e e e e e .... e
>
> ugh! I could have counted the parens, delete, then type them faster
> than these methdos.
>
> kinda interesting that almost 3 decades of emacs+elisp its still like
> this.

Hmm, Andreas has a good point. And I consider myself to have got things
wrong if I've managed to get this to happen.

You might be interested to note that paredit not only makes it
reasonably hard to end up with icky trailing parens like this, but also
ignores it when you "backspace through a )". Thus, if you somehow end up
with code looking like yours, you can always just go to the end of the
function and press and hold backspace until you get back to the end of
the meat of the function.

So, there's silly hacks like mine and Kevin's, there's a neat (if
obscure) function that Andreas suggested and, if you're using "the
right" major mode, you don't have to think at all.

Maybe after almost 3 decades of emacs+elisp, the problem's been solved.

Rupert

P.S. Your habit of cross-posting to g.e.help and c.emacs was really
annoying me until I realised that replies tended to arrive on g.e.help,
so I got gnus to put the group higher up in the list. However, you could
always save the rest of the world the trouble by posting to a single
newsgroup.

P.P.S. I don't intend to get into any sort of flaming match, so a reply
about either this or the previous postscript will be ignored categorically.

Attachment: pgpAJ6jup7l8u.pgp
Description: PGP signature


reply via email to

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