multi lines commenting

Michael J. Manning michael.manning at
Wed Mar 31 22:55:32 CEST 2004

Hi Fred

I have the following in my init.el file and it appears to work 
perfectly, i.e. I can comment and uncomment mulitple regions of text in 
  different modes using the comment character defined for each mode 
(e.g. "#" for R/S/S+ mode, ";" for lisp mode and so one and so forth).

As noted in an earlier post on this thread, you need to select the 
region you wish to uncomment (e.g. hit C-spc then use arrow keys or 
select with mouse) before you apply the uncomment function.

Hope this helps.


;; Comment and uncomment text
(defun uncomment-region (beg end)
   "Uncomment a region of text"
   (interactive "r")
   (comment-region beg end -1))

(global-set-key "\C-c;"      'comment-region)
(global-set-key "\C-c:"      'uncomment-region)

Fred J. wrote:

> #help.start()                            
> I was able to commnet the above region by doing
> M-x comment-region
> BUT was unable to uncomment the region by doing
> M-x uncomment-region [No match]
> OR by M-; which just adds "Tabs + #" at the end of
> line
> thanks
> ______________________________________________
> ESS-help at mailing list


Michael J. Manning
Inshore and Pelagic Fisheries
National Institute of Water and Atmospheric Research Ltd (NIWA)
Private Bag 14901, Kilbirnie, Wellington, NEW ZEALAND
Tel: +64 (0)4 386 0851 (direct)
Fax: +64 (0)4 386 0574
Email: michael.manning at

More information about the ESS-help mailing list