GNU bug report logs - #19356
electric-pair-mode painful quotes in latex-mode

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Fri, 12 Dec 2014 04:21:01 UTC

Severity: minor

Found in version 24.4

Done: joaotavora <at> gmail.com (João Távora)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: joaotavora <at> gmail.com (João Távora)
Cc: 19356 <at> debbugs.gnu.org
Subject: bug#19356: electric-pair-mode painful quotes in latex-mode
Date: Sat, 13 Dec 2014 23:53:06 -0500
> What kind of surrounding should take place? Should it be
>   ``wordityped''
> or should it be
>   "wordityped"
> ?

I think either way would be OK.
I guess ideally

   C-M-SPC "

should do

   ``wordityped''

and

   C-M-SPC " "

should do

   "wordityped"

but it's OK if we don't reach this ideal.

> 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?

I don't see the need to extend electric-pair's code for this use
case, indeed, except if it can be done with a well-placed hook.

> 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?

I wouldn't punish you for it.

> If it seems OK, I'll add some tests and commit it to the emacs-24 branch
> (someone else will cherry-pick it to the master, right?).

The patch looks OK.  Installing it on emacs-24 sounds good, thank you
(and no, it won't be cherry picked: it'll be merged instead).


        Stefan




This bug report was last modified 10 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.