GNU bug report logs - #17251
24.4.50; `dired-guess-default': wrong logic

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 12 Apr 2014 16:07:01 UTC

Severity: minor

Tags: fixed

Found in version 24.4.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 17251 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: 17251 <at> debbugs.gnu.org
Subject: RE: bug#17251: 24.4.50; `dired-guess-default': wrong logic
Date: Sat, 12 Apr 2014 09:28:34 -0700 (PDT)
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).




This bug report was last modified 3 years and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.