* Re: comment-uncomment-line-or-region.el
[not found] <eeoc28$j61$1@online.de>
@ 2006-09-19 11:24 ` Reiner Steib
2006-09-19 19:21 ` comment-uncomment-line-or-region.el Andreas Roehler
0 siblings, 1 reply; 2+ messages in thread
From: Reiner Steib @ 2006-09-19 11:24 UTC (permalink / raw)
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: comment-uncomment-line-or-region.el
2006-09-19 11:24 ` comment-uncomment-line-or-region.el Reiner Steib
@ 2006-09-19 19:21 ` Andreas Roehler
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Roehler @ 2006-09-19 19:21 UTC (permalink / raw)
Reiner Steib wrote:
> 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
The advantage AFAICT: you just don't have to care
for all this mentioned above:
Now switching of transient-mark-mode at all.
On a line, just hit the key.
Two lines? Hit two times or keep it a moment.
That's all.
You want to mark the region first to see it before?
Fine. It will work.
Beside this `comment-dwim' is a complex command which
covers a range of purposes. I don't intend to
discourage using it if you need it.
But why to start a Mercedes Benz just to roll to the
grocery next corner?
Thanks
__
Andreas Roehler
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-19 19:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <eeoc28$j61$1@online.de>
2006-09-19 11:24 ` comment-uncomment-line-or-region.el Reiner Steib
2006-09-19 19:21 ` comment-uncomment-line-or-region.el Andreas Roehler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).