summaryrefslogtreecommitdiff
path: root/lisp/vc/smerge-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2020-11-04 00:24:45 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2020-11-04 00:24:45 -0500
commita63d90517549b1940ffbe3438a614afc7ea1aa6d (patch)
tree37e59445c29f6e71a465b7e13c17ca0e462a0a61 /lisp/vc/smerge-mode.el
parent9bcdebd9b7432dbdc826579c9a9ec725bbd70d53 (diff)
downloademacs-a63d90517549b1940ffbe3438a614afc7ea1aa6d.tar.gz
Fix misuses of `make-local-variable` on hooks
* lisp/vc/smerge-mode.el (smerge-ediff): * lisp/progmodes/python.el (python-pdbtrack-setup-tracking): * lisp/net/tramp-smb.el (tramp-smb-call-winexe): * lisp/net/secrets.el (secrets-mode): * lisp/mail/rmail.el (rmail-variables): * lisp/ielm.el (inferior-emacs-lisp-mode): * lisp/erc/erc-log.el (erc-log-setup-logging): Use `add-hook`. * lisp/eshell/em-unix.el (eshell/diff): * lisp/eshell/em-hist.el (eshell-hist-initialize): Don't `make-local-variable` on hooks.
Diffstat (limited to 'lisp/vc/smerge-mode.el')
-rw-r--r--lisp/vc/smerge-mode.el38
1 files changed, 20 insertions, 18 deletions
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index d0a83fd7c49..fe7724d9027 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -1352,24 +1352,26 @@ buffer names."
;; Do a few further adjustments and take precautions for exit.
(set (make-local-variable 'smerge-ediff-windows) config)
(set (make-local-variable 'smerge-ediff-buf) buf)
- (set (make-local-variable 'ediff-quit-hook)
- (lambda ()
- (let ((buffer-A ediff-buffer-A)
- (buffer-B ediff-buffer-B)
- (buffer-C ediff-buffer-C)
- (buffer-Ancestor ediff-ancestor-buffer)
- (buf smerge-ediff-buf)
- (windows smerge-ediff-windows))
- (ediff-cleanup-mess)
- (with-current-buffer buf
- (erase-buffer)
- (insert-buffer-substring buffer-C)
- (kill-buffer buffer-A)
- (kill-buffer buffer-B)
- (kill-buffer buffer-C)
- (when (bufferp buffer-Ancestor) (kill-buffer buffer-Ancestor))
- (set-window-configuration windows)
- (message "Conflict resolution finished; you may save the buffer")))))
+ (add-hook 'ediff-quit-hook
+ (lambda ()
+ (let ((buffer-A ediff-buffer-A)
+ (buffer-B ediff-buffer-B)
+ (buffer-C ediff-buffer-C)
+ (buffer-Ancestor ediff-ancestor-buffer)
+ (buf smerge-ediff-buf)
+ (windows smerge-ediff-windows))
+ (ediff-cleanup-mess)
+ (with-current-buffer buf
+ (erase-buffer)
+ (insert-buffer-substring buffer-C)
+ (kill-buffer buffer-A)
+ (kill-buffer buffer-B)
+ (kill-buffer buffer-C)
+ (when (bufferp buffer-Ancestor)
+ (kill-buffer buffer-Ancestor))
+ (set-window-configuration windows)
+ (message "Conflict resolution finished; you may save the buffer"))))
+ nil t)
(message "Please resolve conflicts now; exit ediff when done")))
(defun smerge-makeup-conflict (pt1 pt2 pt3 &optional pt4)