GNU bug report logs - #23177
Inserting $ with delete-selection-mode set

Previous Next

Package: auctex;

Reported by: Roger Lipsett <roger.lipsett <at> gmail.com>

Date: Thu, 31 Mar 2016 21:44:01 UTC

Severity: normal

Tags: fixed

Done: mose <at> gnu.org (Mosè Giordano)

Bug is archived. No further changes may be made.

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: Roger Lipsett <roger.lipsett <at> gmail.com>
Cc: 23177 <at> debbugs.gnu.org
Subject: Re: bug#23177: Inserting $ with delete-selection-mode set
Date: Thu, 31 Mar 2016 23:57:25 +0200
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.