unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: 49061@debbugs.gnu.org
Subject: bug#49061: electric-quote-mode in bibtex-mode
Date: Wed, 16 Jun 2021 11:00:32 -0300	[thread overview]
Message-ID: <87mtrprjsw.fsf@gmail.com> (raw)

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





                 reply	other threads:[~2021-06-16 14:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtrprjsw.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --cc=49061@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).