aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-12-20 08:20:25 +0800
committerChong Yidong2010-12-20 08:20:25 +0800
commitf48fdaad21384149802191ee45a6e913fa32f4d9 (patch)
tree30fd14d8c53026abcf931676539e34a150ff2163
parent949752705efd6a4b7478623d41b3552f93e9596c (diff)
downloademacs-f48fdaad21384149802191ee45a6e913fa32f4d9.tar.gz
emacs-f48fdaad21384149802191ee45a6e913fa32f4d9.zip
Fix 2010-11-22 change to diff.el.
* vc/diff.el (diff-better-file-name): Function deleted. abbreviating file names causes problems with shell-quote-argument. (diff-no-select): Just use expand-file-name.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc/diff.el12
2 files changed, 4 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0c363ab7a03..175463f9759 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,7 @@
12010-12-20 Chong Yidong <cyd@stupidchicken.com> 12010-12-20 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * vc/diff.el (diff-better-file-name): Function deleted; 3 * vc/diff.el (diff-better-file-name): Function deleted.
4 abbreviating file name creates problems with shell-quote-argument. 4 abbreviating file names causes problems with shell-quote-argument.
5 (diff-no-select): Just use expand-file-name. 5 (diff-no-select): Just use expand-file-name.
6 6
7 * tool-bar.el (tool-bar--image-expression): New function. 7 * tool-bar.el (tool-bar--image-expression): New function.
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index 752b12446fe..1f5f2d764d2 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -110,18 +110,10 @@ specified in `diff-switches' are passed to the diff command."
110 tempfile)) 110 tempfile))
111 (file-local-copy file-or-buf))) 111 (file-local-copy file-or-buf)))
112 112
113(defun diff-better-file-name (file)
114 (if (bufferp file) file
115 (let ((rel (file-relative-name file))
116 (abbr (abbreviate-file-name (expand-file-name file))))
117 (if (< (length abbr) (length rel))
118 abbr
119 rel))))
120
121(defun diff-no-select (old new &optional switches no-async buf) 113(defun diff-no-select (old new &optional switches no-async buf)
122 ;; Noninteractive helper for creating and reverting diff buffers 114 ;; Noninteractive helper for creating and reverting diff buffers
123 (setq new (diff-better-file-name new) 115 (unless (bufferp new) (setq new (expand-file-name new)))
124 old (diff-better-file-name old)) 116 (unless (bufferp old) (setq old (expand-file-name old)))
125 (or switches (setq switches diff-switches)) ; If not specified, use default. 117 (or switches (setq switches diff-switches)) ; If not specified, use default.
126 (unless (listp switches) (setq switches (list switches))) 118 (unless (listp switches) (setq switches (list switches)))
127 (or buf (setq buf (get-buffer-create "*Diff*"))) 119 (or buf (setq buf (get-buffer-create "*Diff*")))