auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] Insert two dollars when typing one


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] Insert two dollars when typing one
Date: Wed, 13 Feb 2013 16:56:08 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Mosè Giordano <address@hidden> writes:

Hi!

> I'd like to be able to insert two dollar signs and put the point
> between them when I type `$' outside math mode.

I'd accept such a (backward-compatible) change, but here's some
nitpicking.

> +(defcustom TeX-math-close-single-dollar nil
> +  "If non-nil, when outside math mode insert opening and closing dollar
> +signs for TeX inline equation and put the point between them, just by
> +typing a single `$'."
> +  :group 'TeX-macro
> +  :type 'boolean)

Does that play well with `TeX-math-close-double-dollar'?  I'm not
completely sure if closing of single or double dollars and placement of
point should be controlled by the same variables.  What's the result of
typing $$$ when both variables are t?

>  (defun TeX-insert-dollar (&optional arg)
>    "Insert dollar sign.
>  
> @@ -5158,7 +5165,16 @@
>        (insert "$")))
>     (t
>      ;; Just somewhere in the text.
> -    (insert "$")))
> +    (if TeX-math-close-single-dollar
> +     (progn
> +       (insert "$$")
> +       (if blink-matching-paren
> +           (progn
> +             (backward-char 2)
> +             (sit-for 1)

Use `blink-matching-delay' instead of hard-coding 1.  Please change the
other `sit-for' that's already there, too.

> +             (forward-char))
> +         (backward-char)))
> +      (insert "$"))))
>    (TeX-math-input-method-off))

And such a user-visible change needs some documentation below the node
(info "(auctex)Quotes").

Bye,
Tassilo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]