aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2024-10-03 08:50:55 +0800
committerSean Whitton2024-10-03 08:50:55 +0800
commit11e7aa75eeba3c0d24d84782639b48c64c8e1ea3 (patch)
tree18da312196627453e8c5a66ecc00d208d4bbcb1b
parentc8ecd7fa0da8a597250989430ac2b2465419f18e (diff)
downloademacs-11e7aa75eeba3c0d24d84782639b48c64c8e1ea3.tar.gz
emacs-11e7aa75eeba3c0d24d84782639b48c64c8e1ea3.zip
; Rework documentation for diff-delete-other-hunks
-rw-r--r--doc/emacs/files.texi7
-rw-r--r--lisp/vc/diff-mode.el10
2 files changed, 11 insertions, 6 deletions
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 67a1a3be3ff..0866e81233d 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1705,8 +1705,11 @@ diffs were applied successfully, save the changed buffers.
1705 1705
1706@findex diff-delete-other-hunks 1706@findex diff-delete-other-hunks
1707@item C-c @key{RET} n 1707@item C-c @key{RET} n
1708Delete all hunks other than the current hunk. If the region is active, 1708Delete hunks other than the current one. If the region is active, this
1709then delete all hunks that the region does not overlap. 1709command deletes the hunks the region overlaps; otherwise it deletes all
1710hunks other than the current hunk. This command does not work in a
1711narrowed buffer because deleting hunks safely requires access to the
1712file headers.
1710 1713
1711@findex diff-refine-hunk 1714@findex diff-refine-hunk
1712@item C-c C-b 1715@item C-c C-b
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 51e7d90f98b..df55ca2ad80 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -822,10 +822,12 @@ If the prefix ARG is given, restrict the view to the current file instead."
822;; would be a patch with the same meaning. That is not implemented 822;; would be a patch with the same meaning. That is not implemented
823;; because it does not seem like it would be useful. 823;; because it does not seem like it would be useful.
824(defun diff-delete-other-hunks (&optional beg end) 824(defun diff-delete-other-hunks (&optional beg end)
825 "Delete all hunks other than the current hunk. 825 "Delete hunks other than the current one.
826Interactively, if the region is active, then delete all hunks that the 826Interactively, if the region is active, delete all hunks that the region
827region does not overlap. When called from Lisp, the optional arguments 827overlaps; otherwise delete all hunks except the current one.
828BEG and END specify the region of hunks not to delete." 828When calling from Lisp, pass BEG and END as the bounds of the region in
829which to delete hunks; BEG and END omitted or nil means to delete all
830the hunks but the one which contains point."
829 (interactive (list (use-region-beginning) (use-region-end))) 831 (interactive (list (use-region-beginning) (use-region-end)))
830 (when (buffer-narrowed-p) 832 (when (buffer-narrowed-p)
831 (user-error "Command is not safe in a narrowed buffer")) 833 (user-error "Command is not safe in a narrowed buffer"))