help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: with-eval-after-load with sh-mode


From: Arthur Miller
Subject: Re: with-eval-after-load with sh-mode
Date: Fri, 02 Jul 2021 22:59:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Arthur Miller wrote:
>
>> You don't need to require sh-script.el. sh-mode is
>> autolaoded function so Emacs will load sh-script when
>> sh-mode is invoked automatically.
>
> You sometimes need to `require' it anyway, e.g. try setting
> the face `sh-escaped-newline' to something.
>
> The byte-compiler seems to be OK with it (it doesn't say
> anything) but when the file that does it is loaded it says
> that's an invalid face and everything comes to a halt.
>
> BTW it seems you don't need the hook solution for this
> particular mode, just require and set the faces, when the mode
> is loaded the faces are OK what I can see.

Of course you can require, but why require it in your init file when you
can postpone that loading (lazy load it) until you actually use sh-mode?
Set that face in either with-eval-after-load or mode hook so you don't
need to require that file before it is actually needed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]