summaryrefslogtreecommitdiff
path: root/lisp/vc/ediff-vers.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-vers.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-vers.el')
-rw-r--r--lisp/vc/ediff-vers.el45
1 files changed, 18 insertions, 27 deletions
diff --git a/lisp/vc/ediff-vers.el b/lisp/vc/ediff-vers.el
index cadb057a9ab..3826edad891 100644
--- a/lisp/vc/ediff-vers.el
+++ b/lisp/vc/ediff-vers.el
@@ -1,4 +1,4 @@
-;;; ediff-vers.el --- version control interface to Ediff -*- lexical-binding: nil; -*-
+;;; ediff-vers.el --- version control interface to Ediff -*- lexical-binding:t -*-
;; Copyright (C) 1995-1997, 2001-2019 Free Software Foundation, Inc.
@@ -96,11 +96,10 @@ comparison or merge operations are being performed."
(ediff-vc-revision-other-window rev2))
(setq rev2buf (current-buffer)
file2 (buffer-file-name)))
- (setq startup-hooks
- (cons `(lambda ()
- (ediff-delete-version-file ,file1)
- (or ,(string= rev2 "") (ediff-delete-version-file ,file2)))
- startup-hooks)))
+ (push (lambda ()
+ (ediff-delete-version-file file1)
+ (or (string= rev2 "") (ediff-delete-version-file file2)))
+ startup-hooks))
(ediff-buffers
rev1buf rev2buf
startup-hooks
@@ -124,7 +123,7 @@ comparison or merge operations are being performed."
(let ((output-buffer (ediff-rcs-get-output-buffer filename buff)))
(delete-windows-on output-buffer)
(with-current-buffer output-buffer
- (apply 'call-process "co" nil t nil
+ (apply #'call-process "co" nil t nil
;; -q: quiet (no diagnostics)
(append switches rcs-default-co-switches
(list "-q" filename)))))
@@ -175,20 +174,20 @@ comparison or merge operations are being performed."
(if ancestor-rev
(save-excursion
(if (string= ancestor-rev "")
- (setq ancestor-rev (ediff-vc-working-revision buffer-file-name)))
+ (setq ancestor-rev (ediff-vc-working-revision
+ buffer-file-name)))
(ediff-vc-revision-other-window ancestor-rev)
(setq ancestor-buf (current-buffer))))
- (setq startup-hooks
- (cons
- `(lambda ()
- (ediff-delete-version-file ,(buffer-file-name buf1))
- (or ,(string= rev2 "")
- (ediff-delete-version-file ,(buffer-file-name buf2)))
- (or ,(string= ancestor-rev "")
- ,(not ancestor-rev)
- (ediff-delete-version-file ,(buffer-file-name ancestor-buf)))
- )
- startup-hooks)))
+ (push (let ((f1 (buffer-file-name buf1))
+ (f2 (unless (string= rev2 "") (buffer-file-name buf2)))
+ (fa (unless (or (string= ancestor-rev "")
+ (not ancestor-rev))
+ (buffer-file-name ancestor-buf))))
+ (lambda ()
+ (ediff-delete-version-file f1)
+ (if f2 (ediff-delete-version-file f2))
+ (if fa (ediff-delete-version-file fa))))
+ startup-hooks))
(if ancestor-rev
(ediff-merge-buffers-with-ancestor
buf1 buf2 ancestor-buf
@@ -227,12 +226,4 @@ comparison or merge operations are being performed."
(provide 'ediff-vers)
-
-
-;; Local Variables:
-;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
-;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
-;; End:
-
;;; ediff-vers.el ends here