]> code.delx.au - gnu-emacs/commitdiff
* lisp/vc/ediff-util.el: Use lexical-binding.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 May 2016 13:12:49 +0000 (09:12 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 May 2016 13:12:49 +0000 (09:12 -0400)
lisp/vc/ediff-util.el

index c12602c71508a0733f2dfc2d0c4abe20624617ce..a6b88d557bad9133e023afd9376e184e036b8440 100644 (file)
@@ -1,4 +1,4 @@
-;;; ediff-util.el --- the core commands and utilities of ediff
+;;; ediff-util.el --- the core commands and utilities of ediff  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1994-2016 Free Software Foundation, Inc.
 
@@ -517,7 +517,7 @@ to invocation.")
       (select-window ediff-control-window)
       (ediff-visible-region)
 
-      (run-hooks 'startup-hooks)
+      (mapc #'funcall startup-hooks)
       (ediff-arrange-autosave-in-merge-jobs merge-buffer-file)
 
       (ediff-refresh-mode-lines)
@@ -1642,8 +1642,8 @@ the width of the A/B/C windows."
   (or ctl-buf (setq ctl-buf ediff-control-buffer))
   (ediff-with-current-buffer ctl-buf
     (let* ((buf (ediff-get-buffer buf-type))
-          (wind (eval (ediff-get-symbol-from-alist
-                       buf-type ediff-window-alist)))
+          (wind (symbol-value (ediff-get-symbol-from-alist
+                                buf-type ediff-window-alist)))
           (beg (window-start wind))
           (end (ediff-get-diff-posn buf-type 'end))
           lines)
@@ -1660,8 +1660,8 @@ the width of the A/B/C windows."
   (or ctl-buf (setq ctl-buf ediff-control-buffer))
   (ediff-with-current-buffer ctl-buf
     (let* ((buf (ediff-get-buffer buf-type))
-          (wind (eval (ediff-get-symbol-from-alist
-                       buf-type ediff-window-alist)))
+          (wind (symbol-value (ediff-get-symbol-from-alist
+                                buf-type ediff-window-alist)))
           (end (or (window-end wind) (window-end wind t)))
           (beg (ediff-get-diff-posn buf-type 'beg diff-num)))
       (ediff-with-current-buffer buf
@@ -2522,7 +2522,7 @@ temporarily reverses the meaning of this variable."
                            (frame-selected-window warp-frame))
                          2 1))
 
-  (run-hooks 'after-quit-hook-internal)
+  (mapc #'funcall after-quit-hook-internal)
   ))
 
 ;; Returns frame under mouse, if this frame is not a minibuffer
@@ -3479,6 +3479,7 @@ Without an argument, it saves customized diff argument, if available
 (declare-function ediff-regions-internal "ediff"
                  (buffer-a beg-a end-a buffer-b beg-b end-b
                            startup-hooks job-name word-mode setup-parameters))
+(defvar zmacs-regions) ;;XEmacs'ism.
 
 (defun ediff-inferior-compare-regions ()
   "Compare regions in an active Ediff session.
@@ -3526,7 +3527,7 @@ Ediff Control Panel to restore highlighting."
           (while (cond ((memq answer possibilities)
                         (setq possibilities (delq answer possibilities))
                         (setq bufA
-                              (eval
+                              (symbol-value
                                (ediff-get-symbol-from-alist
                                 answer ediff-buffer-alist)))
                         nil)
@@ -3545,7 +3546,7 @@ Ediff Control Panel to restore highlighting."
           (while (cond ((memq answer possibilities)
                         (setq possibilities (delq answer possibilities))
                         (setq bufB
-                              (eval
+                              (symbol-value
                                (ediff-get-symbol-from-alist
                                 answer ediff-buffer-alist)))
                         nil)
@@ -3944,15 +3945,18 @@ Ediff Control Panel to restore highlighting."
        (setq n (1+ n)))
       (format "%s<%d>%s" prefix n suffix))))
 
+(defvar reporter-prompt-for-summary-p)
 
 (defun ediff-submit-report ()
   "Submit bug report on Ediff."
   (interactive)
   (ediff-barf-if-not-control-buffer)
+  (defvar ediff-device-type)
+  (defvar ediff-buffer-name)
   (let ((reporter-prompt-for-summary-p t)
        (ctl-buf ediff-control-buffer)
        (ediff-device-type (ediff-device-type))
-       varlist salutation buffer-name)
+       varlist salutation ediff-buffer-name)
     (setq varlist '(ediff-diff-program ediff-diff-options
                     ediff-diff3-program ediff-diff3-options
                    ediff-patch-program ediff-patch-options
@@ -3969,7 +3973,7 @@ Ediff Control Panel to restore highlighting."
                    ediff-split-window-function
                    ediff-job-name
                    ediff-word-mode
-                   buffer-name
+                   ediff-buffer-name
                    ediff-device-type
                    ))
     (setq salutation "
@@ -4024,7 +4028,7 @@ Mail anyway? (y or n) ")
        (progn
          (if (ediff-buffer-live-p ctl-buf)
              (set-buffer ctl-buf))
-         (setq buffer-name (buffer-name))
+         (setq ediff-buffer-name (buffer-name))
          (require 'reporter)
          (reporter-submit-bug-report "kifer@cs.stonybrook.edu, bug-gnu-emacs@gnu.org"
                                      (ediff-version)