From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#2414: 23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands Date: Sun, 22 Feb 2009 15:04:53 -0800 Message-ID: <001b01c99541$f91510d0$0200a8c0@us.oracle.com> References: <000601c99396$05d396a0$0200a8c0@us.oracle.com> <87r61qf8ph.fsf@jurta.org> Reply-To: Drew Adams , 2414@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235345047 15009 80.91.229.12 (22 Feb 2009 23:24:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Feb 2009 23:24:07 +0000 (UTC) Cc: 2414@emacsbugs.donarmstrong.com To: "'Juri Linkov'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 23 00:25:23 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LbNhE-0007py-UN for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Feb 2009 00:25:17 +0100 Original-Received: from localhost ([127.0.0.1]:53933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbNfu-0002dA-Dg for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Feb 2009 18:23:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LbNfh-0002ZR-TC for bug-gnu-emacs@gnu.org; Sun, 22 Feb 2009 18:23:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LbNfg-0002Yv-7e for bug-gnu-emacs@gnu.org; Sun, 22 Feb 2009 18:23:41 -0500 Original-Received: from [199.232.76.173] (port=60362 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbNff-0002Yd-IC for bug-gnu-emacs@gnu.org; Sun, 22 Feb 2009 18:23:39 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41608) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LbNfe-0007C7-Us for bug-gnu-emacs@gnu.org; Sun, 22 Feb 2009 18:23:39 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1MNNaI2001617; Sun, 22 Feb 2009 15:23:37 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n1MNA4Da030640; Sun, 22 Feb 2009 15:10:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 22 Feb 2009 23:10:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2414 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2414-submit@emacsbugs.donarmstrong.com id=B2414.123534388428545 (code B ref 2414); Sun, 22 Feb 2009 23:10:04 +0000 Original-Received: (at 2414) by emacsbugs.donarmstrong.com; 22 Feb 2009 23:04:44 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from acsinet11.oracle.com (acsinet11.oracle.com [141.146.126.233]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1MN4eiD028539 for <2414@emacsbugs.donarmstrong.com>; Sun, 22 Feb 2009 15:04:41 -0800 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n1MN4v9S007045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 22 Feb 2009 23:04:58 GMT Original-Received: from acsmt707.oracle.com (acsmt707.oracle.com [141.146.40.85]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n1MN4dQk029487; Sun, 22 Feb 2009 23:04:41 GMT Original-Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 22 Feb 2009 23:04:30 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87r61qf8ph.fsf@jurta.org> Thread-Index: AcmVOGOwqE7lnXwdT3SiqcP7UasRxgABISSA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt707.oracle.com [141.146.40.85] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.49A1D9FF.0330:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 22 Feb 2009 18:23:41 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25609 Archived-At: > > Enhancement request: > > > > `minibuffer-default-add-shell-commands' should add to the minibuffer > > defaults list not only the commands determined by MIME type > (which it > > does now, using `mailcap-file-default-commands'), but also the > > commands determined by `dired-guess-default'. > > > > `dired-guess-default' is defined in dired-x.el, but it has > > nothing to do with Dired, AFAICT, so there is no reason that > > it should not be available (and used) generally. > > > > And variables `dired-guess-shell-alist-user' and > > `dired-guess-shell-alist-default' should also be factored out of > > dired-x.el. They too are not Dired-related, AFAICT. > > Instead of generalizing `dired-guess-shell-alist-default', > I'd rather create a similar user-defined list of commands > to override default MIME commands in `mailcap-mime-data' > (using something like `mailcap-add'). `dired-guess-shell-alist-user' is the user-defined list; `dired-guess-shell-alist-default' is not user-defined. But a user-defined list lets users override and supplement a default list of rules. Why would this necessarily have anything to do with MIME types? The Dired-X style rules provide an orthogonal way to provide guesses of shell commands for given file types. If you want to *also* do something similar for MIME types (a user-defined MIME-association list, to override default MIME-association behavior), that's another story. That is a separate suggestion from the one I am making. What is wrong with having a default set of Dired-X style rules, such as `dired-guess-shell-alist-default' - but outside of Dired(-X), and likewise let users provide a set of custom rules to override these default rules (like `dired-guess-shell-alist-user' - but outside of Dired(-X))? Why couple such rules with MIME-type overrides? MIME-type associations are a different kind of file-type association from the simple Dired-X style rules. And we could go beyond this, to include MS Windows file-type associations (which I believe are in the Registry). On Windows, Emacs could employ also those associations when trying to suggest appropriate programs (shell commands) for a given set of file types. FWIW, (except for including MS Windows associations), I do this in Icicles. For example, for a PDF file marked in Dired, the MIME-type association comes up with commands `gv -safer' and `pdftotext ? -', and the Dired-X rules come up with command `xpdf' (with my Cygwin bash shell and default MIME types). There's no reason not to provide all three commands to the user. And there's no reason to try to shoehorn everything into the form of MIME-type associations, so that MIME alone is made to come up with all three guesses. Improving MIME associations is possible, but it is a separate question. Not everything need be done in the context of MIME types. The Dired-X style rules are handy and orthogonal, as are MS Windows file-type associations. Come to think of it, there might be a reason for Dired to keep its own set of such rules, in *addition* to creating a global set. That might be handy for use by code and hooks etc. Dunno. But the main thing is to move these two alists out of Dired-X and make their associations available generally, in the same way as the MIME associations are available generally. > > Note, BTW, that dired-x.el already uses > > `minibuffer-default-add-shell-commands' > > in `dired-smart-shell-command' (in dired-x.el). It makes no > > sense that only the MIME types be used to come up with defaults, and > > not also `dired-guess-default', in the very library that defines > > `dired-guess-default'! > > Thanks for the pointer. After moving code with > `minibuffer-default-add-shell-commands' from `shell-command' > to `read-shell-command' on 2008-07-31 I forgot to change > `dired-smart-shell-command' the same way. Fixed now. > > > My guess is that someone just updated > > `dired-smart-shell-command' for > > Emacs 23 mechanically, without thinking about the commands provided > > by `dired-guess-default'. IOW, it was a mechanical substitution of > > the same diff that was used to update `read-shell-command'. > > `dired-smart-shell-command' is unrelated to `dired-guess-default' > with its alists. `dired-smart-shell-command' is bound to `M-!' > and according to its docstring it should work like `shell-command'. Yes, you're right about that - I misspoke. > Moreover, currently `M-!' is the only way to use MIME commands from > `mailcap-file-default-commands' when dired-x is loaded!