From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rupert Swarbrick Newsgroups: gmane.emacs.help Subject: Re: bash comments in emacs Date: Tue, 29 Apr 2008 11:44:39 +0100 Message-ID: <8763u1rld4.fsf@gmail.com> References: <87d4obr6h8.fsf@hubble.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1209469262 23872 80.91.229.12 (29 Apr 2008 11:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2008 11:41:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 29 13:41:38 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JqoDI-0005g4-Sh for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2008 13:41:37 +0200 Original-Received: from localhost ([127.0.0.1]:34817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqoCc-0003UK-7K for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2008 07:40:54 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Tue, 29 Apr 2008 05:44:38 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:ATqu0aGajMsMj6OwG+MXCT+5nJw= Original-Lines: 32 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-SO8TKjLW5Z9tpPKjWiOnGYGdu1DPM22UYlU7lqo2gTabjaMMiGLrFlb8Ps05TB6Hh3z+16mKnB1g4Ul!ApKrwzVgbfV2GPhPPixEdjMnnJZrSrPBlH/euFdoFLEF Original-X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.38 Original-Xref: shelby.stanford.edu gnu.emacs.help:158254 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53619 Archived-At: "Amadeus W.M." writes: > On Sun, 27 Apr 2008 11:29:23 +0200, Pascal Bourguignon wrote: > >> "Amadeus W.M." writes: >> >>> How can I set up a shortcut to comment out or uncomment whole regions >>> in a bash script? Like C-c C-c for C++ comments. >> >> C-; > > Thanks. Just to be sure, you mean Ctrl followed by a semicolon (;) right? > Unfortunately didn't work. M-; did though, and that's good enough. > > >> >> Note that it's C-; also for C++ comments and any other comment. I don't >> you where you got that C-c C-c... > I think by default, in C mode, C-c C-c calls comment-region, which I assumed was what Amadeus was originally after. You could always do something like (add-hook 'sh-mode-hook (lambda () (define-key sh-mode-map "\C-c\C-c" 'comment-region))) (pilfering blatantly from the code I just snipped) Rupert