From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dale Snell Newsgroups: gmane.emacs.help Subject: Re: one key-press to comment out lines of code? Date: Wed, 30 Apr 2014 09:27:49 -0700 Organization: Organization? Me? ROFL!! Message-ID: <20140430092749.4834bb92@zothique> References: <87fvku94ms.fsf@skimble.plus.com> Reply-To: ddsnell@frontier.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1398875324 5824 80.91.229.3 (30 Apr 2014 16:28:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2014 16:28:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 30 18:28:37 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WfXN1-0000Na-W3 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2014 18:28:32 +0200 Original-Received: from localhost ([::1]:57838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfXN1-0007oy-K6 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2014 12:28:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfXMi-0007oY-MB for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 12:28:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfXMb-0004QL-Kt for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 12:28:12 -0400 Original-Received: from filter03.roch.ny.frontiernet.net ([66.133.183.233]:54799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfXMb-0004QH-G0 for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 12:28:05 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by filter03.roch.ny.frontiernet.net (Postfix) with ESMTP id 0285A18BC69 for ; Wed, 30 Apr 2014 16:28:04 +0000 (UTC) Original-Received: from relay04.roch.ny.frontiernet.net ([66.133.182.167]) by localhost (filter03.roch.ny.frontiernet.net [66.133.183.233]) (amavisd-new, port 10024) with LMTP id xboGbc2qjYOw for ; Wed, 30 Apr 2014 16:27:52 +0000 (UTC) X-Originating-IP: [50.39.121.206] X-Previous-IP: 50.39.121.206 Original-Received: from zothique (50-39-121-206.bvtn.or.frontiernet.net [50.39.121.206]) by relay04.roch.ny.frontiernet.net (Postfix) with ESMTPA id 013FB17CF9 for ; Wed, 30 Apr 2014 16:27:48 +0000 (UTC) In-Reply-To: <87fvku94ms.fsf@skimble.plus.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; x86_64-redhat-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 66.133.183.233 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97486 Archived-At: On Wed, 30 Apr 2014 17:14:03 +0100 Sharon Kimble wrote: > Whilst I'm still learning emacs and gnus I'm constantly adding code > to my "setup-testbed.el" file, and then finding later that it doesn't > do what its expected to do, or I don't like the outcome, so I then > comment it out. Currently, I'm doing it laboriously by hand, but is > it possible to highlight it and then with one key-press insert ";" in > front of each and every line of the code please? > > I haven't seen this ability anywhere, but being able to do it would > make things a whole lot easier for me, so, can it be done please > folks? Well, it's not precisely one keypress, but here's what I do: Set point and mark to define the region. Then do C-x r t RET ; SPC RET That should do it. If you don't like the space, you can leave it out. I like a little whitespace between my comment symbols and the program text. Hope this helps. --Dale -- "Text processing has made it possible to right-justify any idea, even one which cannot be justified on any other grounds." -- J. Finnegan, USC.