]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/diff-mode.el
Update copyright year to 2015
[gnu-emacs] / lisp / vc / diff-mode.el
index d4e973956c8e3aff31df51273df604ff672d1400..a9614e95d6d93979e90cb9cd3f6582dd828982cc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; diff-mode.el --- a mode for viewing/editing context diffs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: convenience patch diff vc
@@ -304,7 +304,7 @@ well."
 (defface diff-changed
   '((t nil))
   "`diff-mode' face used to highlight changed lines."
-  :version "24.5"
+  :version "25.1"
   :group 'diff-mode)
 (define-obsolete-face-alias 'diff-changed-face 'diff-changed "22.1")
 (defvar diff-changed-face 'diff-changed)
@@ -343,7 +343,7 @@ well."
     (((class color grayscale) (min-colors 88) (background dark))
      :foreground "#dddddd"))
   "`diff-mode' face used to highlight context and other side-information."
-  :version "24.5"
+  :version "25.1"
   :group 'diff-mode)
 (define-obsolete-face-alias 'diff-context-face 'diff-context "22.1")
 (defvar diff-context-face 'diff-context)
@@ -1817,6 +1817,16 @@ With a prefix argument, try to REVERSE the hunk."
     (diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
 
 
+(defun diff-kill-applied-hunks ()
+  "Kill all hunks that have already been applied starting at point."
+  (interactive)
+  (while (not (eobp))
+    (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
+                 (diff-find-source-location nil nil)))
+      (if (and line-offset switched)
+          (diff-hunk-kill)
+        (diff-hunk-next)))))
+
 (defalias 'diff-mouse-goto-source 'diff-goto-source)
 
 (defun diff-goto-source (&optional other-file event)