Subject: Re: bug#49647: 27.2; Reference Manual sec. 10.2.4; Incorrect example for indirect-function

From: Michael Heerdegen <[email-masked]>
Date: Tue, 20 Jul 2021 01:59:06 +0200

Scott Marks <[email-masked]> writes:

> If one copies the example:

You mean from the manual, (info "(elisp) Function Indirection") I think.

>  Here is how you could define indirect-function in Lisp:
>
>  (defun indirect-function (function)
>
>    (if (symbolp function)
>
>        (indirect-function (symbol-function function))
>
>      function))
>
> this code will throw due to infinite recursion when invoked as
>
> (indirect-function nil)
>
> The fix is obvious: wrap (symbolp function) with (and function ...)

In my opinion your analysis is correct and the fix is good.

I leave it to the second reader to make the change.

Michael.