Subject: bug#24723: 26.0.50; minibuffer-default-add-shell-commands wrong behavior

From: Mark Oteiza <[email-masked]>
Date: Tue, 18 Oct 2016 20:29:37 -0400

I'm inclined to push the following:

diff --git a/lisp/simple.el b/lisp/simple.el
index 70bd759..67ab8ca 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3169,7 +3169,9 @@ minibuffer-default-add-shell-commands
   (let* ((filename (if (listp minibuffer-default)
                       (car minibuffer-default)
                     minibuffer-default))
-        (commands (and filename (require 'mailcap nil t)
+         ;; The default minibuffer value is not always a filename (Bug#24723)
+        (commands (and filename (file-readable-p filename)
+                        (require 'mailcap nil t)
                        (mailcap-file-default-commands (list filename)))))
     (setq commands (mapcar (lambda (command)
                             (concat command " " filename))