Comment and uncomment regions

Michael Na Li lina at u.washington.edu
Thu Oct 10 07:06:00 CEST 2002


On Thu, 10 Oct 2002, Michael J. Manning said:

>  As I have AucTeX installed and "(load "tex-site")" in my init.el file, I 
>  have bound two keys I like to (cringe) "TeX-comment-region" and 
>  "TeX-un-comment-region", which works most of the time with ESS, 
>  but it occurred to me that there might be (has to be) a better way.
>  

In Emacs 21, M-; is very handy.  Don't know if XEmacs has it.

,----[ C-h k M-; ]
| M-; runs the command comment-dwim
|    which is an interactive compiled Lisp function in `newcomment'.
| (comment-dwim ARG)
| 
| Call the comment command you want (Do What I Mean).
| If the region is active and `transient-mark-mode' is on, call
|   `comment-region' (unless it only consists of comments, in which
|   case it calls `uncomment-region').
| Else, if the current line is empty, insert a comment and indent it.
| Else if a prefix ARG is specified, call `comment-kill'.
| Else, call `comment-indent'.
`----

Michael

-- 
----------------------------------------------------------------------------
Michael Na Li                               
Email: lina at u.washington.edu
Department of Biostatistics, Box 357232
University of Washington, Seattle, WA 98195  
---------------------------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
ess-help mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: ess-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the ESS-help mailing list