[ESS] Yet another indentation question: indentation after parenthese

Mathieu Basille basille at ase-research.org
Fri Dec 16 00:45:02 CET 2011


Dear ESS gurus,

I feel like I'm really missing something... I searched heavily on the 
net, in the ESS manual, on this list, without finding what I'm looking 
for. Basically, when I try to indent some code (with M-C-q), if a line 
break occurs in the middle of parentheses or brackets, the next line 
will be indented to the first character after the parenthesis. How can I 
get rid of this, and get a 'normal' 4 spaces indentation? (this is, I 
think, the behaviour of the R parser)

It really drives me crazy as I tried a .emacs with only this, as 
recommended in the R coding standards:

(add-hook 'ess-mode-hook
	  (lambda ()
	    (ess-set-style 'C++ 'quiet)
	    ;; Because
	    ;;                                 DEF GNU BSD K&R C++
	    ;; ess-indent-level                  2   2   8   5   4
	    ;; ess-continued-statement-offset    2   2   8   5   4
	    ;; ess-brace-offset                  0   0  -8  -5  -4
	    ;; ess-arg-function-offset           2   4   0   0   0
	    ;; ess-expression-offset             4   2   8   5   4
	    ;; ess-else-offset                   0   0   0   0   0
	    ;; ess-close-brace-offset            0   0   0   0   0
	    (add-hook 'local-write-file-hooks
		      (lambda ()
			(ess-nuke-trailing-whitespace)))))
(setq ess-nuke-trailing-whitespace-p t)

I also tried playing with an empty .emacs, with 'toggle-truncate-lines' 
(before I understood what it was about), 'auto-fill-mode' and 
'fill-column', which does not address my problem but allow me to 
automate the indentation... So far, I'm lost in the dark.

Any hint will be very welcome (even a RTFM that I totally missed)!

Best,
Mathieu.


-- 

~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info
http://ase-research.org/basille

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.



More information about the ESS-help mailing list