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

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

Re: customize xref


From: James K. Lowden
Subject: Re: customize xref
Date: Tue, 10 Jan 2017 15:38:58 -0500

On Tue, 10 Jan 2017 13:28:08 -0500
"James K. Lowden" <jklowden@speakeasy.net> wrote:

> (custom-set-variables
>  '(xref-after-jump-hook
>    (quote (recenter xref-pulse-momentarily))))

I see: 

(custom-set-variables
 '(xref-after-jump-hook
   (quote (lambda () (recenter 0) xref-pulse-momentarily))))

Because recenter is a function, it needs to be replaced with a
function, not a function invocation, and not the output of a function.
Unless, that is -- as in the case of lambda -- the function returns a
function.  

In this case, xref-after-jump-hook takes as parameters two arguments,
each a function.  I can't pass it 3 arguments

        (recenter 0 xref-pulse-momentarily)

nor the result of recentering, 

        ((recenter 0) xref-pulse-momentarily)

but I can pass it an unnamed function.  The lisp interpreter reduces 

   (quote (lambda () (recenter 0) xref-pulse-momentarily))

by executing the lambda to 

   (quote (anonymous-func xref-pulse-momentarily))

where anonymous-func calls (recenter 0).

--jkl


reply via email to

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