Date: Fri, 15 Jun 2001 10:00:01 -0500 From: Lucas Bergman <lucas@slb.to> To: j mckitrick <jcm@FreeBSD-uk.eu.org> Cc: questions@freebsd.org Subject: Re: emacs indentation question Message-ID: <20010615100001.B24432@billygoat.slb.to> In-Reply-To: <20010615143347.A60504@dogma.freebsd-uk.eu.org>; from jcm@FreeBSD-uk.eu.org on Fri, Jun 15, 2001 at 02:33:48PM %2B0100 References: <20010614180524.A43569@dogma.freebsd-uk.eu.org> <20010614181955.A2100@billygoat.slb.to> <20010615143347.A60504@dogma.freebsd-uk.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> okay, how about this then: Hmm... do I sense a challenging tone? :) > is there a way to comment out just one line without marking it and > moving down a line? 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) 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. Lucas 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?20010615100001.B24432>