diff options
| author | Paul D. Nelson | 2025-03-31 09:07:07 +0200 |
|---|---|---|
| committer | Sean Whitton | 2025-04-05 09:36:29 +0800 |
| commit | 2bced74aa9735d9a9a5cb00aedfcac72d54f5d50 (patch) | |
| tree | c6e9b515a41fc36ce405e4f0569e6ea462981108 | |
| parent | 1fdaad525389b6638daa729ef5794ba5e81e3085 (diff) | |
| download | emacs-2bced74aa9735d9a9a5cb00aedfcac72d54f5d50.tar.gz emacs-2bced74aa9735d9a9a5cb00aedfcac72d54f5d50.zip | |
ediff-current-file: New optional startup-hooks arg
* lisp/vc/ediff.el (ediff-current-file): Add optional
startup-hooks argument, so that the user can write wrapper
commands with more finely customized behavior (bug#77323).
| -rw-r--r-- | lisp/vc/ediff.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 36580c73d6b..bc89b2025ff 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el | |||
| @@ -360,10 +360,13 @@ has been saved (if not in `buffer-file-name')." | |||
| 360 | (defalias 'ediff #'ediff-files) | 360 | (defalias 'ediff #'ediff-files) |
| 361 | 361 | ||
| 362 | ;;;###autoload | 362 | ;;;###autoload |
| 363 | (defun ediff-current-file () | 363 | (defun ediff-current-file (&optional startup-hooks) |
| 364 | "Start ediff between current buffer and its file on disk. | 364 | "Start ediff between current buffer and its file on disk. |
| 365 | This command can be used instead of `revert-buffer'. If there is | 365 | This command can be used instead of `revert-buffer'. If there is |
| 366 | nothing to revert then this command fails." | 366 | nothing to revert then this command fails. |
| 367 | |||
| 368 | Non-interactively, STARTUP-HOOKS is a list of functions that Emacs calls | ||
| 369 | without arguments after setting up the Ediff buffers." | ||
| 367 | (interactive) | 370 | (interactive) |
| 368 | ;; This duplicates code from menu-bar.el. | 371 | ;; This duplicates code from menu-bar.el. |
| 369 | (unless (or (not (eq revert-buffer-function 'revert-buffer--default)) | 372 | (unless (or (not (eq revert-buffer-function 'revert-buffer--default)) |
| @@ -395,7 +398,7 @@ nothing to revert then this command fails." | |||
| 395 | (insert-file-contents file-name) | 398 | (insert-file-contents file-name) |
| 396 | ;; Assume same modes: | 399 | ;; Assume same modes: |
| 397 | (funcall current-major)) | 400 | (funcall current-major)) |
| 398 | (ediff-buffers revert-buf (current-buffer)))) | 401 | (ediff-buffers revert-buf (current-buffer) startup-hooks))) |
| 399 | 402 | ||
| 400 | 403 | ||
| 401 | ;;;###autoload | 404 | ;;;###autoload |