From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#23933: 25.1.50; Run a buffer-local hook with mapc Date: Mon, 11 Jul 2016 03:14:48 +0900 (JST) Message-ID: References: <83d1mlft8v.fsf@gnu.org> <8337nhfpxy.fsf@gnu.org> <83poqle7nh.fsf@gnu.org> <83k2gte5yw.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1468174559 21648 80.91.229.3 (10 Jul 2016 18:15:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jul 2016 18:15:59 +0000 (UTC) Cc: kifer@cs.stonybrook.edu, 23933@debbugs.gnu.org, Tino Calancha , monnier@iro.umontreal.ca, npostavs@users.sourceforge.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 10 20:15:45 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bMJGa-0004ez-A0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jul 2016 20:15:44 +0200 Original-Received: from localhost ([::1]:56352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMJGZ-0001Tq-73 for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jul 2016 14:15:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMJG0-00006k-SM for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 14:15:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMJFu-0003er-N4 for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 14:15:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMJFu-0003en-JQ for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 14:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bMJFu-00027n-Gc for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 14:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jul 2016 18:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23933 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23933-submit@debbugs.gnu.org id=B23933.14681744998145 (code B ref 23933); Sun, 10 Jul 2016 18:15:02 +0000 Original-Received: (at 23933) by debbugs.gnu.org; 10 Jul 2016 18:14:59 +0000 Original-Received: from localhost ([127.0.0.1]:45599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMJFr-00027J-2P for submit@debbugs.gnu.org; Sun, 10 Jul 2016 14:14:59 -0400 Original-Received: from mail-pf0-f176.google.com ([209.85.192.176]:35497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMJFq-00026u-2j for 23933@debbugs.gnu.org; Sun, 10 Jul 2016 14:14:58 -0400 Original-Received: by mail-pf0-f176.google.com with SMTP id c2so28384335pfa.2 for <23933@debbugs.gnu.org>; Sun, 10 Jul 2016 11:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=0Z0kx/SeqmB38QCmpXVJcuq5VakO1PDUREbrVAhG9A0=; b=RG0sc5/GdgPfgSY2jpeYdRSWzhf+e98VvuJ3ttEppVxVlw0e4m9vxyjFo7qv6q6MZJ ftuNybUVwMdRMzty2IvcOOveNT/tYupMxUzNJXzvHeBT9MCs2kTE1NpMoSpmLzVGuVZo zHp5KGDmmS5EJjZfoYWJdjBXw+OYSiO9grwurYybwBeAjo5Oa7idFibkbSJyvVVlH7iG SZl8MNQzVNrZH6X3CGPTZlLk/ZRdZvdm0hWHCyQxowA3jOOVKCJeZUoEE+JuO+CIBycy Hucws/W4RPY5y00RoixJcOXXyifMUSLQ9Ughxx4f0XtUjnv+epMTGy3zzF4LKgrFRzWF xMPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=0Z0kx/SeqmB38QCmpXVJcuq5VakO1PDUREbrVAhG9A0=; b=bjUK6Q5QO6kJYbFwGGRqtg4NZ/1yO78PH0M306e68/9EjNHL6H7E3noblSj0DJ5FTF e2pSvDf4Ie2vHfl0atMqmfxuvZayVbwDCVAlr8bDbOlj0gaZmPTtAD19D+56PAoNIvxY w9zZOYuvn1zDDHk+mjbwrouBE+QA9HpxMy1f05xu8Nbzp0G871XfOwIcIE9wYBPLQY53 D31Dy3qSt5VimWec4yiOcutCPUh/Cc+rRDC9Ku5ngk4VRfhzy6LqZ5FQAXXDm/7Kb5Cc tq757evyJHh0wFycEb2TvAc6bTd28aXQSMcBAIoskVuMwHNf2WBs6+jb9QU7TsJK1iid u6Xg== X-Gm-Message-State: ALyK8tLWh4HbqP36R3MoaGpxNnrKx/g/27Lo19i08Nnla9nd3MB5c2bYDh0dETParZ3rVA== X-Received: by 10.98.33.138 with SMTP id o10mr27899015pfj.151.1468174492421; Sun, 10 Jul 2016 11:14:52 -0700 (PDT) Original-Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id b7sm1360980pat.27.2016.07.10.11.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 11:14:51 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <83k2gte5yw.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:120806 Archived-At: On Sun, 10 Jul 2016, Eli Zaretskii wrote: > Can't we simply remove the t? If not, why not? Yes, we can and it is more readable: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index a6b88d5..f98c2f4 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -2522,7 +2522,7 @@ ediff-really-quit (frame-selected-window warp-frame)) 2 1)) - (mapc #'funcall after-quit-hook-internal) + (mapc #'funcall (delq t after-quit-hook-internal)) )) ;; Returns frame under mouse, if this frame is not a minibuffer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I also tried Noam suggestion about using push instead of add-hook on ediff-after-quit-hook-internal, that works also OK: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 7f0db5d..a092218 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -1904,13 +1904,12 @@ ediff-filegroup-action file1 file2 ;; provide startup hooks `(list (lambda () - (add-hook - 'ediff-after-quit-hook-internal + (push (lambda () (if (ediff-buffer-live-p ,(current-buffer)) (ediff-show-meta-buffer ,(current-buffer) ,session-number))) - nil 'local) + ediff-after-quit-hook-internal) (setq ediff-meta-buffer ,(current-buffer) ediff-meta-session-number ,session-number) @@ -1933,15 +1932,14 @@ ediff-filegroup-action file1 ;; provide startup hooks `(list (lambda () - (add-hook - 'ediff-after-quit-hook-internal + (push (lambda () (if (ediff-buffer-live-p ,(current-buffer)) (ediff-show-meta-buffer ,(current-buffer) ,session-number))) - nil 'local) + ediff-after-quit-hook-internal) (setq ediff-meta-buffer ,(current-buffer) ediff-meta-session-number ,session-number) @@ -1962,15 +1960,14 @@ ediff-filegroup-action file1 file2 ;; provide startup hooks `(list (lambda () - (add-hook - 'ediff-after-quit-hook-internal + (push (lambda () (if (ediff-buffer-live-p ,(current-buffer)) (ediff-show-meta-buffer ,(current-buffer) ,session-number))) - nil 'local) + ediff-after-quit-hook-internal) (setq ediff-meta-buffer ,(current-buffer) ediff-meta-session-number ,session-number) @@ -1991,15 +1988,14 @@ ediff-filegroup-action file1 file2 file3 ;; arrange startup hooks `(list (lambda () - (add-hook - 'ediff-after-quit-hook-internal + (push (lambda () (if (ediff-buffer-live-p ,(current-buffer)) (ediff-show-meta-buffer ,(current-buffer) ,session-number))) - nil 'local) + ediff-after-quit-hook-internal) (setq ediff-merge-store-file ,(if (ediff-nonempty-string-p merge-autostore-dir) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; What aproach looks better?