emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 01d87bf 1/2: Ignore error after kill last file or h


From: Tino Calancha
Subject: [Emacs-diffs] master 01d87bf 1/2: Ignore error after kill last file or hunk
Date: Thu, 2 Feb 2017 13:30:39 +0000 (UTC)

branch: master
commit 01d87bf846b478dea0bfe824678e76089f5af2c7
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    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.
---
 lisp/vc/diff-mode.el |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 7ffa115..a7ac539 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."
         (inhibit-read-only t))
     (apply 'kill-region bounds)
     (goto-char (car bounds))
-    (diff-beginning-of-hunk t)))
+    (ignore-errors (diff-beginning-of-hunk t))))
 
 (defun diff-beginning-of-file-and-junk ()
   "Go to the beginning of file-related diff-info.
@@ -723,9 +723,10 @@ data such as \"Index: ...\" and such."
 (defun diff-file-kill ()
   "Kill current file's hunks."
   (interactive)
+  (diff-beginning-of-hunk t)
   (let ((inhibit-read-only t))
     (apply 'kill-region (diff-bounds-of-file)))
-  (diff-beginning-of-hunk t))
+  (ignore-errors (diff-beginning-of-hunk t)))
 
 (defun diff-kill-junk ()
   "Kill spurious empty diffs."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]