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: Xah
Subject: Re: how to deal with comment in a new lang mode
Date: Sat, 1 Nov 2008 07:41:25 -0700 (PDT)
User-agent: G2/1.0

On Nov 1, 6:47 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> Xah wrote:
> ...
> > (defun xlsl-uncomment-region (p1 p2)
> >   "Remove “//” in the beginning of each line of selected text."
> >   (interactive "r")
> >   (let ((deactivate-mark nil))
> >     (save-excursion
> >       (goto-char p2)
> >       (while (>= (point) p1)
> >         (xlsl-uncomment-current-line)
> >         (previous-line)
> >         )
> >       )
> >     )
> >   )
> > ...

> > 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.

i suppose i or any could easily write up a command to compact ending
parens ... i wonder why it's not really done. I guess its because most
people type parens one by one (as opposed to pairs), so they never
ends up with hanging parens like above in the first place.

  Xah
∑ http://xahlee.org/

reply via email to

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