@findex diff-delete-other-hunks
@item C-c @key{RET} n
-Delete all hunks other than the current hunk. If the region is active,
-then delete all hunks that the region does not overlap.
+Delete hunks other than the current one. If the region is active, this
+command deletes the hunks the region overlaps; otherwise it deletes all
+hunks other than the current hunk. This command does not work in a
+narrowed buffer because deleting hunks safely requires access to the
+file headers.
@findex diff-refine-hunk
@item C-c C-b
;; would be a patch with the same meaning. That is not implemented
;; because it does not seem like it would be useful.
(defun diff-delete-other-hunks (&optional beg end)
- "Delete all hunks other than the current hunk.
-Interactively, if the region is active, then delete all hunks that the
-region does not overlap. When called from Lisp, the optional arguments
-BEG and END specify the region of hunks not to delete."
+ "Delete hunks other than the current one.
+Interactively, if the region is active, delete all hunks that the region
+overlaps; otherwise delete all hunks except the current one.
+When calling from Lisp, pass BEG and END as the bounds of the region in
+which to delete hunks; BEG and END omitted or nil means to delete all
+the hunks but the one which contains point."
(interactive (list (use-region-beginning) (use-region-end)))
(when (buffer-narrowed-p)
(user-error "Command is not safe in a narrowed buffer"))