How to Stop Emacs from Replacing Underbar with <- in Ess-Mode

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

From ESS's manual (look under "Changes/New Features in 5.2.0"):

ESS[S]: Pressing underscore ("_") once inserts " <- " (as before); pressing underscore twice inserts a literal underscore. To stop this smart behaviour, add "(ess-toggle-underscore nil)" to your .emacs after ess-site has been loaded

How to change smart assign key (_ to -) binding in ESS

Here's the docstring for ess-smart-S-assign-key:

Documentation:
Key used by `ess-smart-S-assign'. By default bound to
underscore, but can be set to any key. If this key is customized,
you must add

(ess-toggle-S-assign nil)
(ess-toggle-S-assign nil)

after the line that sets the customization and evaluate these
lines or reboot emacs. The first call clears the default
`ess-smart-S-assign' assignment and the second line re-assigns
it to the customized setting.

So: put this in your .emacs file to get the desired behavior:

(setq ess-smart-S-assign-key ":")
(ess-toggle-S-assign nil)
(ess-toggle-S-assign nil)

Kind of ugly, but it works.

How to set up custom automatic character replacement in emacs ess?

The simplest solution is to just bind a key to insert a string:

(define-key ess-mode-map (kbd "|") "%>%")

You can still insert | with C-q |. I'm not sure about the map's name; you'll almost certainly want to limit the key binding to ess-mode.

Emacs ESS Mode - Tabbing for Comment Region

Use '###' if you don't want the comments indented. According to the manual,

By default, comments beginning with
‘###’ are aligned to the beginning of
the line. Comments beginning with ‘##’
are aligned to the current level of
indentation for the block containing
the comment. Finally, comments
beginning with ‘#’ are aligned to a
column on the right (the 40th column
by default, but this value is
controlled by the variable
comment-column,) or just after the
expression on the line containing the
comment if it extends beyond the
indentation column.



Related Topics



Leave a reply



Submit