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

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

Re: Executing function only if another function is defined


From: Emanuel Berg
Subject: Re: Executing function only if another function is defined
Date: Mon, 25 Jul 2022 03:39:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

carlmarcos--- via Users list for the GNU Emacs text editor wrote:

> Because it may be possible that some functions are not
> available (e.g. during testing or debugging phases), I would
> like to test whether the function `toucan' has been defined
> before I call `docboost'. What can I do?
>
> (defun toucan-usage ()
>   "TODO"
>
>   (docboost 'toucan "Usage Information"))

(Why are you using no-break space?)

What you can do?

You can ...

1. `require' the library where "toucan" is defined.

2. Use the hash/sharp-quote, #', instead of just the quote for
   toucan. (#' is `function' and ' is `quote' BTW.)

3. Byte-compile. The byte compiler will tell you if toucan
   is undefined.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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