From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16402: 24.3.50; Document nadvice.el stuff in Elisp manual before Emacs 24.4 Date: Fri, 10 Jan 2014 09:42:50 -0500 Message-ID: References: <86r48glgbt.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389364999 15591 80.91.229.3 (10 Jan 2014 14:43:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2014 14:43:19 +0000 (UTC) Cc: 16402@debbugs.gnu.org To: Andy Moreton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 10 15:43:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W1dIv-0001bT-4Z for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jan 2014 15:43:21 +0100 Original-Received: from localhost ([::1]:57273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1dIu-0001ze-PA for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jan 2014 09:43:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1dIk-0001yf-6g for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 09:43:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1dIc-0003jm-Si for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 09:43:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1dIc-0003ji-Om for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 09:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W1dIc-0001ot-Ea for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2014 09:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jan 2014 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16402-submit@debbugs.gnu.org id=B16402.13893649746979 (code B ref 16402); Fri, 10 Jan 2014 14:43:02 +0000 Original-Received: (at 16402) by debbugs.gnu.org; 10 Jan 2014 14:42:54 +0000 Original-Received: from localhost ([127.0.0.1]:44883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W1dIU-0001oU-7R for submit@debbugs.gnu.org; Fri, 10 Jan 2014 09:42:54 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:54986) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W1dIR-0001oH-8l for 16402@debbugs.gnu.org; Fri, 10 Jan 2014 09:42:51 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFxKG9/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av8EABK/CFFFxKG9/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="44641000" Original-Received: from 69-196-161-189.dsl.teksavvy.com (HELO pastel.home) ([69.196.161.189]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Jan 2014 09:42:50 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 622CC6045A; Fri, 10 Jan 2014 09:42:50 -0500 (EST) In-Reply-To: <86r48glgbt.fsf@gmail.com> (Andy Moreton's message of "Fri, 10 Jan 2014 02:29:42 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83230 Archived-At: > A rationale to explain why the existing advice package needs changing > would also be helpful. Here are some of the reasons: - I implemented add-function, which is a different feature not provided by advice.el. - implementing advice-add on top of the add-function code takes just 8KB. - by contrast advice.el was 150KB (now reduced to 130KB by using nadvice.el). - once add-function is documented, documenting advice-add is similarly much simpler than defadvice. - advice-add fixes several problems in defadvice: - the fact that defadvice does not expand macros in its code unless you explicitly ask for the advice to be compiled. - the fact that defadvice only compiles either too early (via the "precompilation", which is rarely used and rightly so) or too late (when activating the advice), so you typically won't get any byte-compiler warnings. - ad-do-it and ad-return-value in `around' advice don't work the way people intuitively expect them to. - ad-activate and ad-deactivate have global effects (i.e. they affect all advices applied to that symbol), so any use of those within a package is a bug in the waiting. - the distinction between enabling/disabling and activating/deactivating is "too subtle" for the users of defadvice: it's really just a reflection of the underlying implementation. - advice.el is much too large to be preloaded, so for example debug.el refrained from using it. > As an aside, storing raw bytecode in advice--where-alist seems hackish. Agreed. > Is it not possible to construct this byte code from something more > human readable at compile time ? It's possible, but the pre-existing code which does something like that is in the byte-compiler and does not provide quite the right feature. It didn't seem worth the trouble to restructure that code just for that one use. Stefan