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

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

Re: include clause in interactive command


From: mbork
Subject: Re: include clause in interactive command
Date: Mon, 02 Dec 2024 08:50:56 +0100

On 2024-12-01, at 12:00, Heime via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> wrote:

> Sent with Proton Mail secure email.
>
> On Sunday, December 1st, 2024 at 4:42 PM, Zhengyi Fu <i@fuzy.me> wrote:
>
>> On 2024-11-30 19:38, Heime via Users list for the GNU Emacs text editor
>> wrote:
>> 
>> > I have an interactive function that changes some buffer settings.
>> > But it also has an include clause (include 'orellana).
>> > 
>> > Would one usually recommend calling it only once, or calling it
>> > everytime a user uses the function is ok?
>> 
>> 
>> What is an “include clause”?
>
> A mistake.  I am referring to require.

Per the manual:

--8<---------------cut here---------------start------------->8---
This function checks whether FEATURE is present in the current
Emacs session (using ‘(featurep FEATURE)’; see below).  The
argument FEATURE must be a symbol.
--8<---------------cut here---------------end--------------->8---

(http://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html)

So, there should be very little penalty to calling `require' in your
command (especially that it is coded in C, not Elisp).

OTOH, it might be not necessary.  If what you need from the required
library has the `autoload' cookie
(http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html),
the library will be loaded automatically the first time you use the
autoloaded function.

Hth,

-- 
Marcin Borkowski
http://mbork.pl
http://crimsonelevendelightpetrichor.net/



reply via email to

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