1

Previously when I used the underscore key in my keyboard ESS replaced it for the assigment keys <-. In emacs25 that no longer happens.

I have installed the ESS package from MELPA, as well as, it's dependencies. I have the line

;; initialize all packages at startup
(package-initialize)

at the top of my .emacs file.

How can I replace the _ with the <- when I am trying to assign a variable in R.

Drew
  • 75,699
  • 9
  • 109
  • 225
Usobi
  • 113
  • 3
  • Inasmuch as the current stable release is Emacs 26.1, does the feature you seek work correctly with a current version of Emacs? – lawlist Mar 02 '19 at 17:05

1 Answers1

2

I think it is related to recent changes in ESS. Quote from here: https://ess.r-project.org/Manual/ess.html

The variable ess-smart-S-assign-key is now deprecated and will be removed in the next release. If you would like to continue using ‘_‘ for insterting assign in future releases, please bind ess-insert-assign in ess-mode-map the normal way.

I have the following in my config to achieve exactly what you are asking

(define-key ess-r-mode-map "_" #'ess-insert-assign)
(define-key inferior-ess-r-mode-map "_" #'ess-insert-assign)
andrej
  • 983
  • 6
  • 15
  • Thanks, that did the trick. I needed to add (require 'ess-site) to the top of the .emacs file too. I thought (package-initialize) took care of that, but nope. – Usobi Mar 03 '19 at 16:00