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#8387: 24.0.50; `run-hook-with-args' return value has changed Date: Thu, 31 Mar 2011 11:02:49 -0400 Message-ID: References: <877hbfn6w1.fsf@maru.md5i.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301584083 23503 80.91.229.12 (31 Mar 2011 15:08:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2011 15:08:03 +0000 (UTC) Cc: 8387@debbugs.gnu.org To: Michael Welsh Duggan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 31 17:07:59 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5JTW-00067k-R6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Mar 2011 17:07:55 +0200 Original-Received: from localhost ([127.0.0.1]:40905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5JTW-0001wW-4Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Mar 2011 11:07:54 -0400 Original-Received: from [140.186.70.92] (port=50936 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5JSx-0001gM-4x for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2011 11:07:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5JSv-0003X2-PH for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2011 11:07:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5JSv-0003Wx-IB for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2011 11:07:17 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q5JOo-00036K-74; Thu, 31 Mar 2011 11:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Mar 2011 15:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8387 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8387-submit@debbugs.gnu.org id=B8387.130158377711904 (code B ref 8387); Thu, 31 Mar 2011 15:03:02 +0000 Original-Received: (at 8387) by debbugs.gnu.org; 31 Mar 2011 15:02:57 +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 1Q5JOj-00035x-0z for submit@debbugs.gnu.org; Thu, 31 Mar 2011 11:02:57 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5JOh-00035m-CB for 8387@debbugs.gnu.org; Thu, 31 Mar 2011 11:02:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAFeXlE1FxLZM/2dsb2JhbAClTHiIebZAhWsEliU X-IronPort-AV: E=Sophos;i="4.63,275,1299474000"; d="scan'208";a="98786440" Original-Received: from 69-196-182-76.dsl.teksavvy.com (HELO ceviche.home) ([69.196.182.76]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 31 Mar 2011 11:02:49 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 2CEF8660C7; Thu, 31 Mar 2011 11:02:49 -0400 (EDT) In-Reply-To: <877hbfn6w1.fsf@maru.md5i.com> (Michael Welsh Duggan's message of "Thu, 31 Mar 2011 02:25:34 -0400") 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: Thu, 31 Mar 2011 11:03: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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45530 Archived-At: > (defun foo (arg) 'test) C-j > (defvar foo-hook '(foo)) C-j > (run-hook-with-args 'foo-hook 'foo) C-j > In the past, this would return 'test instead of nil. This breaks some [...] > I don't have time to test this right now, but I would guess this started > happening in the following commit: [...] > (run_hook_with_args): Call each function through a `funcall' argument. > Remove `cond' argument, now redundant. > (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success) > (Frun_hook_with_args_until_failure): Adjust accordingly. No doubt it's the origin of the new behavior. But note that the above change has not touched the docstring of run-hook-with-args which says: It is best not to depend on the value returned by `run-hook-with-args', as that may change. Looking at the BBDB code, I think we don't need to try and accomodate it because it is fundamentally broken, not just because of the above docstring warning: ;; Hysterical Raisins: This is a function, not a hook. In order to ;; make this hook a hook, we'll quietly convert a single function ;; into a hook list. We should really warn the user that we're ;; doing this, and advise them to update their configuration ;; accordingly. For the release, maybe. (if (functionp bbdb-canonicalize-net-hook) (setq bbdb-canonicalize-net-hook (list bbdb-canonicalize-net-hook))) ;; Now, do the hook run. Note, if you mess up, it's possible that ;; BBDB will get stuck here oscillating between various definitions ;; of the canonical address. (while (not (equal net (setq net (run-hook-with-args 'bbdb-canonicalize-net-hook net))))) So bbdb-canonicalize-net-hook can start as a single function or a list of functions. But the code is explicit about wanting a list of functions. Now if this list contains N>1 function, then run-hook-with-args has to call all those functions and discard at least N-1 of the results. I.e. only one of the functions on bbdb-canonicalize-net-hook can work (in Emacs-23, one of them happened to work, and on the current trunk, none of them work). Stefan