From owner-freebsd-questions Fri Jun 15 20:22:12 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 3385E37B405 for ; Fri, 15 Jun 2001 20:21:56 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-a011.otenet.gr [212.205.215.11]) by mailsrv.otenet.gr (8.11.1/8.11.1) with ESMTP id f5G3LKp03887; Sat, 16 Jun 2001 06:21:26 +0300 (EEST) Received: (from charon@localhost) by hades.hell.gr (8.11.3/8.11.3) id f5G3LAL62407; Sat, 16 Jun 2001 06:21:10 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sat, 16 Jun 2001 06:21:10 +0300 From: Giorgos Keramidas To: Lucas Bergman Cc: j mckitrick , questions@FreeBSD.ORG Subject: Re: emacs indentation question Message-ID: <20010616062110.B62115@hades.hell.gr> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010615100001.B24432@billygoat.slb.to>; from lucas@slb.to on Fri, Jun 15, 2001 at 10:00:01AM -0500 X-PGP-Fingerprint: 3A 75 52 EB F1 58 56 0D - C5 B8 21 B6 1B 5E 4A C2 X-URL: http://students.ceid.upatras.gr/~keramida/index.html 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 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