all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alessandro Bertulli <alessandro.bertulli96@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Unicode characters for transcribing to pdf
Date: Mon, 05 Sep 2022 00:16:31 +0200	[thread overview]
Message-ID: <87fsh6hjgj.fsf@gmail.com> (raw)
In-Reply-To: <jwvczccz5es.fsf-monnier+emacs@gnu.org>


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?

Alessandro



  parent reply	other threads:[~2022-09-04 22:16 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 [this message]
2022-09-05  4:39               ` tomas
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=87fsh6hjgj.fsf@gmail.com \
    --to=alessandro.bertulli96@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.