From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Roehler Newsgroups: gmane.emacs.help Subject: Re: comment-uncomment-line-or-region.el Date: Tue, 19 Sep 2006 21:21:37 +0200 Organization: 1&1 Internet AG Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: sea.gmane.org 1158694851 992 80.91.229.2 (19 Sep 2006 19:40:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2006 19:40:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 19 21:40:51 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GPlSI-0002tT-El for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Sep 2006 21:40:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPlSH-0001Fb-VX for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Sep 2006 15:40:29 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsserver.news.garr.it!kanaga.switch.ch!switch.ch!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 84 Original-NNTP-Posting-Host: p54be87b6.dip0.t-ipconnect.de Original-X-Trace: online.de 1158693340 21539 84.190.135.182 (19 Sep 2006 19:15:40 GMT) Original-X-Complaints-To: abuse@einsundeins.com Original-NNTP-Posting-Date: Tue, 19 Sep 2006 19:15:40 +0000 (UTC) User-Agent: KNode/0.9.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:141875 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37497 Archived-At: 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