[ESS] ess-comment-indent
Kasper Daniel Hansen
khansen at stat.Berkeley.EDU
Wed Apr 4 22:16:08 CEST 2007
On Apr 4, 2007, at 1:01 PM, Joel J. Adamson wrote:
> Dear List,
>
> I'm using XEmacs 21.4.19 (Constant Variable) on Slackware Linux 11.0.
> I work most of the time in Stata and sometimes in R. When I'm writing
> out a .do-file (a Stata script), if I put a comment on its own line,
> the next line will automatically be indented 2 columns. I don't want
> that to happen. I'm sure this is ESS code making this happen, since
> it also happens in R mode.
This does not happen for me in R mode. This could be a combination
between ESS and other stuff (auto-indentation). I don't know how
Stata does commenst, but in R mode there is a difference between #,
## and ###
#: comment to the left of the file
##: comment at this level
###: comment to the left, like in
### Comment 1,
tmp = function(){
## comment 2 - at current indentation level
plot(x)
# comment 3, to the "right"
### back to no indentation, even though we are in a function
return(TRUE)
}
Try the example above.
I am guessing that you are using a single comment char in R together
with something that does auto-indentation. And it _might_ be a
similar issue for Stata, although I have no idea how the comments
work there.
I guess you should read the ESS manual for how comments are handled.
I remember some stuff being there, but not what it said :)
Kasper
> I've looked through ess-mode.el and found a number of functions. I
> would presume the best way to rectify this would be to put a
> replacement function in my init.el:
>
> (defun misbehaving-function ()
> ())
>
> or whatever you would suggest. The biggest complication is that I
> don't want to eradicate the desirable behavior. If there's a variable
> I can set (ess-comment-indent-...), instead of replacing the function,
> please let me know. That would be the simplest solution.
>
> Thanks,
> Joel
> --
> Joel J. Adamson
> Biostatistician
> Pediatric Psychopharmacology Research Unit
> Massachusetts General Hospital
> Boston, MA 02114
> (617) 643-1432
> (303) 880-3109
>
>
>
>
>
> The information transmitted in this electronic communication is
> intended only for the person or entity to whom it is addressed and
> may contain confidential and/or privileged material. Any review,
> retransmission, dissemination or other use of or taking of any
> action in reliance upon this information by persons or entities
> other than the intended recipient is prohibited. If you received
> this information in error, please contact the Compliance HelpLine
> at 800-856-1983 and properly dispose of this information.
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
More information about the ESS-help
mailing list