From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Unicode characters for transcribing to pdf
Date: Mon, 5 Sep 2022 06:39:29 +0200 [thread overview]
Message-ID: <YxV9gYM9IuoebNdE@tuxteam.de> (raw)
In-Reply-To: <87fsh6hjgj.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1873 bytes --]
On Mon, Sep 05, 2022 at 12:16:31AM +0200, Alessandro Bertulli wrote:
>
> Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
>
> > `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).
> >
> > 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.
> >
> > You can use things like:
> >
> > (with-eval-after-load 'latex
> > (define-key LaTeX-mode-map (kbd "C-c a") #'my-bar)
> > (define-key LaTeX-mode-map (kbd "C-c b") #'my-foo))
>
> You honestly opened a world to me. I have long wondered the difference
> between require and with-eval-after-load (of course I could have read
> the docs, but I never found time). :-)
>
> > or
> >
> > (defun my-latex-setup ()
> > (define-key LaTeX-mode-map (kbd "C-c a") #'my-bar)
> > (define-key LaTeX-mode-map (kbd "C-c b") #'my-foo))
> > (add-hook 'LaTeX-mode-hook #'my-latex-setup)
> >
> > in order to delay the customization to after the variable is defined.
>
> Isn't this redundant? You call the function every time a LaTeX file is
> loaded. The first method is preferrable, right?
I think they are doing different things. There are things you want to
happen on each buffer when and once it becomes a "LaTeX buffer". Setting
buffer-local variables comes to mind.
And to nitpick a bit more: it doesn't happen when a LaTeX file is loaded,
but when LaTeX mode is "switched on", that can happen in other occassions
too (when creating a new buffer you know it will be LaTeX, but you can
also switch the mode on and off; LaTeX isn't a good example for the second).
Cheers
--
t
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2022-09-05 4:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 14:32 Unicode characters for transcribing to pdf wilnerthomas--- via Users list for the GNU Emacs text editor
2022-08-31 15:28 ` Eric S Fraga
2022-08-31 16:04 ` uzibalqa
2022-08-31 16:31 ` Eric S Fraga
2022-08-31 16:49 ` uzibalqa
2022-08-31 17:27 ` tomas
2022-08-31 21:37 ` Joost Kremers
2022-09-01 4:18 ` uzibalqa
2022-09-01 9:12 ` Alessandro Bertulli
2022-09-01 12:04 ` Arash Esbati
2022-09-03 10:58 ` Alessandro Bertulli
2022-09-03 18:24 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-09-04 6:32 ` Emanuel Berg
2022-09-05 11:44 ` Akib Azmain Turja
2022-09-04 22:16 ` Alessandro Bertulli
2022-09-05 4:39 ` tomas [this message]
2022-09-05 9:16 ` Alessandro Bertulli
2022-09-05 18:51 ` tomas
2022-09-05 11:45 ` Akib Azmain Turja
2022-09-05 14:43 ` Stefan Monnier
[not found] ` <87edwve99q.fsf@gmail.com-NAsW-xw----2>
2022-09-01 11:35 ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-09-03 10:54 ` Alessandro Bertulli
2022-09-01 13:05 ` Stefan Monnier via Users list for the GNU Emacs text editor
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YxV9gYM9IuoebNdE@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.