auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] Get Emacs' electric quote mode to work with AUCTeX and BibTeX m


From: gusbrs . 2016
Subject: [AUCTeX] Get Emacs' electric quote mode to work with AUCTeX and BibTeX mode
Date: Fri, 19 Oct 2018 19:05:01 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Hi all,

[Disclaimer: I've asked this question before at TeX.SE
(https://tex.stackexchange.com/q/454912/105447) but, after due wait, I thought it was worth to bring the issue to this list, in the hope anyone else has any
ideas or suggestions on the matter.]

I've grown fond of `electric-quote-mode` in Emacs as a convenient way to get
curved quotes in my documents. However, I can't seem to get it to work with
either AUCTeX or BibTeX mode.

I'm aware AUCTeX has it's own support for quote insertion, which is quite
advanced, interacting with babel and so on. But I'm a `csquotes` user and have
in my preamble:

    \usepackage[autostyle]{csquotes}
      \MakeAutoQuote{“}{”}
      \MakeAutoQuote*{‘}{’} % innerquotes

Correspondingly, I have in my .emacs (under use-package's :custom):

    (LaTeX-csquotes-open-quote "“")
    (LaTeX-csquotes-close-quote "”")
    (LaTeX-csquotes-quote-after-quote nil)

I also have there:

    (custom-set-variables
      ...
      '(electric-quote-mode t)
      ...
      )

AUCTeX support for quotes works of course, but has some inconveniences in my
settings. First, it uses a different keyboard key for inserting quotes (double
quote for AUCTeX and backtick for everything else with electric quote
mode). Second, I can't seem to find a way to insert curved single quotes. Third,
neither alternative works at all in BibTeX mode.

For quite sometime, I thought this problem had to do with something in my
document which got parsed by AUCTeX. Indeed, opening a blank buffer and manually changing to LaTeX-mode gets me a buffer with a working electric quote mode. But,
in testing further, I don't think this is the case. Consider the following
minimal document:

    \documentclass{article}

    \begin{document}

    \end{document}

If I let AUCTeX parse this document, producing the following `auto/test.el`:

    (TeX-add-style-hook
     "test"
     (lambda ()
       (TeX-run-style-hooks
        "latex2e"
        "article"
        "art10"))
     :latex)

And then reopen it, `electric-quote-mode` no longer works (the backtick key
inserts a plain backtick).

One possible source of conflict I considered is the math mode prefix, which is
mapped to the backtick key by default. But I don't usually enable
`LaTeX-math-mode` and even setting `LaTeX-math-abbrev-prefix` to "'" I still
could not get electric quote mode to work.

In checking the keymap to the backtik (C-h k backtick) I see that it is mapped
to `self-insert-command` in both LaTeX-mode and BibTeX-mode.

I'm running Emacs 26.1 with AUCTeX 12.1.1.

Any thoughts on why this happens and how I could get it to work?
I thank you in advance.

Best,
gusbrs

PS: I'd also welcome suggestions outside this framework. I might well be looking
at the problem from the wrong perspective.

PPS: I'm not sure this is the proper place to ask about this issue also in
BibTeX mode. I suppose it is close enough that someone here might have some
ideas on the matter. But, if it's not, I'd appreciate pointers on where would be
more appropriate to ask.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]