From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: commenting lines Date: Tue, 2 Jul 2002 11:03:53 -0700 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <3D21958D.7020503@york.ac.uk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: main.gmane.org 1025633211 29120 127.0.0.1 (2 Jul 2002 18:06:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 2 Jul 2002 18:06:51 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17PS38-0007ZY-00 for ; Tue, 02 Jul 2002 20:06:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PS2O-00075u-00; Tue, 02 Jul 2002 14:06:04 -0400 Original-Received: from renfield.synergymicro.com ([153.105.4.30] helo=synergymicro.com) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PS0V-000706-00 for ; Tue, 02 Jul 2002 14:04:07 -0400 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id LAA31338 for ; Tue, 2 Jul 2002 11:05:13 -0700 Original-Received: from [198.17.100.22] (G_Hill_Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.9.3/8.8.7) with ESMTP id LAA21744 for ; Tue, 2 Jul 2002 11:06:26 -0700 In-Reply-To: <3D21958D.7020503@york.ac.uk> Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:566 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:566 Gareth, I have the following in my .emacs, which I use for that sort of thing. Just set mark at the beginning of the first line you want to comment out, move point to the beginning of the last line, invoke the command, and type in the string you want to use as a comment. (global-set-key [?\C-\A-\M-s] (lambda (string start end) (interactive "sString: \nr") (string-rectangle start end string))) I use the following for removing those comments. Set mark at the beginning of the first line you want to uncomment, move point to the last line just after the last character of the comment, and invoke the command. (global-set-key [?\C-\A-\M-d] (lambda (start end) (interactive "r") (delete-rectangle start end))) --Greg At 12:59 PM +0100 7/2/02, Gareth Walker wrote: >Hi all -- I know it is possible to comment out text in Emacs with >`comment-region', but is it possible to specify what goes at the >beginning of each line? I would like to `label' regions of my text >files with different things. > >best wishes > >Gareth > > > >_______________________________________________ >Help-gnu-emacs mailing list >Help-gnu-emacs@gnu.org >http://mail.gnu.org/mailman/listinfo/help-gnu-emacs