all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Amadeus W.M." <amadeus84@verizon.net>
To: help-gnu-emacs@gnu.org
Subject: Re: bash comments in emacs
Date: Sun, 27 Apr 2008 21:54:23 GMT	[thread overview]
Message-ID: <pan.2008.04.27.21.54.23@verizon.net> (raw)
In-Reply-To: 87d4obr6h8.fsf@hubble.informatimago.com

On Sun, 27 Apr 2008 11:29:23 +0200, Pascal Bourguignon wrote:

> "Amadeus W.M." <amadeus84@verizon.net> 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...

Good question. I looked at my .emacs file and I think C-c C-c comes from 
the dwim thing:

;; Nice trick for commenting/uncommenting regions, using dwim (do what I 
mean)
;;
;;
;; Otherwise, to uncomment use C-u C-c C-c (opposite of C-c C-c to 
comment out)
;; The C-u trick works with latex too. 
;; Highlight region, then M-x comment-region. 
;; To uncomment, highlight, then C-u M-x comment-region.

(if (fboundp 'comment-dwim)
  (add-hook (if (boundp 'c-mode-common-hook)
               'c-mode-common-hook
             'c-mode-hook)
            (lambda ()
              (define-key c-mode-map "\C-c\C-c" 'comment-dwim))))

and similarly for C++, latex and matlab.



  parent reply	other threads:[~2008-04-27 21:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27  2:34 bash comments in emacs Amadeus W.M.
2008-04-27  9:29 ` Pascal Bourguignon
2008-04-27 12:02   ` Richard G Riley
2008-04-27 21:54   ` Amadeus W.M. [this message]
2008-04-29 10:44     ` Rupert Swarbrick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2008.04.27.21.54.23@verizon.net \
    --to=amadeus84@verizon.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.