summaryrefslogtreecommitdiff
path: root/lisp/vc/ediff-hook.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2019-06-21 01:16:54 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-06-21 01:16:54 -0400
commit869cf5cbc0721bbe9e4df557f4ed3633fb13c05f (patch)
treeacb96e2d8b0319faa745a8dcf789c2551b0df3e0 /lisp/vc/ediff-hook.el
parentd63bfbcae4a31560468e8800fe8381fda3b9d2ce (diff)
downloademacs-869cf5cbc0721bbe9e4df557f4ed3633fb13c05f.tar.gz
* lisp/vc/ediff-*.el: Use lexical-binding, plus misc cleanup
Re-enable lexical-binding in ediff. For that, change ediff-find-file so as not to rely on dynamic scoping in its calling convention. * lisp/vc/ediff-diff.el: Move `provide` to the end. Remove redundant :group. (ediff-exec-process): Disregard current directory. (ediff-forward-word-function): Use defvar-local. * lisp/vc/ediff-help.el (ediff-set-help-message): Use functionp. * lisp/vc/ediff-hook.el (menu-bar-ediff-misc-menu): Make a toggle, as in the XEmacs menu. * lisp/vc/ediff-init.el (ediff-defvar-local): Add `doc-string` prop. (ediff-check-version): Delete function, unused. * lisp/vc/ediff-mult.el: Move `provide` to the end. Remove redundant :groups. (ediff-dir-diffs-buffer-map): Move initialization into declaration. (ediff-meta-mode): Use define-derived-mode. (ediff-intersect-directories): Remove `comparison-func`, unused. (ediff-prepare-meta-buffer): Fix use of `startup-hooks`. * lisp/vc/ediff-ptch.el: Move `provide` to the end. * lisp/vc/ediff-util.el (ediff-add-to-history): Use add-to-history instead. * lisp/vc/ediff-vers.el (ediff-vc-internal, ediff-vc-merge-internal): Use push and closures. * lisp/vc/ediff-wind.el: Remove redundant :groups. * lisp/vc/ediff.el: Move `provide` to the end. Remove redundant :groups. (ediff--magic-file-name, ediff--startup-hook): New vars. (ediff-find-file): Change calling convention so as not to use symbols as value cells. (ediff--buffer-file-name): New function. (ediff-files-internal): Adjust to new calling convention of ediff-find-file. (ediff-directories-internal, ediff-directory-revisions-internal) (ediff-regions-internal): Use push and closures.
Diffstat (limited to 'lisp/vc/ediff-hook.el')
-rw-r--r--lisp/vc/ediff-hook.el29
1 files changed, 16 insertions, 13 deletions
diff --git a/lisp/vc/ediff-hook.el b/lisp/vc/ediff-hook.el
index 0b97120baf1..7a04249fc85 100644
--- a/lisp/vc/ediff-hook.el
+++ b/lisp/vc/ediff-hook.el
@@ -1,4 +1,4 @@
-;;; ediff-hook.el --- setup for Ediff's menus and autoloads -*- lexical-binding: nil; -*-
+;;; ediff-hook.el --- setup for Ediff's menus and autoloads -*- lexical-binding:t -*-
;; Copyright (C) 1995-2019 Free Software Foundation, Inc.
@@ -43,7 +43,6 @@
;; end pacifier
;; allow menus to be set up without ediff-wind.el being loaded
-(defvar ediff-window-setup-function)
;; This autoload is useless in Emacs because ediff-hook.el is dumped with
;; emacs, but it is needed in XEmacs
@@ -114,10 +113,8 @@
["Use separate frame for Ediff control buffer"
ediff-toggle-multiframe
:style toggle
- :selected (if (and (featurep 'ediff-util)
- (boundp 'ediff-window-setup-function))
- (eq ediff-window-setup-function
- 'ediff-setup-windows-multiframe))]
+ :selected (eq (bound-and-true-p ediff-window-setup-function)
+ #'ediff-setup-windows-multiframe)]
["Use a toolbar with Ediff control buffer"
ediff-toggle-use-toolbar
:style toggle
@@ -133,14 +130,14 @@
(defvar menu-bar-ediff-misc-menu
(make-sparse-keymap "Ediff Miscellanea"))
(fset 'menu-bar-ediff-misc-menu
- (symbol-value 'menu-bar-ediff-misc-menu))
+ menu-bar-ediff-misc-menu)
(defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
- (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
+ (fset 'menu-bar-epatch-menu menu-bar-epatch-menu)
(defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge"))
(fset 'menu-bar-ediff-merge-menu
- (symbol-value 'menu-bar-ediff-merge-menu))
+ menu-bar-ediff-merge-menu)
(defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
- (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
+ (fset 'menu-bar-ediff-menu menu-bar-ediff-menu)
;; define ediff compare menu
(define-key menu-bar-ediff-menu [ediff-misc]
@@ -245,7 +242,15 @@
(define-key menu-bar-ediff-misc-menu [emultiframe]
`(menu-item ,(purecopy "Use separate control buffer frame")
ediff-toggle-multiframe
- :help ,(purecopy "Switch between the single-frame presentation mode and the multi-frame mode")))
+ :help ,(purecopy "Switch between the single-frame presentation mode and the multi-frame mode")
+ :button (:toggle . (eq (bound-and-true-p ediff-window-setup-function)
+ #'ediff-setup-windows-multiframe))))
+ ;; FIXME: Port XEmacs's toolbar support!
+ ;; ["Use a toolbar with Ediff control buffer"
+ ;; ediff-toggle-use-toolbar
+ ;; :style toggle
+ ;; :selected (if (featurep 'ediff-tbar)
+ ;; (ediff-use-toolbar-p))]
(define-key menu-bar-ediff-misc-menu [eregistry]
`(menu-item ,(purecopy "List Ediff Sessions") ediff-show-registry
:help ,(purecopy "List all active Ediff sessions; it is a convenient way to find and resume such a session")))
@@ -257,6 +262,4 @@
:help ,(purecopy "Bring up the Ediff manual"))))
(provide 'ediff-hook)
-
-
;;; ediff-hook.el ends here