Subject: Re: bug#19356: electric-pair-mode painful quotes in latex-mode

From: [email-masked] (João Távora)
Date: Sat, 13 Dec 2014 14:54:02 +0000

> Package: Emacs
> Version: 24.4
>
>
>    ./src/emacs -Q -f electric-pair-mode ~/tmp/foo.tex
>
> then type a word, go back to before this word and try:
>
>    C-M-SPC "
>
> this will not surround the word in quotes as electric-pair-mode should.

What kind of surrounding should take place? Should it be

  ``wordityped''

or should it be

  "wordityped"

?

Anyway, without having anlysed the problem thoroughly, I lean towards
making tex-mode.el's `tex-insert-quote' aware of `electric-pair-mode',
possibly downgrading and/or not respecting stuff like
`electric-pair-preserve-balance', instead of overloading the latter with
abstractions to deal with multi-character metamorphosing quotes. Do you
agree? Or do you have any other solution in mind?

Also, independent of `electric-pair-mode', typing a double quote
(`tex-insert-quote') with only whitespace preceding point gives me a
"Beginning of buffer" error. Should I also fix it?

>
> Similarly, type
>
>    hello " "
>
> Notice how the second " inserts `""' instead of just modifying the ''
> into a single ".  This same problem happens before a word.

Reproduced. `electric-pair-mode' does affect this.

João