(dired-guess-default): Remove duplicate shell command entries.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 11 Jul 2011 13:34:35 +0000 (15:34 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 11 Jul 2011 13:34:35 +0000 (15:34 +0200)
Fixes: debbugs:2028

lisp/ChangeLog
lisp/dired-x.el

index fb2f1a7..9fc26f6 100644 (file)
@@ -1,5 +1,8 @@
 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * dired-x.el (dired-guess-default): Remove duplicate shell command
+       entries (bug#2028).
+
        * subr.el (remove-duplicates): New conveniency function.
 
 2011-07-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
index 8395a8b..580217d 100644 (file)
@@ -1103,9 +1103,10 @@ See `dired-guess-shell-alist-user'."
 
     ;; Return commands or nil if flist is still non-nil.
     ;; Evaluate the commands in order that any logical testing will be done.
-    (if (cdr cmds)
-        (mapcar #'eval cmds)
-      (eval (car cmds))))) ; single command
+    (remove-duplicates
+     (if (cdr cmds)
+        (mapcar #'eval cmds)
+       (eval (car cmds))))))           ; single command
 
 (defun dired-guess-shell-command (prompt files)
   "Ask user with PROMPT for a shell command, guessing a default from FILES."