0

I am using iESS console and editor (ESS) for R programming, and often times (and randomly) the _ stops resulting in <-.

To temporarily hack it, I found that I could use ess-toggle-underscore or ess-toggle-S-assign here. BUT they don't seem to exist when I M-x or look at changing the value by M-x customize-variable.

  1. I would like atleast a temporary hack like, using a command and resetting the behavior
  2. I would like to get to the bottom of this! Can you guide me where I need to look?

P.S The only way I reset the system is by restarting the buffer aka closing the file/console and opening it again.

Thanks!

Pandian Le
  • 260
  • 3
  • 13

2 Answers2

2

This is from ESS's news file, which will be in the next release of ESS (likely 19.07). If you've installed ESS from MELPA it's already a part of it:

   * 'smart-underscore' and 'ess-smart-S-assign-key' have been removed.
     Users who liked the previous behavior (i.e.  underscore inserting
     "<-") should bind 'ess-insert-assign' to the underscore in their
     Emacs initialization file.  For example, '(define-key
     ess-r-mode-map "_" #'ess-insert-assign)' and '(define-key
     inferior-ess-r-mode-map "_" #'ess-insert-assign)' will activate it
     in all ESS R buffers.
Alex
  • 1,028
  • 5
  • 20
0

I don't use R or ESS, but I can clear up part of the mystery: ess-toggle-underscore and ess-toggle-S-assign are functions, but they're not interactive functions. M-x customize-variable only lets you customize variables, so you wouldn't expect them to show up there. M-x only lets you call functions which have specifically been designated by the developers as interactive. Since they're not interactive, they don't show up there. They will show up if you use C-h f, which gives you help about functions.

As for the actual problem you're having, it sounds like a bug you should report to whoever developed the package you're using. Is that ess-smart-underscore?

db48x
  • 15,741
  • 1
  • 19
  • 23
  • Thanks! Didn't get far though! I got help about these functions using `C-h f`. So I found this interactive function `ess-smarter-underscore` but doesn't seem to be helping either. All it does is print `_` or `<-` which would take me less time to just write them out. Would you know how I can disable a major-mode and reenable it? I tried `iESS-mode` (based on `C-h m`) but it doesn't seem to be interactive as well. – Pandian Le Jul 01 '19 at 08:35
  • The function `normal-mode` will turn off the current major mode and then reenable whatever mode is normal for the type of file you're editing. – db48x Jul 01 '19 at 17:18