unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: kifer@cs.stonybrook.edu, 23933@debbugs.gnu.org,
	Tino Calancha <tino.calancha@gmail.com>,
	monnier@iro.umontreal.ca, npostavs@users.sourceforge.net
Subject: bug#23933: 25.1.50; Run a buffer-local hook with mapc
Date: Mon, 11 Jul 2016 03:14:48 +0900 (JST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1607110310080.28924@calancha-pc> (raw)
In-Reply-To: <83k2gte5yw.fsf@gnu.org>



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?





  reply	other threads:[~2016-07-10 18:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-10 10:18 bug#23933: 25.1.50; Run a buffer-local hook with mapc Tino Calancha
2016-07-10 14:44 ` Eli Zaretskii
2016-07-10 15:18   ` Stefan Monnier
2016-07-10 15:55     ` Eli Zaretskii
2016-07-10 17:01       ` Stefan Monnier
2016-07-10 17:12         ` npostavs
2016-07-10 21:12           ` Stefan Monnier
2016-07-11 16:02             ` Tino Calancha
2016-07-11 16:05               ` Tino Calancha
2016-07-10 17:15         ` Eli Zaretskii
2016-07-10 17:31           ` Tino Calancha
2016-07-10 17:41             ` Noam Postavsky
2016-07-10 17:52             ` Eli Zaretskii
2016-07-10 18:14               ` Tino Calancha [this message]
2016-07-10 15:56     ` Eli Zaretskii
2016-07-10 17:02       ` Stefan Monnier
2016-07-10 18:28       ` Andreas Schwab
2016-07-11 16:06 ` bug#23933: (no subject) Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1607110310080.28924@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=23933@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=kifer@cs.stonybrook.edu \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).