From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: unload-feature questions and thoughts Date: Mon, 5 Feb 2007 01:10:36 +0100 Message-ID: References: <85bqk9db9a.fsf@lola.goethe.zz> <851wl5d9b2.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1170634258 28799 80.91.229.12 (5 Feb 2007 00:10:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Feb 2007 00:10:58 +0000 (UTC) To: "Emacs Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 05 01:10:49 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HDrRY-0001t5-4M for ged-emacs-devel@m.gmane.org; Mon, 05 Feb 2007 01:10:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDrRZ-0006YK-GX for ged-emacs-devel@m.gmane.org; Sun, 04 Feb 2007 19:10:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HDrRO-0006Y5-L3 for emacs-devel@gnu.org; Sun, 04 Feb 2007 19:10:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HDrRN-0006Xp-LJ for emacs-devel@gnu.org; Sun, 04 Feb 2007 19:10:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDrRN-0006Xm-Ia for emacs-devel@gnu.org; Sun, 04 Feb 2007 19:10:37 -0500 Original-Received: from nz-out-0506.google.com ([64.233.162.236]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HDrRN-0003Fh-99 for emacs-devel@gnu.org; Sun, 04 Feb 2007 19:10:37 -0500 Original-Received: by nz-out-0506.google.com with SMTP id s1so1308869nze for ; Sun, 04 Feb 2007 16:10:36 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aXUOT758wSACwgM2+38Lc8qm6w6bJsrC7oUg3ney8GeqidgdrrBszrVTN4ah8DwkNc/FjZTm9U1RX+flna+6yek1lIluompBYA15UP4qizvl6W5P10ng51aIkFiI8+195KD+Eaf7di+sr0RRwehiRMBcf1Lg97BUuxQnivoF6qw= Original-Received: by 10.114.12.9 with SMTP id 9mr543902wal.1170634236398; Sun, 04 Feb 2007 16:10:36 -0800 (PST) Original-Received: by 10.114.234.16 with HTTP; Sun, 4 Feb 2007 16:10:36 -0800 (PST) In-Reply-To: <851wl5d9b2.fsf@lola.goethe.zz> Content-Disposition: inline X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65870 Archived-At: On 2/4/07, David Kastrup wrote: > It defines tex-site-unload-hook already. But "whatever is necessary" > pretty much means restoring all functions overwritten by AUCTeX, and > there is no point in not using the autoload unloader for that. In fact (and this is not a proposal, at least not now), the current working of `unload-feature' is a bit puzzling. Instead of running either `FEATURE-unload-hook' (if found) or its normal heuristics, it'd be better if it ran a FEATURE-unload-function, which would return t to stop, or nil to *also* use the function's current heuristics. That way, a package could define a FEATURE-unload-function to undo unusual things, and leave the burden of the unloading to `unload-feature'. I imagine it could be faked right now with: (defun myfeature-unload-hook () ;; Undo unusual things, then: (let ((fun (symbol-function 'myfeature-unload-hook))) (fmakunbound 'myfeature-unload-hook) (ignore-errors (unload-feature 'myfeature)) (fset 'myfeature-unload-hook fun))) which is quite ugly, but it should work. /L/e/k/t/u