aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/diff.el
diff options
context:
space:
mode:
authorStefan Monnier2004-02-11 06:01:50 +0000
committerStefan Monnier2004-02-11 06:01:50 +0000
commit17c91d79003357f4fe180d39a0c328eff9862500 (patch)
tree52e1940e752e46ff12f24e7ff1fe1a02a5ddcdd1 /lisp/diff.el
parentef5c80252f3ebaf44e429e5aaa1ac08609eb7398 (diff)
downloademacs-17c91d79003357f4fe180d39a0c328eff9862500.tar.gz
emacs-17c91d79003357f4fe180d39a0c328eff9862500.zip
(diff): Simplify code handling `switch'.
Diffstat (limited to 'lisp/diff.el')
-rw-r--r--lisp/diff.el11
1 files changed, 3 insertions, 8 deletions
diff --git a/lisp/diff.el b/lisp/diff.el
index dab3c7ebff3..01b9e590a07 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -220,7 +220,8 @@ With prefix arg, prompt for diff switches."
220 (list oldf newf (diff-switches)))) 220 (list oldf newf (diff-switches))))
221 (setq new (expand-file-name new) 221 (setq new (expand-file-name new)
222 old (expand-file-name old)) 222 old (expand-file-name old))
223 (let ((old-alt (file-local-copy old)) 223 (or switches (setq switches diff-switches)) ; If not specified, use default.
224 (let* ((old-alt (file-local-copy old))
224 (new-alt (file-local-copy new)) 225 (new-alt (file-local-copy new))
225 buf) 226 buf)
226 (save-excursion 227 (save-excursion
@@ -229,13 +230,7 @@ With prefix arg, prompt for diff switches."
229 (mapconcat 'identity 230 (mapconcat 'identity
230 `(,diff-command 231 `(,diff-command
231 ;; Use explicitly specified switches 232 ;; Use explicitly specified switches
232 ,@(if switches 233 ,@(if (listp switches) switches (list switches))
233 (if (listp switches)
234 switches (list switches))
235 ;; If not specified, use default.
236 (if (listp diff-switches)
237 diff-switches
238 (list diff-switches)))
239 ,@(if (or old-alt new-alt) 234 ,@(if (or old-alt new-alt)
240 (list "-L" old "-L" new)) 235 (list "-L" old "-L" new))
241 ,(shell-quote-argument (or old-alt old)) 236 ,(shell-quote-argument (or old-alt old))