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

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

Re: comment-uncomment-line-or-region.el


From: Reiner Steib
Subject: Re: comment-uncomment-line-or-region.el
Date: Tue, 19 Sep 2006 13:24:36 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On Tue, Sep 19 2006, Andreas Roehler wrote:

> ;; Tries to be a quick commenting/uncommenting
> ;; facility, as it respects region - active-mark and
> ;; transient-mark-mode - but doesn't depend on them. If
> ;; on a line, wanting to comment or uncomment them,
> ;; you don't have to care if transient-mark-mode is on.

What's the advantage compared to (the do-what-I-mean behavior of)
`comment-region' [1]?  Especially when using the new temporary
transient mark mode commands in (to be) Emacs 22? [2]

[1]
,----[ `C-h k M-;' ]
| M-; runs the command comment-region
|    which is an interactive autoloaded Lisp function in `newcomment'.
| It is bound to M-;.
| (comment-region BEG END &optional ARG)
| 
| Comment or uncomment each line in the region.
| With just C-u prefix arg, uncomment each line in region BEG .. END.
| Numeric prefix ARG means use ARG comment characters.
| If ARG is negative, delete that many comment characters instead.
| By default, comments start at the left margin, are terminated on each line,
| even for syntax in which newline does not end the comment and blank lines
| do not get comments.  This can be changed with `comment-style'.
| 
| The strings used as comment starts are built from
| `comment-start' without trailing spaces and `comment-padding'.
`----

[2]
,----[ NEWS ]
| One method is to type C-SPC C-SPC; this enables Transient Mark mode
| and sets the mark at point.  The other method is to type C-u C-x C-x.
| This enables Transient Mark mode temporarily but does not alter the
| mark or the region.
| 
| After these commands, Transient Mark mode remains enabled until you
| deactivate the mark.  That typically happens when you type a command
| that alters the buffer, but you can also deactivate the mark by typing
| C-g.
`----

Bye, Reiner.
Crosspost & Followup-To: gnu.emacs.help
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

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