GNU bug report logs - #49061
electric-quote-mode in bibtex-mode

Previous Next

Package: emacs;

Reported by: Gustavo Barros <gusbrs.2016 <at> gmail.com>

Date: Wed, 16 Jun 2021 14:01:02 UTC

Severity: normal

To reply to this bug, email your comments to 49061 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49061; Package emacs. (Wed, 16 Jun 2021 14:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gustavo Barros <gusbrs.2016 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 16 Jun 2021 14:01:02 GMT) Full text and rfc822 format available.

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

From: Gustavo Barros <gusbrs.2016 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: electric-quote-mode in bibtex-mode
Date: Wed, 16 Jun 2021 11:00:32 -0300
Hi All,

I'm trying to get `electric-quote-mode' to work in `bibtex-mode', but 
I'm having some trouble with it.

The problem stems from the fact that `electric-quote-mode' makes a basic 
distinction between `text-mode' and "all other modes" (it seems 
implicitly to address `prog-mode' in this case).  However, `bibtex-mode' 
does not set a "parent mode" when it is defined.  So, 
`electric-quote-mode' will provide functionality similar to that of 
`prog-mode' for `bibtex-mode'.  In doing so it checks for comments or 
strings with `(nth 8 (syntax-ppss))' (this is done in 
`electric-quote-post-self-insert-function'), however a regular bibtex 
field will (or may) fail to have either comment or string syntax.  It 
actually depends on `bibtex-field-delimiters', if it is `double-quotes' 
a field will be within string syntax, but the normal case, and the 
default one is `braces', in which case the string syntax check fails. 
It does work for comments, of course, but not for a regular field 
though.

In practical terms, the effect of this is that we don't get curved 
quotes in a regular bibtex field if it is enclosed by braces, which is 
where we might need those quotes in this case.

I'm not sure what the best solution to this would be.  Changing the 
syntax of `{}' in `bibtex-mode' does not seem like a good idea. 
However, just assuming `bibtex-mode' should work "as `text-mode'" from 
`electric-quote-mode's side may also be problematic (assume, for 
example, that a user sets `bibtex-field-delimiters' to `double-quotes'). 
Still, this is something that is not working particularly well, and I 
thought it worth reporting.


Best regards,
Gustavo.


PS: The state of things this report refers to is that of "GNU Emacs 27.2 
(build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 
1.16.0) of 2021-03-25".




This bug report was last modified 2 years and 308 days ago.

Previous Next


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