emacs-devel
[Top][All Lists]
Advanced

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

RE: 1) (elisp) `Advising Named Functions', 2) search filtering example


From: Drew Adams
Subject: RE: 1) (elisp) `Advising Named Functions', 2) search filtering example
Date: Mon, 17 Oct 2016 10:05:51 -0700 (PDT)

> > Applying macro `add-function' to `isearch-filter-predicate'
> > advises the value - the function itself.
> No.
> 
> > It does not just point the variable to a different value
> > (function).
> Yes it does.

OK.

> > `(symbol-function isearch-filter-predicate)' returns an advice
> > (an object that satisfies "internal" predicate `advice--p').
> 
> No, it returns nil because this symbol is not defined as a function.

I did not quote that symbol.  But yes, you get an error because
the value of the variable is _not_ a symbol (anymore) - it is now
an advice object (an advised function, I was calling it).  It is a
thingy such as this - an advice of function `isearch-filter-visible'.

#[128 <some-byte-code> [apply (lambda (b e) (save-excursion
(goto-char e) (eolp))) isearch-filter-visible ((name . "eol")
(isearch-message-prefix . "eol, "))] 4 nil]

Dunno what you want to call such a thing.  I was calling it
an advised function (in this case, `isearch-filter-visible')
and an advice of that function, but yes, that function is not
advised outside this context - it is only variable
`isearch-filter-predicate' that uses that thingy.

To me, the new advice doc is not as helpful as it should be,
and the thingies dealt with are not clear or clearly presented.
Even the resort to "internalizing" functions such as `advice--p'
and `advice--cd*r' seems unfortunate.

I'm sure you understand it all very well, and no doubt there
are things about it that I do not understand well.  If you
cannot or will not, I'm still hoping that someone else will
improve the doc and make things clearer, for all.



reply via email to

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