GNU bug report logs -
#23177
Inserting $ with delete-selection-mode set
Previous Next
Full log
Message #21 received at 23177 <at> debbugs.gnu.org (full text, mbox):
I just added the line
(put 'TeX-insert-dollar 'delete-selection (lambda () (null
TeX-electric-math)))
to git version of AUCTeX
(http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=da88a3eca3107372131aa26930e548c039fe1b51).
Now `delete-selection' behavior is dynamically determined by
`TeX-electric-math' and should always do the-right-thing™. Thanks for
the suggestion.
Bye,
Mosè
2016-03-31 23:57 GMT+02:00 Mosè Giordano <mose <at> gnu.org>:
> close 23177
> tags 23177 notabug
> thanks
>
>
> Hi Roger,
>
> 2016-03-31 23:37 GMT+02:00 Roger Lipsett <roger.lipsett <at> gmail.com>:
>>
>> tex.el, at line 6315, contains the code
>>
>> ;; delsel.el, `delete-selection-mode'
>> (put 'TeX-newline 'delete-selection t)
>> (put 'TeX-insert-quote 'delete-selection t)
>> (put 'TeX-insert-backslash 'delete-selection t)
>>
>> Should this also include a line for 'TeX-insert-dollar?
>
> No. That line was there until a few years ago but was removed on
> purpose in order to provide a new feature:
> http://git.savannah.gnu.org/cgit/auctex.git/commit/tex.el?id=d59628f1ee02abccc179c463214baddb5a17bf71
>
>> The problem I'm seeing is that if I'm in TeX (or LaTeX) mode, running with delete-selection-mode t, and type a $ when a region is selected, the selected region is not killed.
>
> If `TeX-electric-math' is non-nil, when you press `$' with an active
> region, it will wrap the selection with opening and closing inline
> equation symbols. This is a feature AUCTeX provides, like for
> parentheses in most other programming languages. If you want to lose
> this feature and be able to delete the region when inserting a dollar,
> then these lines in your init file
>
> (setq TeX-electric-math nil)
> (put 'TeX-insert-dollar 'delete-selection t)
>
> should do the trick. Note that `TeX-electric-math' defaults to nil,
> the first line shouldn't be actually needed.
>
> Bye,
> Mosè
This bug report was last modified 9 years and 112 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.