[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unicode characters for transcribing to pdf
From: |
Akib Azmain Turja |
Subject: |
Re: Unicode characters for transcribing to pdf |
Date: |
Mon, 05 Sep 2022 17:45:32 +0600 |
Alessandro Bertulli <alessandro.bertulli96@gmail.com> writes:
> 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?
Yeah, the first one is IMHO better.
>
> Alessandro
>
--
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
signature.asc
Description: PGP signature
- Re: Unicode characters for transcribing to pdf, (continued)
- Re: Unicode characters for transcribing to pdf, Alessandro Bertulli, 2022/09/01
- Re: Unicode characters for transcribing to pdf, Arash Esbati, 2022/09/01
- Re: Unicode characters for transcribing to pdf, Alessandro Bertulli, 2022/09/04
- Re: Unicode characters for transcribing to pdf, tomas, 2022/09/05
- Re: Unicode characters for transcribing to pdf, Alessandro Bertulli, 2022/09/05
- Re: Unicode characters for transcribing to pdf, tomas, 2022/09/05
- Re: Unicode characters for transcribing to pdf,
Akib Azmain Turja <=
- Re: Unicode characters for transcribing to pdf, Stefan Monnier, 2022/09/05
Message not available
Re: Unicode characters for transcribing to pdf, Stefan Monnier, 2022/09/01