Skip to content

emacsmirror/ess-smart-underscore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESS Smart Underscore

Library Information

ess-smart-underscore.el — Ess Smart Underscore

Filename
ess-smart-underscore.el
Description
ess-smart-underscore
Author
Matthew L. Fidler
Maintainer
Matthew Fidler
Created
Thu Jul 14 11:04:42 2011 (-0500)
Version
0.79
Last-Updated
Mon Apr 9 15:27:09 2012 (-0500)
By
Matthew L. Fidler
Update #
137
URL
http://github.com/mlf176f2/ess-smart-underscore.el
Keywords
ESS, underscore

Compatibility:

Possible Dependencies

`custom’, `easymenu’, `ess’, `ess-compat’, `ess-custom’, `font-lock’, `syntax’, `widget’.

Installation

To use without using a package manager:

  • Put the library in a directory in the emacs load path, like ~/.emacs.d
  • Add (require ‘ess-smart-underscore) in your ~/.emacs file

This is in emacswiki, so this package can also be installed using el-get.

After installing el-get, Type M-x el-get-install ess-smart-underscore.

Ess-Smart Underscore Package Information

Smart “_” key: insert ess-S-assign, unless:

  1. in string/comment
  2. after a $ (like d$one_two) (toggle with ess-S-underscore-after-$)
  3. when the underscore is part of a variable definition previously defined. (toggle with `ess-S-underscore-after-defined’)
  4. when the underscore is after a “=” or “<-” on the same line.
  5. inside a parenthetical statement () or []. (toggle with ess-S-underscore-when-inside-paren)
  6. At the beginning of a line.
  7. In a variable that contains underscores already (for example foo_a) (toggle with ess-S-underscore-when-variable-contains-underscores)
  8. The preceding character is not a tab/space (toggle with ess-S-underscore-when-last-character-is-a-space. Not enabled by default.)

An exception to #4 is in the following situation:

a <- b |

Pressing an underscore here would produce

a <- b <-

However when in the following situation

a <- b|

Pressing an underscore would produce

a <- b_

This behavior can be toggled by ess-S-space-underscore-is-assignment

If the underscore key is pressed a second time, the assignment operator is removed and replaced by the underscore. ess-S-assign, typically ” <- “, can be customized. In ESS modes other than R/S, an underscore is always inserted.

In addition the ess-smart-underscore attempts to work with noweb-mode

History

22-May-2013
Added more ggplot operators. (Matthew L. Fidler)
21-May-2013
Added math to ggplot’s functions… (Matthew L. Fidler)
21-May-2013
Added hook to R-mode to make it behave a little better. (Matthew L. Fidler)
15-May-2013
Fixed ess-smart-underscore to work in an inferior R process. (Matthew L. Fidler)
15-May-2013
Added ggplot function prefixes. (Matthew L. Fidler)
05-Nov-2012
Better handling of noweb. I think it Came from Denis Haine and Martin Maechler. (Matthew L. Fidler)
22-Feb-2012
Support unbalanced sexps. (Matthew L. Fidler)
02-Feb-2012
Took out auto-installing. Most package managers don’t want you to do this. (Matthew L. Fidler)
03-Aug-2011
Bug fix for parenthetical statement (Matthew L. Fidler)
20-Jul-2011
Changed to allow underscore instead of assign when inside a parenthetical statement. (Matthew L. Fidler)
15-Jul-2011
Bug fix for d[d$CMT == 2,”DV”] _ to produce d[d$CMT == 2,”DV”] <- (Matthew L. Fidler)* Variables

Customizable Variables

Internal Variables

Functions

Interactive Functions

Internal Functions