Using Aquamacs 3.2 on Mac OSX Yosemite. I run with delete-selection-mode
set, and it mostly works as advertised. However, if I'm in TeX mode (AucTeX), make a selection, and then type $
, the selection is cleared and the $
appended. So for example if I select foobar
in xyzfoobarxyz
and type $
, I get xyzfoobar$xyz
instead of the desired xyz$xyz
. Is this known/documented behavior, or a bug? If it's a bug, is it an AucTeX or an Aquamacs issue (or an Emacs issue)?
Edit: In response to Tobias' comment below, C-h k $
returns
$ runs the command TeX-insert-dollar, which is an interactive compiled Lisp function in `tex.el'.
It is bound to $.
(TeX-insert-dollar &optional ARG)
Insert dollar sign.
If current math mode was not entered with a dollar, refuse to insert one. Show matching dollar sign if this dollar sign ends the TeX math mode and 'blink-matching-paren' is non-nil. When outside math mode, the behavior is controlled by the variable 'TeX-electric-math'.
With raw ^U prefix, insert exactly one dollar sign. With optional ARG, insert that many dollar signs.
And, the function delete-selection-mode
is defined in delsel.el
.
I'm far from LISP-literate. Perhaps the TeX-insert-dollar
function does not take the delete selection mode into account (either by design or by omission)?
$
runs some special command in AucTeX, and that command isn't marked to as an insertion command, see delsel.el commentary(put 'TeX-insert-dollar 'delete-selection t)
TeX-electric-mode
?TeX-insert-dollar
wasn't missed, it's so by design because for the features it provides the function needs to keep alive the current selectionTeX-insert-dollar
had in the past thedelete-selection
property, but it was removed in order to provide the feature mentioned above: git.savannah.gnu.org/cgit/auctex.git/commit/…