[ESS] ESS sas-mode: change comment style

Richard M. Heiberger rmh at temple.edu
Mon Nov 5 02:56:00 CET 2007


Here is a temporary solution.  I hope Rodney will integrate it
into the next release of ESS.

Place these two defuns in a new file ess-sas-comment-switch.el
Load the file from dired with uppercase L.

Open myfile.sas and enter
M-x ess-sas-comment-slash-star

Then M-; will use the /* */ comment style.
Reverse it with the other function.


(defun ess-sas-comment-star-star ()
  "Change SAS comment-style to '** comment **;' ."
  (interactive)
  (setq comment-start "** ") 
  (setq comment-end   " **;"))

(defun ess-sas-comment-slash-star ()
  "Change SAS comment-style to '/* comment */' ."
  (interactive)
  (setq comment-start "/* ") 
  (setq comment-end   " */"))

-----Original Message-----
From: ess-help-bounces at stat.math.ethz.ch
[mailto:ess-help-bounces at stat.math.ethz.ch] On Behalf Of Will
Sent: Sunday, November 04, 2007 10:49 AM
To: ess-help at stat.math.ethz.ch
Subject: [ESS] ESS sas-mode: change comment style

Hi,

I'd like to change the sas comment style from
** ***************** **;
** This is a comment **;
** ***************** **;
to
/* ***************** */
/* This is a comment */
/* ***************** */

How do I do that? What variables do I have to configure? What hooks 
should i use?

A Note to ESS developers:
As SAS does not treat comments like "** **;" as comments in all 
situations (e.g. in macros, on same line as commands), I prefer "/* */".
I suggest a flexible, easy way to change between those comment styles as 
both have their advantages and drawbacks.(cf. 
http://support.sas.com/onlinedoc/913/getDoc/sv/lrdict.hlp/a000289375.htm#a00
0852196)

Best, Will

______________________________________________
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