aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2017-02-02 22:27:18 +0900
committerTino Calancha2017-02-02 22:27:18 +0900
commit01d87bf846b478dea0bfe824678e76089f5af2c7 (patch)
tree082bdf5663560049fb96804b5abb53ac6a89dcd3
parente280b94dcd6ed42439718ddf9dd704169f6bb536 (diff)
downloademacs-01d87bf846b478dea0bfe824678e76089f5af2c7.tar.gz
emacs-01d87bf846b478dea0bfe824678e76089f5af2c7.zip
Ignore error after kill last file or hunk
* lisp/vc/diff-mode.el (diff-hunk-kill): Go to beginning of hunk before kill. Ignore error after kill last hunk (Bug#25570). (diff-file-kill): Idem.
-rw-r--r--lisp/vc/diff-mode.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 7ffa115bde4..a7ac53953dd 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -671,7 +671,7 @@ If the prefix ARG is given, restrict the view to the current file instead."
671 (inhibit-read-only t)) 671 (inhibit-read-only t))
672 (apply 'kill-region bounds) 672 (apply 'kill-region bounds)
673 (goto-char (car bounds)) 673 (goto-char (car bounds))
674 (diff-beginning-of-hunk t))) 674 (ignore-errors (diff-beginning-of-hunk t))))
675 675
676(defun diff-beginning-of-file-and-junk () 676(defun diff-beginning-of-file-and-junk ()
677 "Go to the beginning of file-related diff-info. 677 "Go to the beginning of file-related diff-info.
@@ -723,9 +723,10 @@ data such as \"Index: ...\" and such."
723(defun diff-file-kill () 723(defun diff-file-kill ()
724 "Kill current file's hunks." 724 "Kill current file's hunks."
725 (interactive) 725 (interactive)
726 (diff-beginning-of-hunk t)
726 (let ((inhibit-read-only t)) 727 (let ((inhibit-read-only t))
727 (apply 'kill-region (diff-bounds-of-file))) 728 (apply 'kill-region (diff-bounds-of-file)))
728 (diff-beginning-of-hunk t)) 729 (ignore-errors (diff-beginning-of-hunk t)))
729 730
730(defun diff-kill-junk () 731(defun diff-kill-junk ()
731 "Kill spurious empty diffs." 732 "Kill spurious empty diffs."