unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23820: 25.1.50; Fix caller to ediff-setup
@ 2016-06-22  4:15 Tino Calancha
  2016-06-22  4:33 ` Noam Postavsky
  2016-06-24 15:33 ` bug#23820: (no subject) Tino Calancha
  0 siblings, 2 replies; 4+ messages in thread
From: Tino Calancha @ 2016-06-22  4:15 UTC (permalink / raw)
  To: 23820; +Cc: f92capac


Hello,

Seventh argument of ediff-setup is a hook: hilit-chg-get-diff-info
is passing a function.

emacs -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foo")) 
(switch-to-buffer "bar") (insert "bar"))'
M-: (highlight-compare-with-file "/tmp/foo")
;; error: (wrong-type-argument sequencep hilit-chg-get-diff-list-hk)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From d80c1fba56cecd245b90be8f3bddd159e1a9cbdd Mon Sep 17 00:00:00 2001
From: Tino Calancha <f92capac@gmail.com>
Date: Wed, 22 Jun 2016 13:04:03 +0900
Subject: [PATCH] Fix caller to ediff-setup

* lisp/hilit-chg.el (hilit-chg-get-diff-info-hook): New variable.
(hilit-chg-get-diff-info): Use it. (#Bug23820).
---
  lisp/hilit-chg.el | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 8f042b6..1573b2e 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -313,6 +313,9 @@ highlight-changes-global-changes-existing-buffers
    :type 'boolean
    :group 'highlight-changes)

+(defvar hilit-chg-get-diff-info-hook nil
+  "Hook argument to `ediff-setup' in `hilit-chg-get-diff-info'.")
+
  ;; These are for internal use.

  (defvar hilit-chg-list nil)
@@ -913,7 +916,7 @@ hilit-chg-get-diff-info
    (let (hilit-e hilit-x hilit-y)
      (ediff-setup buf-a file-a buf-b file-b
  	       nil nil   ; buf-c file-C
-	       'hilit-chg-get-diff-list-hk
+	       hilit-chg-get-diff-info-hook
  	       (list (cons 'ediff-job-name 'something))
  	       )
      (ediff-with-current-buffer hilit-e (ediff-really-quit nil))
@@ -965,6 +968,8 @@ hilit-chg-get-diff-list-hk
      ;; No point in returning a value, since this is a hook function.
      ))

+(add-hook 'hilit-chg-get-diff-info-hook #'hilit-chg-get-diff-list-hk)
+
  ;; ======================= global-highlight-changes-mode ==============

  ;;;###autoload
-- 
2.8.1


In GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
Repository revision: 1c0199050bfa594287f3975aca56fc2a57ba0f66






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#23820: 25.1.50; Fix caller to ediff-setup
  2016-06-22  4:15 bug#23820: 25.1.50; Fix caller to ediff-setup Tino Calancha
@ 2016-06-22  4:33 ` Noam Postavsky
  2016-06-22  4:47   ` Tino Calancha
  2016-06-24 15:33 ` bug#23820: (no subject) Tino Calancha
  1 sibling, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2016-06-22  4:33 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 23820

On Wed, Jun 22, 2016 at 12:15 AM, Tino Calancha <f92capac@gmail.com> wrote:
>
> Hello,
>
> Seventh argument of ediff-setup is a hook: hilit-chg-get-diff-info
> is passing a function.

I think that argument is not a hook but just a list of functions, so
it should suffice to do

@@ -913,7 +916,7 @@ hilit-chg-get-diff-info
   (let (hilit-e hilit-x hilit-y)
     (ediff-setup buf-a file-a buf-b file-b
               nil nil   ; buf-c file-C
-              'hilit-chg-get-diff-list-hk
+              '(hilit-chg-get-diff-info-hk)
               (list (cons 'ediff-job-name 'something))
               )
     (ediff-with-current-buffer hilit-e (ediff-really-quit nil))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#23820: 25.1.50; Fix caller to ediff-setup
  2016-06-22  4:33 ` Noam Postavsky
@ 2016-06-22  4:47   ` Tino Calancha
  0 siblings, 0 replies; 4+ messages in thread
From: Tino Calancha @ 2016-06-22  4:47 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Tino Calancha, 23820


> I think that argument is not a hook but just a list of functions, so
> it should suffice to do
>
> @@ -913,7 +916,7 @@ hilit-chg-get-diff-info
>   (let (hilit-e hilit-x hilit-y)
>     (ediff-setup buf-a file-a buf-b file-b
>               nil nil   ; buf-c file-C
> -              'hilit-chg-get-diff-list-hk
> +              '(hilit-chg-get-diff-info-hk)
>               (list (cons 'ediff-job-name 'something))
>               )
>     (ediff-with-current-buffer hilit-e (ediff-really-quit nil))

Yeah, i tried that first but i thought it could be useful for 
documentation adding the new var.
But if
hilit-chg-get-diff-info-hk
it is a list of functions then let's go with the
'(hilit-chg-get-diff-info-hk)
solution.

emacs25 branch wasn't affected because ediff-setup calls run-hooks
(in master branch use 'mapc).





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#23820: (no subject)
  2016-06-22  4:15 bug#23820: 25.1.50; Fix caller to ediff-setup Tino Calancha
  2016-06-22  4:33 ` Noam Postavsky
@ 2016-06-24 15:33 ` Tino Calancha
  1 sibling, 0 replies; 4+ messages in thread
From: Tino Calancha @ 2016-06-24 15:33 UTC (permalink / raw)
  To: 23820-done

Fixed passing a list as the seventh arg of ediff-setup





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-24 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-22  4:15 bug#23820: 25.1.50; Fix caller to ediff-setup Tino Calancha
2016-06-22  4:33 ` Noam Postavsky
2016-06-22  4:47   ` Tino Calancha
2016-06-24 15:33 ` bug#23820: (no subject) Tino Calancha

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).