all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: How to change 'comment-region' behaviour globally?
Date: Sat, 16 Feb 2013 03:00:24 +0100	[thread overview]
Message-ID: <87txpdggqv.fsf@gmail.com> (raw)


Hi List, 

suppose I want to outcomment this function definition in an Elisp Buffer:

,----------------------
| (defun add-3-and-4 ()
|    (+ 3 4 ))
`----------------------

If I mark both lines (the whole defun) and call 'comment-region', I get
what I want: 

;; (defun add-3-and-4 ()  
;;    (+ 3 4 ))


but when I act on one line only, i.e. mark the first line and call
'comment-region', and then the second line, I get: 

;; (defun add-3-and-4 ()  
   ;; (+ 3 4 ))

This happens in Emacs Lisp mode, and in PicoLisp mode too. Is there a
way to change the behaviour of 'comment-region' globally such that, even
when applied one line after another, the 'comment-start' characters are
never indented, but always placed at the beginning of line?

With globally I mean that this works independent from the comment-style
definitions of the major-mode, and overrides the major-mode settings if
they are different. 

-- 
cheers,
Thorsten





             reply	other threads:[~2013-02-16  2:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-16  2:00 Thorsten Jolitz [this message]
2013-02-16  3:26 ` How to change 'comment-region' behaviour globally? Drew Adams
2013-02-16 11:31   ` Thorsten Jolitz
2013-02-16 12:14   ` Thorsten Jolitz
2013-02-16 14:33     ` Stefan Monnier
2013-02-16 14:38       ` Thorsten Jolitz

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=87txpdggqv.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --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.