(un)comment-region identical in all modes

(un)comment-region identical in all modes

Post by lawrence m » Tue, 29 Jul 2003 21:10:46



There is also the function COMMENT-OR-UNCOMMENT-REGION which
works regardless of whether transient mark mode is on or not, It
has existed since 2002-04-29:

| 2002-04-29 Stefan Monnier < XXXX@XXXXX.COM >

| * newcomment.el [...]
| (comment-or-uncomment-region): New fun.

Perhaps it would be useful to mention this somewhere in the
docstring for COMMENT-DWIM.

--
lawrence mitchell < XXXX@XXXXX.COM >
 
 
 

(un)comment-region identical in all modes

Post by Patrick Dr » Wed, 30 Jul 2003 02:45:46


Kai Groohann wrote on 28 Jul 2003 10:13:23 MET:


Thanks, I didn't know M-; - so far I've always used C-c ;
But I was actually referencing the uncomment-region command in AucTeX,
which is C-u C-c : instead of C-c : ... Certainly not a bug, since
it's mentioned in tex-ref.tex.

M-; semms to work fine with AucTeX and Gnus, but not with Matlab. ML
needs C-c ; and C-c : .


Yes, I do.

I'll take a look into newcomment.el, maybe it solves my problem.

Thanks,

Patrick
--
If your operating system goes down more often
than your girlfriend, then either you need to get
a Catholic girl, or you need to stop running NT.

 
 
 

(un)comment-region identical in all modes

Post by Patrick Dr » Wed, 30 Jul 2003 02:53:12


lawrence mitchell wrote on 28 Jul 2003 13:10:46 MET:

[...]


could you point me to an URL which has a new version of this file
available? All the sites I've tried so far are either down or only
offer an old version (1999) of this file.

TIA,

Patrick
--
The day Microsoft makes something that doesn't suck is probably the
day they start making vacuum cleaners. -- Ernst Jan Plugge
 
 
 

(un)comment-region identical in all modes

Post by lawrence m » Wed, 30 Jul 2003 03:53:27


[...] newcomment.el


It's available from the emacs cvs repository
<URL: http://www.yqcomputer.com/ *checkout*/emacs/
emacs/lisp/newcomment.el?rev=HEAD&content-type=text/plain>

--
lawrence mitchell < XXXX@XXXXX.COM >
 
 
 

(un)comment-region identical in all modes

Post by Patrick Dr » Wed, 30 Jul 2003 04:15:11

Hi Lawrence,

lawrence mitchell wrote on 28 Jul 2003 19:53:27 MET:



thanks for the link!

Patrick
--
I wish dialog boxes had a button saying "Whatever". I hate being
forced to answer "Yes" or "No" to a question I have no opinion on
whatsoever. There ought to be a button matching my indifference.
 
 
 

(un)comment-region identical in all modes

Post by kai.grossj » Wed, 30 Jul 2003 05:40:30

Patrick Drechsler < XXXX@XXXXX.COM > writes:


So the matlab mode needs to be adapted to support M-;. It should be
easy. AFAIK, just setting comment-start and comment-end is enough.

I think it doesn't make sense for you to try newcomment.el -- your
Emacs seems to contain this file already, and M-; is bound to a
function in that file. Type C-h k M-; to be sure.
--
~/.signature
 
 
 

(un)comment-region identical in all modes

Post by Edric M El » Wed, 30 Jul 2003 17:00:50


Actually, I think all that needs to be done is to bind M-; back to
comment-dwim - matlab mode sets this up to be "matlab-comment" by
default.

Edric.

--
Edric M Ellis
The MathWorks, Ltd., Matrix House, Cowley Park, Cambridge CB4 0HH, UK
Tel: +44 (0) 1223 423 200 Ext: 218
Fax: +44 (0) 1223 423 255
 
 
 

(un)comment-region identical in all modes

Post by Patrick Dr » Wed, 30 Jul 2003 17:18:42

Hi Edric,

Edric M. Ellis wrote on 29 Jul 2003 09:00:50 MET:



Sorry, but could you tell me how to bind M-; to comment-dwim?

Thanks,

Patrick
--
If I'd known I was gonna live this long, I'd have taken better care of
myself. [Eubie Blake]
 
 
 

(un)comment-region identical in all modes

Post by kai.grossj » Wed, 30 Jul 2003 19:05:18

Patrick Drechsler < XXXX@XXXXX.COM > writes:


There should be a variable named matlab-mode-map, or similar. Use
C-h v to find it. Once you found it, do the following:

(require 'matlab-mode)
(define-key matlab-mode-map (kbd "M-;") 'comment-dwim)

In the first line, you might have to replace matlab-mode -- the line
assumes that the file is named matlab-mode.el.

In the second line, you might have to replace matlab-mode-map -- C-h
v told you the right variable name.
--
~/.signature