[ESS] can't turn off fancy comments

Lionel Henry lionel.hry at gmail.com
Tue May 10 18:34:33 CEST 2016

> Le 10 mai 2016 à 18:13, Peter K <peter.kharchenko at gmail.com> a écrit :
> but the "fancy" indentation persists no matter what

One general rule in ESS: in doubt, change the user variables in a
hooked function.

  (defun my-ess-settings ()
    (setq ess-indent-with-fancy-comments nil))
  (add-hook 'ess-mode-hook #'my-ess-settings)

What's happening is that each time you open a R buffer, ESS makes all
indentation variables local to that buffer, and fill their values
according to the style in the variable `ess-style'. This means that
the global values of variables like `ess-indent-with-fancy-comments`
are never looked up. That's why you need to change those variables in
a hooked function as the hooks are run in the buffer after the style
has been applied locally.

This is confusing both to new and experienced users. So I think we
should rely on the global variables whenever `ess-style` is set to
nil, and we should set it to `nil` by default. The default values of
the various indent variables are the same as the default RRR style
anyway, so nothing would change by default and global values would be
picked up by the indentation engine.


More information about the ESS-help mailing list