Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jun 2001 06:21:10 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Lucas Bergman <lucas@slb.to>
Cc:        j mckitrick <jcm@FreeBSD-uk.eu.org>, questions@FreeBSD.ORG
Subject:   Re: emacs indentation question
Message-ID:  <20010616062110.B62115@hades.hell.gr>
In-Reply-To: <20010615100001.B24432@billygoat.slb.to>; from lucas@slb.to on Fri, Jun 15, 2001 at 10:00:01AM -0500
References:  <20010614180524.A43569@dogma.freebsd-uk.eu.org> <20010614181955.A2100@billygoat.slb.to> <20010615143347.A60504@dogma.freebsd-uk.eu.org> <20010615100001.B24432@billygoat.slb.to>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 15, 2001 at 10:00:01AM -0500, Lucas Bergman wrote:

> Yes.  Bind this function to a key:
> 
> (defun slb-comment-line ()
>   "  Comment out the current line of code."
>   (interactive)
>   (save-excursion
>     (let ((eol (progn (end-of-line) (point))))
>       (beginning-of-line)
>       (skip-chars-forward " \t" eol)
>       (comment-region (point) eol)))
>   nil)

Or ommit the (skip-chars-forward "\t" eol), if you want the comment to
start at the beginning of line, and not at the first non-whitespace
character.

> That should work on any language, too, not just C and its family,
> provided you have Emacs in the right mode.  The usual caveats about my
> pathetic Lisp skill apply.

You cannot be accused of not being an emacs-lisp hacker,
but you truly are modest :P

-giorgos

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010616062110.B62115>