]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/diff-mode.el
Add a link from Tool Bar to Images
[gnu-emacs] / lisp / vc / diff-mode.el
index a9614e95d6d93979e90cb9cd3f6582dd828982cc..bada492a31b213d55e398b96dca7ab3c81229542 100644 (file)
@@ -1,6 +1,6 @@
 ;;; diff-mode.el --- a mode for viewing/editing context diffs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2016 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: convenience patch diff vc
@@ -821,7 +821,7 @@ If the OLD prefix arg is passed, tell the file NAME of the old file."
          (header-files
            ;; handle filenames with spaces;
            ;; cf. diff-font-lock-keywords / diff-file-header-face
-          (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] \\([^\t]+\\)")
+          (if (looking-at "[-*][-*][-*] \\([^\t\n]+\\).*\n[-+][-+][-+] \\([^\t\n]+\\)")
               (list (if old (match-string 1) (match-string 2))
                     (if old (match-string 2) (match-string 1)))
             (forward-line 1) nil)))
@@ -1427,8 +1427,8 @@ modified lines of the diff."
                   (diff-hunk-style)))))
     (set (make-local-variable 'whitespace-trailing-regexp)
         (if (eq style 'context)
-            "^[-\+!] .*?\\([\t ]+\\)$"
-          "^[-\+!<>].*?\\([\t ]+\\)$"))))
+            "^[-+!] .*?\\([\t ]+\\)$"
+          "^[-+!<>].*?\\([\t ]+\\)$"))))
 
 (defun diff-delete-if-empty ()
   ;; An empty diff file means there's no more diffs to integrate, so we
@@ -1821,7 +1821,7 @@ With a prefix argument, try to REVERSE the hunk."
   "Kill all hunks that have already been applied starting at point."
   (interactive)
   (while (not (eobp))
-    (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
+    (pcase-let ((`(,_buf ,line-offset ,_pos ,_src ,_dst ,switched)
                  (diff-find-source-location nil nil)))
       (if (and line-offset switched)
           (diff-hunk-kill)
@@ -2128,7 +2128,8 @@ fixed, visit it in a buffer."
        (goto-char hunk-end))
       (if modified-buffers
          (message "Deleted trailing whitespace from %s."
-                  (mapconcat (lambda (buf) (concat "`" (buffer-name buf) "'"))
+                  (mapconcat (lambda (buf) (format-message
+                                            "`%s'" (buffer-name buf)))
                              modified-buffers ", "))
        (message "No trailing whitespace to delete.")))))