From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: unload-feature questions and thoughts Date: Wed, 10 Oct 2007 10:56:11 -0700 (PDT) Message-ID: <55585.128.165.123.18.1192038971.squirrel@webmail.lanl.gov> References: <86r6t5qdbo.fsf@lola.quinscape.zz> <861wl5q7al.fsf@lola.quinscape.zz> <54853.128.165.123.18.1192027947.squirrel@webmail.lanl.gov> <55463.128.165.123.18.1192035787.squirrel@webmail.lanl.gov> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1192039030 13663 80.91.229.12 (10 Oct 2007 17:57:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Oct 2007 17:57:10 +0000 (UTC) Cc: Emacs Devel To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 10 19:56:56 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 1Iffnb-0004rd-Aw for ged-emacs-devel@m.gmane.org; Wed, 10 Oct 2007 19:56:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IffnV-0006Ls-Bq for ged-emacs-devel@m.gmane.org; Wed, 10 Oct 2007 13:56:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IffnO-0006H2-W8 for emacs-devel@gnu.org; Wed, 10 Oct 2007 13:56:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IffnN-0006DM-0D for emacs-devel@gnu.org; Wed, 10 Oct 2007 13:56:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IffnM-0006Cd-Me for emacs-devel@gnu.org; Wed, 10 Oct 2007 13:56:32 -0400 Original-Received: from mailwasher.lanl.gov ([204.121.3.2]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IffnM-0007hw-0O for emacs-devel@gnu.org; Wed, 10 Oct 2007 13:56:32 -0400 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by mailwasher.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l9AHuFi7003406; Wed, 10 Oct 2007 11:56:16 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l9AHuChp024110; Wed, 10 Oct 2007 11:56:12 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id l9AHuCwd010484; Wed, 10 Oct 2007 11:56:12 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id l9AHuBr5010482; Wed, 10 Oct 2007 10:56:11 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.18 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Wed, 10 Oct 2007 10:56:11 -0700 (PDT) In-Reply-To: User-Agent: SquirrelMail/1.4.8-6.el3.2lanl X-Priority: 3 (Normal) Importance: Normal X-CTN-5-MailScanner-Information: Please see http://network.lanl.gov/email/virus-scan.php X-CTN-5-MailScanner: Found to be clean X-CTN-5-MailScanner-From: herring@lanl.gov X-Detected-Kernel: Linux 2.4-2.6 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:80527 Archived-At: > Yes, that's what I've been proposing. It should have to be a new hook > for compatibility, I think. I'm not sure the compatibility is worth the complexity. The current behavior is so badly documented and random (auto-mode-alist being treated as a hook) that I would just call it a bug fix. To check this, I went through all the unload hooks in the sources: delsel.el seems to think that its pre-command-hook entry will get cleared for it, and the `remove-hook's it already does wouldn't hurt anything with the change. Regardless of the change, server.el needs to clear its `kill-emacs-hook' entry (loadhist.el wouldn't, even without `server-unload-hook', because `server-mode' is autoloaded). It also needs to kill its C-x # binding, suggesting that loadhist.el should perhaps sweep keymaps. With the change, server.el wouldn't have to do any of its extant `remove-hook's, but they too would do no harm. shadowfile.el needs to kill its C-x 4 s binding (again, should sweep keymaps). Its `remove-hook's would also be harmlessly redundant. strokes.el wouldn't have to get rid of its `kill-emacs-query-functions' entry itself. whitespace.el has to have its unload function, because the functions it adds to hooks are autoloaded. emacs-lisp/cl.el and emacs-lisp/elp.el have meaningful unload functions too. eshell/*.el make their unload functions customizable for some reason. eshell/esh-mode.el and eshell/esh-module.el are particularly odd: the former has a default value of nil, so it just suppresses loadhist.el's hook/a-m-a action, and the latter recursively unloads features -- it should document that those features cannot `require' 'esh-module because `unload-feature' would then refuse to unload it because of them even though they would get unloaded too. gnus/gnus-registry.el and gnus/spam-stat.el each have an interactive unload hook that isn't necessary as an unload hook; it should be renamed to "...-uninstall-hooks" to match its counterpart. url/url-vars.el has a similarly needless unload hook. So I think that the evidence is for the intuitively obvious statement that no one knows how to use the hook. I found no examples where the normal heuristics would break anything, although neither did I find any examples where the unload-hook actually broke things by suppressing the "normal heuristics". So I think treating it as a bug is probably the right thing to do for simplicity: just do the heuristics regardless, and let the rare hooks that really need to suppress them kill the variable bound for that purpose. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.