GNU bug report logs - #5301
23.1; unload-feature remove defadvice

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Kevin Ryde <user42@HIDDEN>; dated Sun, 3 Jan 2010 23:29:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Juanma Barranquero <lekktu@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Jan 2010 23:28:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 03 18:28:23 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NRZry-0002xx-Kf
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 18:28:22 -0500
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gg@HIDDEN>) id 1NRZrw-0002xs-Kc
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 18:28:21 -0500
Received: from mail.gnu.org ([199.232.76.166]:40564 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gg@HIDDEN>) id 1NRZrs-0003Kz-Py
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 18:28:16 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <gg@HIDDEN>) id 1NRZro-000728-Ei
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 18:28:14 -0500
X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python
X-Spam-Level: 
X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,
	FORGED_RCVD_HELO,UNPARSEABLE_RELAY autolearn=ham version=3.1.0
Received: from lists.gnu.org ([199.232.76.165]:37234)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <gg@HIDDEN>) id 1NRZro-000724-8r
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 18:28:12 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NRZro-00032C-0j
	for bug-gnu-emacs@HIDDEN; Sun, 03 Jan 2010 18:28:12 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NRZrj-0002zv-AO
	for bug-gnu-emacs@HIDDEN; Sun, 03 Jan 2010 18:28:11 -0500
Received: from [199.232.76.173] (port=56802 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NRZrj-0002zs-6J
	for bug-gnu-emacs@HIDDEN; Sun, 03 Jan 2010 18:28:07 -0500
Received: from mailout1-6.pacific.net.au ([61.8.2.213]:40665
	helo=mailout1.pacific.net.au)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <gg@HIDDEN>) id 1NRZri-0006za-4U
	for bug-gnu-emacs@HIDDEN; Sun, 03 Jan 2010 18:28:06 -0500
Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au
	[61.8.2.163])
	by mailout1.pacific.net.au (Postfix) with ESMTP id C969F507FD1
	for <bug-gnu-emacs@HIDDEN>; Mon,  4 Jan 2010 10:28:01 +1100 (EST)
Received: from blah.blah (ppp2EA9.dyn.pacific.net.au [61.8.46.169])
	by mailproxy2.pacific.net.au (Postfix) with ESMTP id 0AA1827430
	for <bug-gnu-emacs@HIDDEN>; Mon,  4 Jan 2010 10:28:01 +1100 (EST)
Received: from gg by blah.blah with local (Exim 4.71)
	(envelope-from <gg@HIDDEN>) id 1NRZrX-0004xH-Ct
	for bug-gnu-emacs@HIDDEN; Mon, 04 Jan 2010 10:27:55 +1100
From: Kevin Ryde <user42@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 23.1; unload-feature remove defadvice
Date: Mon, 04 Jan 2010 10:27:54 +1100
Message-ID: <877hry7oqt.fsf@HIDDEN>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -5.3 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.4 (-----)

As an idea, it'd be good if defadvice were among the `def' things
automatically unloaded by `unload-feature'.

A defadvice will nearly always use functions or whatever in the defining
package and if they've been unloaded it could leave the advised target
function badly broken.

I know it's possible for a foo-unload-function to undo its defadvices.
I've done that for some of my things, but it gets very repetitive and
makes me think defadvice could set that up itself.

I know advice is a slightly second class citizen, but if the necessary
unloading stuff were confined to advice.el then it needn't be a burden
if no advise is in use.

My best idea so far would be for defadvice to record something in
load-history like

    (defadvice . (TARGET CLASS AD-NAME))

if it could beg a tie-in to unload-feature at a good spot.  Something
indirect like a property setting on the `defadvice' symbol appearing in
the load-history might let other `def' macros jig up unloading for
themselves in a general way.

    ;; untested!
    (put 'defadvice 'load-history-unload-feature-function
         (lambda (elem)
           (when (apply 'ad-find-advice (cdr elem))
             (apply 'ad-remove-advice (cdr elem))
             (ad-activate (cadr elem)))))

May have to think about what happens if the package defining the `def'
macro is unloaded when things it has `def'fed still exist.  But if
`require's express dependencies correctly that might never arise.



In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''





Acknowledgement sent to Kevin Ryde <user42@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#5301; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.