diff options
| author | Sam Steingold | 2013-02-28 11:34:51 -0500 |
|---|---|---|
| committer | Sam Steingold | 2013-02-28 11:34:51 -0500 |
| commit | 3602ccebf6716870f82a229a34dfa80d12b60142 (patch) | |
| tree | 5f13fccc0205557445c59fc9beef3ec0fc3c34d6 | |
| parent | bd0dd7554e28c2145201ff82cf1da89270b8c510 (diff) | |
| download | emacs-3602ccebf6716870f82a229a34dfa80d12b60142.tar.gz emacs-3602ccebf6716870f82a229a34dfa80d12b60142.zip | |
* lisp/vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces.
See <http://stackoverflow.com/questions/14720205>.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc/diff-mode.el | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 75fc2e77a0c..5713734fd80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-28 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. | ||
| 4 | See <http://stackoverflow.com/questions/14720205>. | ||
| 5 | |||
| 1 | 2013-02-28 Thierry Volpiatto <thierry.volpiatto@gmail.com> | 6 | 2013-02-28 Thierry Volpiatto <thierry.volpiatto@gmail.com> |
| 2 | 7 | ||
| 3 | * net/net-utils.el (net-utils--revert-function): New fun (bug#13831). | 8 | * net/net-utils.el (net-utils--revert-function): New fun (bug#13831). |
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." | |||
| 821 | (progn (diff-hunk-prev) (point)) | 821 | (progn (diff-hunk-prev) (point)) |
| 822 | (error (point-min))))) | 822 | (error (point-min))))) |
| 823 | (header-files | 823 | (header-files |
| 824 | (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)") | 824 | ;; handle filenames with spaces; |
| 825 | (list (if old (match-string 1) (match-string 3)) | 825 | ;; cf. diff-font-lock-keywords / diff-file-header-face |
| 826 | (if old (match-string 3) (match-string 1))) | 826 | (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] \\([^\t]+\\)") |
| 827 | (list (if old (match-string 1) (match-string 2)) | ||
| 828 | (if old (match-string 2) (match-string 1))) | ||
| 827 | (forward-line 1) nil))) | 829 | (forward-line 1) nil))) |
| 828 | (delq nil | 830 | (delq nil |
| 829 | (append | 831 | (append |
| @@ -832,6 +834,7 @@ If the OLD prefix arg is passed, tell the file NAME of the old file." | |||
| 832 | (re-search-backward "^Index: \\(.+\\)" limit t))) | 834 | (re-search-backward "^Index: \\(.+\\)" limit t))) |
| 833 | (list (match-string 1))) | 835 | (list (match-string 1))) |
| 834 | header-files | 836 | header-files |
| 837 | ;; this assumes that there are no spaces in filenames | ||
| 835 | (when (re-search-backward | 838 | (when (re-search-backward |
| 836 | "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" | 839 | "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" |
| 837 | nil t) | 840 | nil t) |