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

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

bug#17571: 24.4.50; doc string of `advice-function-mapc' etc.


From: Drew Adams
Subject: bug#17571: 24.4.50; doc string of `advice-function-mapc' etc.
Date: Wed, 14 Aug 2019 17:40:56 -0700 (PDT)

> > Not the only doc string in nadvice.el that needs help.  HTH.
> >
> >  Apply F to every advice function in FUNCTION-DEF.
> >  F is called with two arguments: the function that
> >  was added, and the properties alist that was
> >  specified when it was added.
> 
> This seems to be a pretty internalish function deep down in the nadvice
> library, and the doc string seems sufficient for such a function, I
> think.  Perhaps it would have been better as a comment instead of a doc
> string, really.
> 
> Closing.

Unfortunate. I can't imagine why you'd think
such a thing.  This is hardly a function used
only to implement advice.  It's a utility
function.  And it's documented in the manual
(just as poorly, but it's there).

"Internalish"?  This function is about as
useful for advice as `mapcar' is for lists.
Nadvice deals with sequences of advice.  How
else would you map a function over them?

For example:

(remove-function
  isearch-filter-predicate
  (let ((oname  nil))
    (catch 'foo
      (advice-function-mapc
        (lambda (pred props)
          (when
            (equal predicate
                   (setq oname
                         (cdr (assq 'name
                                    props))))
            (throw 'foo oname)))
        isearch-filter-predicate)
      (setq predicate  (intern predicate)))))





reply via email to

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