unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Greg Hill <ghill@synergymicro.com>
Subject: Re: commenting lines
Date: Tue, 2 Jul 2002 11:03:53 -0700	[thread overview]
Message-ID: <p04310102b94793d3f04e@[198.17.100.22]> (raw)
In-Reply-To: <3D21958D.7020503@york.ac.uk>

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

      parent reply	other threads:[~2002-07-02 18:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-02 11:59 commenting lines Gareth Walker
2002-07-02 12:16 ` Arnaldo Mandel
2002-07-02 18:03 ` Greg Hill [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='p04310102b94793d3f04e@[198.17.100.22]' \
    --to=ghill@synergymicro.com \
    /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.
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).