From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: how to deal with comment in a new lang mode
Date: Sat, 01 Nov 2008 16:24:48 +0100 [thread overview]
Message-ID: <1225553160.28988@arno.fh-trier.de> (raw)
In-Reply-To: <413a22e1-3685-4b1a-97d7-cda08401b838@v22g2000pro.googlegroups.com>
Xah wrote:
> 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/
>
> ☄
>
I think your conclusion is true, but as for the proposition (people type
parens one by one), I think most people simply don't end up with this pattern
of parentheses when they code lisp. Where did the newline come from
anyway, especially since it is not desired ?
However, I would probablly use this baby :
,----[ C-h k M-^ ]
| M-^ runs the command delete-indentation
| which is an interactive compiled Lisp function in `simple.el'.
| It is bound to M-^.
| (delete-indentation &optional ARG)
|
| Join this line to previous and fix up whitespace at join.
| If there is a fill prefix, delete it from the beginning of this line.
| With argument, join this line to following line.
`----
-ap
next prev parent reply other threads:[~2008-11-01 15:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 20:59 how to deal with comment in a new lang mode Xah
2008-10-31 2:46 ` Kevin Rodgers
2008-10-31 14:10 ` rgb
[not found] ` <mailman.2542.1225421198.25473.help-gnu-emacs@gnu.org>
2008-10-31 20:04 ` Xah
2008-11-01 12:53 ` Rupert Swarbrick
2008-11-01 13:47 ` Kevin Rodgers
[not found] ` <mailman.2630.1225547412.25473.help-gnu-emacs@gnu.org>
2008-11-01 14:41 ` Xah
2008-11-01 15:24 ` Andreas Politz [this message]
2008-11-01 20:55 ` Xah
2008-11-01 21:23 ` Andreas Politz
2008-11-01 21:48 ` Xah
2008-11-01 18:59 ` Rupert Swarbrick
2008-11-03 14:08 ` rgb
2008-11-03 14:19 ` rgb
2008-11-03 15:02 ` Seweryn Kokot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1225553160.28988@arno.fh-trier.de \
--to=politza@fh-trier.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.