You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: This works fine if, after starting Emacs, I happen to open a .tex file before opening a .org file. However, if I happen to first open a .org file, I get a (void-variable LaTeX-mode-map) error in the *Messages* buffer and, worse than that, when I later open a .tex file, the binding is not set up. From what I can tell, the problem is that org-mode triggers the use-package citar, but the binding fails because LaTeX-mode-map does not exist until LaTeX-mode is used.
Question: What is the idiomatic way to handle this kind of situation with use-package? Should I be splitting the clauses for citar into two calls to use-package? The following does work, but I feel slightly unsettled by using two use-package citar. What is the recommended idiom?
Also, if I expand this last use-package citar, I see that the bind-keys has :package citar, and I sort of expected to see :package latex... Can someone please explain this to me?
The text was updated successfully, but these errors were encountered:
The default value for :package is the package being configured by the current use-package form.
However, you can set the :package value yourself after the :map keyword, and this will override the default behavior, setting up an eval-after-load for the package you specify instead.
Binding a key in a map for a different mode?
I'm trying to use
citar
with both AUCTeX andorg-mode
.Problem: This works fine if, after starting Emacs, I happen to open a
.tex
file before opening a.org
file. However, if I happen to first open a.org
file, I get a(void-variable LaTeX-mode-map)
error in the*Messages*
buffer and, worse than that, when I later open a.tex
file, the binding is not set up. From what I can tell, the problem is thatorg-mode
triggers theuse-package citar
, but the binding fails becauseLaTeX-mode-map
does not exist untilLaTeX-mode
is used.Question: What is the idiomatic way to handle this kind of situation with
use-package
? Should I be splitting the clauses forcitar
into two calls touse-package
? The following does work, but I feel slightly unsettled by using twouse-package citar
. What is the recommended idiom?Also, if I expand this last
use-package citar
, I see that thebind-keys
has:package citar
, and I sort of expected to see:package latex
... Can someone please explain this to me?The text was updated successfully, but these errors were encountered: