1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

diff-apply-hunk: Avoid display-buffer-overriding-action

* lisp/vc/diff-mode.el (diff-apply-hunk): Use ACTION argument to
display-buffer instead of display-buffer-overriding-action.
This commit is contained in:
Sean Whitton 2025-11-18 12:56:25 +00:00
parent f81fc11613
commit 3ae79b7c05

View file

@ -2187,7 +2187,8 @@ With a prefix argument, REVERSE the hunk."
"Hunk has already been applied; undo it? ")))))
(message "(Nothing done)"))
((and deletion (not switched))
(when (y-or-n-p (format-message "Delete file `%s'?" (buffer-file-name buf)))
(when (y-or-n-p (format-message "Delete file `%s'?"
(buffer-file-name buf)))
(delete-file (buffer-file-name buf) delete-by-moving-to-trash)
(kill-buffer buf)))
(t
@ -2197,9 +2198,8 @@ With a prefix argument, REVERSE the hunk."
(delete-region (car pos) (cdr pos))
(insert (car new)))
;; Display BUF in a window
(let ((display-buffer-overriding-action
'(nil (inhibit-same-window . t))))
(set-window-point (display-buffer buf) (+ (car pos) (cdr new))))
(set-window-point (display-buffer buf '(nil (inhibit-same-window . t)))
(+ (car pos) (cdr new)))
(diff-hunk-status-msg line-offset (xor switched reverse) nil)
(when diff-advance-after-apply-hunk
(diff-hunk-next))))))