[ESS] sas-mode redefining newline? how can I make it stop?

fork forkandwait at gmail.com
Sat May 7 00:42:51 CEST 2011


fork <forkandwait <at> gmail.com> writes:

> 
> Rodney Sparapani <rsparapa <at> mcw.edu> writes

<SNIP>

Here is what I now have in my init file, which seems to give me what I want:

;; my own func
(defun newline-indent-relative ()
  "blah"
  (interactive)
  (progn 
	(newline)
	(indent-relative-maybe)))

;; Load ess and sas mode customizations
(defun load-ess ()
  (interactive)
  (load-file "~/.emacs.d/ess-5.13/lisp/ess-site.el"))
(add-hook 'ess-mode-hook
          '(lambda ()
			 (local-set-key (kbd "<return>") 'newline)
			 (local-set-key (kbd "C-j") 'newline-indent-relative)
			 (local-set-key (kbd "<tab>") 'tab-to-tab-stop)
             (modify-syntax-entry ?_ "w")       ; now '_' is not considered a
word-delimiter
             (modify-syntax-entry ?- "w")       ; now '-' is not considered a
word-delimiter 
             ))

I generally only load ess if I have a sas file to work on (it is a bit of a
beast to load every time I start emacs).  The above seems to give sensical
indentation -- if I want to reset to flush left, I hit enter; if I want to align
with the last line, I hit C-j, and if I want a regular notch of indentation, I
hit tab.

Thanks to everyone who helped me think this through.



More information about the ESS-help mailing list