]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 2010-11-22 change to diff.el.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 20 Dec 2010 00:20:25 +0000 (08:20 +0800)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 20 Dec 2010 00:20:25 +0000 (08:20 +0800)
* 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.

lisp/ChangeLog
lisp/vc/diff.el

index 0c363ab7a03a0b9e5a91678a06e0ff9384c53778..175463f97599879cb30691f969715f2aec6a6271 100644 (file)
@@ -1,7 +1,7 @@
 2010-12-20  Chong Yidong  <cyd@stupidchicken.com>
 
-       * vc/diff.el (diff-better-file-name): Function deleted;
-       abbreviating file name creates problems with shell-quote-argument.
+       * 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.
 
        * tool-bar.el (tool-bar--image-expression): New function.
index 752b12446febf0100174c5c3097fa140a1ee3795..1f5f2d764d2c19141ccddd4128bb8fe852466a1e 100644 (file)
@@ -110,18 +110,10 @@ specified in `diff-switches' are passed to the diff command."
           tempfile))
     (file-local-copy file-or-buf)))
 
-(defun diff-better-file-name (file)
-  (if (bufferp file) file
-    (let ((rel (file-relative-name file))
-          (abbr (abbreviate-file-name (expand-file-name file))))
-      (if (< (length abbr) (length rel))
-          abbr
-        rel))))
-
 (defun diff-no-select (old new &optional switches no-async buf)
   ;; Noninteractive helper for creating and reverting diff buffers
-  (setq new (diff-better-file-name new)
-       old (diff-better-file-name old))
+  (unless (bufferp new) (setq new (expand-file-name new)))
+  (unless (bufferp old) (setq old (expand-file-name old)))
   (or switches (setq switches diff-switches)) ; If not specified, use default.
   (unless (listp switches) (setq switches (list switches)))
   (or buf (setq buf (get-buffer-create "*Diff*")))