Comment and uncomment regions

Michael J. Manning mj.manning at niwa.co.nz
Fri Oct 11 00:03:54 CEST 2002


Hi Tony

On 10 Oct 2002, at 14:42, A.J. Rossini wrote:
> C-h f comment-region    
> 
> suggests that  if you bind "C-c ;" to comment region, that 
> "C-u C-c ;" should un comment the region.
> 
> So, Rich's suggestions for binding should be useful, then the 
above
> might work (please try it for me and report back!).
> 
> best,
> -tony

Yes, this works fine. What I ended up doing, however, was defining 
my own "uncomment-region" function as suggested by the 
XEmacs tutorial at 
http://www.xemacs.org/Links/tutorials_2.html#SEC14, e.g.

(defun uncomment-region (beg end)
  "Uncomment a region of text"
  (interactive "r")
  (comment-region beg end -1));<--Achtung!

and bound to a key combo I like via

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

Problem solved. Moral? When in doubt, read the instructions I 
guess...mea culpa.

Thanks for your help

MJM



Michael J. Manning
National Institute of Water and Atmospheric Research Ltd
PO Box 14901, Kilbirnie
Wellington, New Zealand
Tel 64 4 386 0581
Fax 64 4 386 0574
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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