diff options
author | Sam Steingold <sds@gnu.org> | 2013-02-28 11:34:51 -0500 |
---|---|---|
committer | Sam Steingold <sds@gnu.org> | 2013-02-28 11:34:51 -0500 |
commit | 3602ccebf6716870f82a229a34dfa80d12b60142 (patch) | |
tree | 5f13fccc0205557445c59fc9beef3ec0fc3c34d6 /lisp/vc/diff-mode.el | |
parent | bd0dd7554e28c2145201ff82cf1da89270b8c510 (diff) | |
download | emacs-3602ccebf6716870f82a229a34dfa80d12b60142.tar.gz |
* lisp/vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces.
See <http://stackoverflow.com/questions/14720205>.
Diffstat (limited to 'lisp/vc/diff-mode.el')
-rw-r--r-- | lisp/vc/diff-mode.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 940457b6cc0..d9224b29c2e 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -821,9 +821,11 @@ If the OLD prefix arg is passed, tell the file NAME of the old file." (progn (diff-hunk-prev) (point)) (error (point-min))))) (header-files - (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)") - (list (if old (match-string 1) (match-string 3)) - (if old (match-string 3) (match-string 1))) + ;; handle filenames with spaces; + ;; cf. diff-font-lock-keywords / diff-file-header-face + (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] \\([^\t]+\\)") + (list (if old (match-string 1) (match-string 2)) + (if old (match-string 2) (match-string 1))) (forward-line 1) nil))) (delq nil (append @@ -832,6 +834,7 @@ If the OLD prefix arg is passed, tell the file NAME of the old file." (re-search-backward "^Index: \\(.+\\)" limit t))) (list (match-string 1))) header-files + ;; this assumes that there are no spaces in filenames (when (re-search-backward "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" nil t) |