added ess layer variable ess-disable-underscore-assign

This commit is contained in:
Jack Kamm 2017-05-02 15:18:23 +01:00 committed by Eivind Fonn
parent c3d344cb8c
commit 32103b2ddc
3 changed files with 17 additions and 11 deletions

View File

@ -51,19 +51,20 @@ Helpers for inspecting objects at point are available in R buffers only.
| ~SPC m h t~ | view table using [ess-R-data-view][ess-R-data-view] |
* Options
=ess-smart-equals= is disabled by default. In order to enable it, set in your
=~/.spacemacs=
To turn off the automatic replacement of underscores by =<-=,
set in your =~/.spacemacs=:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((ess :variables
ess-disable-underscore-assign t)))
#+END_SRC
Alternatively you may enable =ess-smart-equals=, which also disables
replacement of underscores by =<-=, and additionally replace the equals sign with
=<-= when appropriate:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((ess :variables
ess-enable-smart-equals t)))
#+END_SRC
To turn off the automatic replacement of underscores by =<-=, add the following
hook:
#+begin_src emacs-lisp
(add-hook 'ess-mode-hook
(lambda ()
(ess-toggle-underscore nil)))
#+end_src

View File

@ -13,3 +13,6 @@
(defvar ess-enable-smart-equals nil
"If non-nil smart-equal support is enabled")
(defvar ess-disable-underscore-assign nil
"If non-nil, disables underscore _ being a shortcut for assignment <-")

View File

@ -71,6 +71,8 @@
ess-expression-offset 2
ess-nuke-trailing-whitespace-p t
ess-default-style 'DEFAULT)
(if ess-disable-underscore-assign
(ess-toggle-underscore nil))
(spacemacs/set-leader-keys-for-major-mode 'ess-julia-mode
"'" 'julia