unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 17251@debbugs.gnu.org
Subject: bug#17251: 24.4.50; `dired-guess-default': wrong logic
Date: Sat, 12 Apr 2014 09:28:34 -0700 (PDT)	[thread overview]
Message-ID: <0628ccb7-0ee6-4522-bfba-bc853c5e8985@default> (raw)
In-Reply-To: <97d70b54-93f6-4247-9a29-68145f9d8965@default>

In fact, at the top of the section of `dired-x.el' which implements this,
you will find an English description of the overly restrictive logic:

;;; GUESS SHELL COMMAND.

;; Brief Description:
;;;
;; * `dired-do-shell-command' is bound to `!' by dired.el.
;;;
;; * `dired-guess-shell-command' provides smarter defaults for
;;;    dired-aux.el's `dired-read-shell-command'.
;;;
;; * `dired-guess-shell-command' calls `dired-guess-default' with list of
;;;    marked files.
;;;
;; * Parse `dired-guess-shell-alist-user' and
;;;   `dired-guess-shell-alist-default' (in that order) for the first REGEXP
;;;   that matches the first file in the file list.
;;;
;; * If the REGEXP matches all the entries of the file list then evaluate
;;;   COMMAND, which is either a string or a Lisp expression returning a
;;;   string.  COMMAND may be a list of commands.
;;;
;; * Return this command to `dired-guess-shell-command' which prompts user
;;;   with it.  The list of commands is put into the list of default values.
;;;   If a command is used successfully then it is stored permanently in
;;;   `dired-shell-command-history'.

The inappropriate part of the logic is described in the 5th bullet.
The logic should not be to require that a single REGEXP (the first regexp)
"matches all the entries of the file list" in order to find the appropriate
COMMAND.  It should be to require that all files in the file list are
associated with the same COMMAND.  Individual files in the list should be
able to be associated with the COMMAND in different ways (i.e., using
different regexps).





  reply	other threads:[~2014-04-12 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12 16:05 bug#17251: 24.4.50; `dired-guess-default': wrong logic Drew Adams
2014-04-12 16:28 ` Drew Adams [this message]
2021-05-29  5:49 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0628ccb7-0ee6-4522-bfba-bc853c5e8985@default \
    --to=drew.adams@oracle.com \
    --cc=17251@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).