From owner-freebsd-questions Fri Jun 15 7:59:50 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dsl-64-193-218-89.telocity.com (dsl-64-193-218-89.telocity.com [64.193.218.89]) by hub.freebsd.org (Postfix) with SMTP id 6EC3D37B401 for ; Fri, 15 Jun 2001 07:59:46 -0700 (PDT) (envelope-from lucas@slb.to) Received: (qmail 20930 invoked by uid 1000); 15 Jun 2001 15:00:01 -0000 Date: Fri, 15 Jun 2001 10:00:01 -0500 From: Lucas Bergman To: j mckitrick Cc: questions@freebsd.org Subject: Re: emacs indentation question Message-ID: <20010615100001.B24432@billygoat.slb.to> Reply-To: lucas@slb.to References: <20010614180524.A43569@dogma.freebsd-uk.eu.org> <20010614181955.A2100@billygoat.slb.to> <20010615143347.A60504@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 +0100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > 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