unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49061: electric-quote-mode in bibtex-mode
@ 2021-06-16 14:00 Gustavo Barros
  0 siblings, 0 replies; only message in thread
From: Gustavo Barros @ 2021-06-16 14:00 UTC (permalink / raw)
  To: 49061

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".





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-16 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 14:00 bug#49061: electric-quote-mode in bibtex-mode Gustavo Barros

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).