all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: 1) (elisp) `Advising Named Functions', 2) search filtering example
Date: Mon, 17 Oct 2016 13:47:29 -0400	[thread overview]
Message-ID: <jwv4m4ac1zm.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <14560de9-7ab9-4d97-80dd-d4b84274affb@default> (Drew Adams's message of "Mon, 17 Oct 2016 10:05:51 -0700 (PDT)")

> #[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.

A function object (a closure).  More specifically a function which is
the composition of two or more functions.  You could get a similar
function without using add-function, but using instead something like

    (setq isearch-filter-predicate
          (let ((old isearch-filter-predicate))
            (lambda (&rest args)
              (and (apply <f> args)
                   (apply old args)))))

> 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.

To me, they're not as obscure as they should be: in my world, functions
are black boxes (you only get to know their type).

If you do

   (setq isearch-filter-predicate (symbol-function isearch-filter-predicate))

you end up with a variable that behaves pretty much exactly as before,
but if you look at the value of `isearch-filter-predicate` it will
suddenly look like some gobbledygook as well.  The fact that sometimes
you get a symbol is just an accident.

> If you cannot or will not, I'm still hoping that someone else will
> improve the doc and make things clearer, for all.

I have no idea how to improve the doc, so feel free to try and do it.
In the past I've had some luck with a "generate&test" approach, where
someone writes a tentative doc, and I point out the factual errors in it,
repeating the process until the doc is both understandable and correct.


        Stefan



  reply	other threads:[~2016-10-17 17:47 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=jwv4m4ac1zm.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.