From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#5293: 23.1; unload-feature on buffer-local hooks Date: Fri, 15 Jul 2011 10:52:30 +0200 Message-ID: <87oc0wdiy9.fsf@gmail.com> References: <87hbr4p67t.fsf@blah.blah> <871uxsl778.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310720310 21811 80.91.229.12 (15 Jul 2011 08:58:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2011 08:58:30 +0000 (UTC) Cc: Kevin Ryde , 5293@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 15 10:58:26 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QheE6-0004Ys-CJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Jul 2011 10:58:26 +0200 Original-Received: from localhost ([::1]:58810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QheE5-0007Y3-IR for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Jul 2011 04:58:25 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QheDn-0007XU-JO for bug-gnu-emacs@gnu.org; Fri, 15 Jul 2011 04:58:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QheDj-0007J1-DZ for bug-gnu-emacs@gnu.org; Fri, 15 Jul 2011 04:58:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QheDj-0007Iv-2k for bug-gnu-emacs@gnu.org; Fri, 15 Jul 2011 04:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QheDi-0001ht-2T; Fri, 15 Jul 2011 04:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jul 2011 08:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5293 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5293-submit@debbugs.gnu.org id=B5293.13107202246492 (code B ref 5293); Fri, 15 Jul 2011 08:58:02 +0000 Original-Received: (at 5293) by debbugs.gnu.org; 15 Jul 2011 08:57:04 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QheCl-0001gf-Pi for submit@debbugs.gnu.org; Fri, 15 Jul 2011 04:57:04 -0400 Original-Received: from mail-fx0-f42.google.com ([209.85.161.42]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QheCj-0001gB-KZ for 5293@debbugs.gnu.org; Fri, 15 Jul 2011 04:57:02 -0400 Original-Received: by fxe23 with SMTP id 23so2846304fxe.29 for <5293@debbugs.gnu.org>; Fri, 15 Jul 2011 01:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=ol0mEKswTCd8oL5iiOjsugbZdpNNzJTkj+7j9THTZBw=; b=gj0146JcqUPg1gi9wEKRs2YTUr5zOkxFACgPpR2N/1ocw7lNJWAjsbDuxysguNdvEf EDFgcQcl5nlbjJCvYN0Gb7d6PCuhHlv7GHY/+A1NrK96fVfZu2xbALJgTAimSMltJcxX ktjkX+fdHTikQw9jf1un2eoOa+IwIyak4dL/I= Original-Received: by 10.223.75.25 with SMTP id w25mr1368824faj.140.1310720215464; Fri, 15 Jul 2011 01:56:55 -0700 (PDT) Original-Received: from localhost (176.119.broadband10.iol.cz [90.177.119.176]) by mx.google.com with ESMTPS id a24sm652534fak.12.2011.07.15.01.56.52 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jul 2011 01:56:52 -0700 (PDT) In-Reply-To: (Juanma Barranquero's message of "Fri, 15 Jul 2011 02:34:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 15 Jul 2011 04:58:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:49115 Archived-At: Juanma Barranquero writes: > On Fri, Jul 15, 2011 at 02:26, Kevin Ryde wrote: > >> Or conversely, it's undesirable to leave behind an unbound func in a >> hook, and the same undesirability as to a buffer-local value as a global >> value. > > But the usual case is that these buffer-local values are set via major > modes also defined in the same package, and so they are automatically > removed when the major modes are disabled (i.e., when the buffers are > switched to other major modes). The only case where a buffer-local > value is left behind is when the package's code sets it in > non-standard ways, and in this case, it's the package responsability > to define a FEATURE-unload-function to undo the changes. > > The philosophy behind unload-feature is: we try to automatically undo > the easy/standard things, and give the package the opportunity to undo > the hard/unstandard things itself. And I think it's the right > approach. 1) If your reasoning about hooks being added via modes were correct, you wouldn't have to remove even the global hook additions. If it's faulty (which is probably the case), both global and local hooks need to be managed, as Kevin said. 2) The `unload-feature' docstring says it undoes "any additions that the library has made to hook variables", but that's apparently not what's really happening, so if things stay as they are, the doc string should be corrected. 3) Are local hook additions really such a "hard/unstandard" thing to undo? =C5=A0t=C4=9Bp=C3=A1n