[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to change 'comment-region' behaviour globally?

From: Thorsten Jolitz
Subject: How to change 'comment-region' behaviour globally?
Date: Sat, 16 Feb 2013 03:00:24 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux)

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. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]