From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: 1) (elisp) `Advising Named Functions', 2) search filtering example Date: Mon, 17 Oct 2016 10:05:51 -0700 (PDT) Message-ID: <14560de9-7ab9-4d97-80dd-d4b84274affb@default> References: <5a44a850-e4fc-4c9f-a266-c74766810ba1@default> <1807679d-1125-4afe-81b7-b8d8e78aa2c6@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1476724066 16693 195.159.176.226 (17 Oct 2016 17:07:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 17:07:46 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 19:07:42 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwBNv-0003CC-5b for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 19:07:35 +0200 Original-Received: from localhost ([::1]:34548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwBNx-0002NZ-BY for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 13:07:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwBMO-0001rT-Kv for emacs-devel@gnu.org; Mon, 17 Oct 2016 13:06:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwBMK-0007et-Lq for emacs-devel@gnu.org; Mon, 17 Oct 2016 13:06:00 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:47902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwBMK-0007dh-DR for emacs-devel@gnu.org; Mon, 17 Oct 2016 13:05:56 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9HH5sdx017591 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Oct 2016 17:05:54 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u9HH5s35001747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Oct 2016 17:05:54 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u9HH5qeN016086; Mon, 17 Oct 2016 17:05:53 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208372 Archived-At: > > Applying macro `add-function' to `isearch-filter-predicate' > > advises the value - the function itself. > No. >=20 > > 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'). >=20 > 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 [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.