From 17c91d79003357f4fe180d39a0c328eff9862500 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 11 Feb 2004 06:01:50 +0000 Subject: [PATCH] (diff): Simplify code handling `switch'. --- lisp/diff.el | 11 +++-------- 1 file 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." (list oldf newf (diff-switches)))) (setq new (expand-file-name new) old (expand-file-name old)) - (let ((old-alt (file-local-copy old)) + (or switches (setq switches diff-switches)) ; If not specified, use default. + (let* ((old-alt (file-local-copy old)) (new-alt (file-local-copy new)) buf) (save-excursion @@ -229,13 +230,7 @@ With prefix arg, prompt for diff switches." (mapconcat 'identity `(,diff-command ;; Use explicitly specified switches - ,@(if switches - (if (listp switches) - switches (list switches)) - ;; If not specified, use default. - (if (listp diff-switches) - diff-switches - (list diff-switches))) + ,@(if (listp switches) switches (list switches)) ,@(if (or old-alt new-alt) (list "-L" old "-L" new)) ,(shell-quote-argument (or old-alt old)) -- 2.39.2