unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: RE: 1) (elisp) `Advising Named Functions', 2) search filtering example
Date: Mon, 17 Oct 2016 07:02:42 -0700 (PDT)	[thread overview]
Message-ID: <1807679d-1125-4afe-81b7-b8d8e78aa2c6@default> (raw)
In-Reply-To: <CAM-tV--cV0HvqLpSLYXMuzfvD+6wnpn4Eq4it28Q=s6LfN-aNw@mail.gmail.com>

> `advice-add' puts advice on a function, `add-function'
> does not.

I don't think so.  AFAICS, `add-function' certainly does
"put advice on a function".

`advice-add' is essentially `add-function' for a _named_
function.  It does not apply to lambda forms etc.  It is
a wrapper around `add-function' that also deals with the
symbol itself (e.g. adding doc, handling macro symbols,...).

But you raise a reasonable point about that doc.  AFAICT,
nearly everything that is said in that node about potential
problems and reserving advice for when you cannot modify a 
function's behavior any other way applies just as well to
`add-function' etc. as to `advice-add' etc.

AFAICS, that info and advice is about advising functions.
It is not just about advising named functions, and even if
it were, it should apply equally to `add-function' for a
named function.

Do you think that that information does not apply also
to this code, from dired-aux.el?  If so, why?

(add-function :before-while (local 'isearch-filter-predicate)
              #'dired-isearch-filter-filenames
              '((isearch-message-prefix . "filename ")))

(The local value of `isearch-filter-predicate' can of
course be a named function.  But it need not be.)

> `isearch-filter-predicate' is not a function, it's a
> variable containing a function value.

Yes, I know that.  (And its value is not necessarily a
symbol.)



  reply	other threads:[~2016-10-17 14:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  5:25 1) (elisp) `Advising Named Functions', 2) search filtering example Drew Adams
2016-10-17 12:20 ` Noam Postavsky
2016-10-17 14:02   ` Drew Adams [this message]
2016-10-17 14:37     ` Noam Postavsky
2016-10-17 14:52       ` Stefan Monnier
2016-10-17 15:40         ` Drew Adams
2016-10-17 15:51           ` Stefan Monnier
2016-10-17 17:05             ` Drew Adams
2016-10-17 17:47               ` Stefan Monnier
2016-10-17 15:40       ` Drew Adams
2016-10-17 16:16         ` Noam Postavsky
2016-10-17 17:05           ` Drew Adams
2016-10-17 17:53             ` Stefan Monnier
2016-10-17 18:41               ` Drew Adams
2016-10-17 19:25                 ` Stefan Monnier
2016-10-18 19:47                   ` Richard Stallman
2016-10-19  6:15                     ` Eli Zaretskii
2016-10-19 20:00                       ` Richard Stallman
2016-10-19 20:18                         ` Stefan Monnier
2016-10-20  7:17                           ` Eli Zaretskii
2016-10-20  7:06                         ` Eli Zaretskii
2016-10-20 18:06                           ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1807679d-1125-4afe-81b7-b8d8e78aa2c6@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).