Emanuel Berg writes: > Stefan Monnier via Users list for the GNU Emacs text editor wrote: > >>> I installed it using package.el. Then for some reason I had >>> problems configuring keybindings in LaTeX-mode-map: somehow >>> the variable seemed to not be defined. I manually searched >>> for it in the package (M-x grep-find iirc), then required >>> the relevant files. >> >> `LaTeX-mode-map`, like most package variables, is only >> defined once its package is actually loaded, which is done >> lazily in response to the use of the package (e.g. >> opening a LaTeX file). > > https://en.wikipedia.org/wiki/Lazy_loading > >> So it's normal that `LaTeX-mode-map` is not defined when >> your init file is loaded. This is on purpose to try and >> speed up Emacs's startup. > > Does it really make it that slow? Must be something from > Emacs' past, maybe ... > > And besides you shouldn't restart Emacs all the time either? > > With this > > (require 'tex-mode) > (define-key latex-mode-map "\C-c\C-c" #'compile) > > starting Emacs is almost instant. But it always adds a little to your init time. When you configure too many packages like this, these will cause the startup to take a long time. I recommend: --8<---------------cut here---------------start------------->8--- (with-eval-after-load 'tex-mode (define-key latex-mode-map "\C-c\C-c" #'compile)) --8<---------------cut here---------------end--------------->8--- This will bind the key as soon as tex-mode is loaded. -- Akib Azmain Turja Find me on Mastodon at @akib@hostux.social. This message is signed by me with my GnuPG key. Its fingerprint is: 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5