Comment and uncomment regions
Michael J. Manning
mj.manning at niwa.co.nz
Thu Oct 10 23:07:54 CEST 2002
Dear Tony and Rich
I have bound "TeX-comment-region" to "C-c;" and "Tex-un-
comment-region" to "C-c:".
I have noticed that these bindings fail to work, returning a
"symbol's function is void:..." error if I start an R process under
XEmacs without having opened and edited a *.tex file first.
I guess that even though I think I am loading AucTeX when XEmacs
starts up via "(load "tex-site")" in my init.el, and have bound the
LaTeX comment functions to keys in the global map, the comment
functions do not actually get loaded until LaTeX mode is started,
which happens when a *.tex file is edited...
It occured to me to use the standard emacs command "comment-
region" in place of "TeX-comment-region", however I don't seem to
have the command "uncomment-region" in my XEmacs, and "kill-
comment" kills the comment along with the line commented out
rather than merely removing the comment character.
On 10 Oct 2002, at 0:52, Rich Heiberger wrote:
> I assume TeX-comment-region puts "%" at the front of all lines and
> that TeX-un-comment-region takes them away. If it was coded correctly,
> .they are based on the standard emacs command comment-region and
> uncomment-region and use the comment-start variable. Both work correctly
> in .s files and use the "#" character.
> So all we need to do is put them on a key.
> (global-set-key "\C-c;" 'comment-region)
> .(global-set-key "\C-c:" 'uncomment-region)
> This puts comment-region on C-c ;
> and uncomment-region on C-c : (which is C-c S-;)
> Your note said the AucTeX keys usually work with ESS. When do they not?
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