From c3de9febac40b2ecd7c3a4e0c13f17f807d228fe Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 11 Jul 2011 15:34:35 +0200 Subject: [PATCH] (dired-guess-default): Remove duplicate shell command entries. Fixes: debbugs:2028 --- lisp/ChangeLog | 3 +++ lisp/dired-x.el | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fb2f1a7a6e9..9fc26f61181 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-07-11 Lars Magne Ingebrigtsen + * 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 diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 8395a8b905f..580217d3fbd 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -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." -- 2.39.5