How to stop emacs from replacing underbar with <- in ess-mode

前端 未结 6 1309
有刺的猬
有刺的猬 2020-12-13 16:59

ess-mode is \"Emacs speaks statistics.\" This mode is useful for editing programs for R or Splus (two separate statistics packages).

In my buffer, when

6条回答
  •  既然无缘
    2020-12-13 17:42

    Like Michał Marczyk and this R mailing list thread suggested, add this line to ~/.emacs:

    (ess-toggle-underscore nil)
    

    Then reload it with M-x load-file and type ~/.emacs.

    But if you load the file again, e.g. if you add another customization, then it toggles it back to the original state. So toggle it twice, the first one forcing it to the default:

    (ess-toggle-underscore t)
    (ess-toggle-underscore nil)
    

    That being said, I like Drummermean's solution better, but it also reverts back to default if you add it to ~/.emacs and load it twice. So force a toggle to the default before:

    (ess-toggle-underscore t)
    (global-set-key (kbd "M--")  (lambda () (interactive) (insert " <- ")))
    (ess-toggle-underscore nil)
    

    I bound the smart assignment to Opt-[minus] like RStudio (on a Mac).

提交回复
热议问题