From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.bugs Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) Date: Wed, 30 Jul 2014 17:44:13 +0100 Message-ID: References: <87d2cn67zo.fsf@mail.jurta.org> <87bns6dcul.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135f8dcbc811604ff6bdd85 X-Trace: ger.gmane.org 1406738723 32646 80.91.229.3 (30 Jul 2014 16:45:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2014 16:45:23 +0000 (UTC) Cc: 18132@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 30 18:45:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XCX08-0003Ea-Ko for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jul 2014 18:45:16 +0200 Original-Received: from localhost ([::1]:52197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCX08-000150-9a for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jul 2014 12:45:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWzz-0000ri-86 for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:45:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCWzu-0008Gf-Og for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:45:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWzu-0008G6-IX for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XCWzt-0006gd-SP for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jul 2014 16:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18132 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18132-submit@debbugs.gnu.org id=B18132.140673866325644 (code B ref 18132); Wed, 30 Jul 2014 16:45:01 +0000 Original-Received: (at 18132) by debbugs.gnu.org; 30 Jul 2014 16:44:23 +0000 Original-Received: from localhost ([127.0.0.1]:52043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCWzH-0006fX-5I for submit@debbugs.gnu.org; Wed, 30 Jul 2014 12:44:23 -0400 Original-Received: from mail-la0-f47.google.com ([209.85.215.47]:65259) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCWzD-0006fJ-ND for 18132@debbugs.gnu.org; Wed, 30 Jul 2014 12:44:21 -0400 Original-Received: by mail-la0-f47.google.com with SMTP id mc6so1137708lab.34 for <18132@debbugs.gnu.org>; Wed, 30 Jul 2014 09:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2GfkD9Dr9auYjN10lIRGnJLUKQRJpjQ9254uaWm/Qo8=; b=MPuFP/JbWeXBNMjTE9LMeRduVRpliubOIknxxRANuaqbv/ZmtwRC8ERSq1p2iKEtdB 44lf98qruLeDEvvqODUIJuW8XfDYzGKap6qj8fsWR11QW72hlHTIFDYZZSexBN0G6bB1 2evQfLTEji4xVKhcu1LXtCMHWFBaBDiDnmxa0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=2GfkD9Dr9auYjN10lIRGnJLUKQRJpjQ9254uaWm/Qo8=; b=FhN7GrFRFoXegnBFkSrM3Jmh7nitXTJTnNe0JuyW0w1CrqCObePSQDEdvUZkYMQNvD xY9CBKz0UHuyB8kzREAfUPTn88AUelT5XCgTaZFDZh++l6Hl4YBt/MRsKWjIiYKNqUEN TKb04rnXj3sbErM+1fG/iq0GRdSPDrC5nCpwMB88RkOUIjK3KKljleT0X3w2Gwl6ZtHY brfU7UK8X4NhxD8kgAriynNScpa1DyxtlZ4eZr3atRTJ7GiRy/C8NGNrPE47nRw/TJkj qJFYODXgLJ7FV9hNbe12bC+TiaOhUydkv+yWhhqPZPXaf611Hw21sdH5sUaAf2xt5sMw tdRg== X-Gm-Message-State: ALoCoQnYzNBXnJApIdnyT34PtAzc9IJkBCOHlpOEFB6eWiUpqAfZgTt/0wNL52ziGWP4obZYK5ux X-Received: by 10.152.202.197 with SMTP id kk5mr6059276lac.19.1406738653536; Wed, 30 Jul 2014 09:44:13 -0700 (PDT) Original-Received: by 10.152.163.4 with HTTP; Wed, 30 Jul 2014 09:44:13 -0700 (PDT) In-Reply-To: <87bns6dcul.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91975 Archived-At: --001a1135f8dcbc811604ff6bdd85 Content-Type: text/plain; charset=UTF-8 On 30 July 2014 17:32, Juri Linkov wrote: > >> run-mailcap is fully supported by shell-command and async-shell-command > where > >> the list of available commands can be accessed using M-n in its > minibuffer. > > > > I can't see any mention of run-mailcap in the Emacs source; do you mean > > simply that it's possible to add it to the list of commands used? > > grep -nH mailcap *.el > ./dired-aux.el:558:(declare-function mailcap-file-default-commands > "mailcap" (files)) > ./dired-aux.el:562:This function is used to add all related commands > retrieved by `mailcap' > ./dired-aux.el:565: (let ((commands (and (boundp 'files) (require > 'mailcap nil t) > ./dired-aux.el:566: (mailcap-file-default-commands > files)))) > ./simple.el:2743:(declare-function mailcap-file-default-commands "mailcap" > (files)) > ./simple.el:2748:This function is used to add all related commands > retrieved by `mailcap' > ./simple.el:2754: (commands (and filename (require 'mailcap nil t) > ./simple.el:2755: (mailcap-file-default-commands > (list filename))))) > I'm sorry if I've missed something, but I don't see what this has to do with run-mailcap. > We could leave the original list intact, and add xdg-open/w32-shell-execute > to the top of the list, so it would be the first suggestion that the user > will get after the first M-n. > It would be good to discourage customization of dired-guess-shell-alist-{default,user}, and steer users towards the non-program-specific mechanisms. It would also be good eventually not to have to maintain the list, or indeed the dired-guess-shell mechanism at all. As for your mention of "the first M-n", as far as I can discover, the first time I press M-n, the default command, which was already mentioned in the prompt, is simply inserted at point, as if I had typed it. So is "the first suggestion that the user will get after the first M-n" actually the same thing as "the default suggestion"? (I hope so!) > There is a good example how to check its availability in > `browse-url-can-use-xdg-open' that could be moved > to a more general file like simple.el. > Thanks for the pointer. -- http://rrt.sc3d.org --001a1135f8dcbc811604ff6bdd85 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 3= 0 July 2014 17:32, Juri Linkov <juri@jurta.org> wrote:
>> run-mailcap is fully supported by shell-command an= d async-shell-command where
>> the list of available commands can be accessed using M-n in its mi= nibuffer.
>
> I can't see any mention of run-mailcap in the Emacs source; do you= mean
> simply that it's possible to add it to the list of commands used?<= br>
grep -nH mailcap *.el
./dired-aux.el:558:(declare-function mailcap-file-default-commands "ma= ilcap" (files))
./dired-aux.el:562:This function is used to add all related commands retrie= ved by `mailcap'
./dired-aux.el:565: =C2=A0(let ((commands (and (boundp 'files) (require= 'mailcap nil t)
./dired-aux.el:566: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0(mailcap-file-default-commands files))))
./simple.el:2743:(declare-function mailcap-file-default-commands "mail= cap" (files))
./simple.el:2748:This function is used to add all related commands retrieve= d by `mailcap'
./simple.el:2754: =C2=A0 =C2=A0 =C2=A0 =C2=A0(commands (and filename (requi= re 'mailcap nil t)
./simple.el:2755: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (mailcap-file-default-commands (list filename)))))
=

I'm sorry if I've missed something= , but I don't see what this has to do with run-mailcap.
=C2=A0
We could leave the or= iginal list intact, and add xdg-open/w32-shell-execute
to the top of the list, so it would be the first suggestion that the user will get after the first M-n.

It would = be good to discourage customization of dired-guess-shell-alist-{default,use= r}, and steer users towards the non-program-specific mechanisms. It would a= lso be good eventually not to have to maintain the list, or indeed the dire= d-guess-shell mechanism at all.

As for your mention of "the first M-n", as far as = I can discover, the first time I press M-n, the default command, which was = already mentioned in the prompt, is simply inserted at point, as if I had t= yped it. So is "the first suggestion that the user will get after the = first M-n" actually the same thing as "the default suggestion&quo= t;? (I hope so!)
=C2=A0
There is a good example how to check its availability in
`browse-url-can-use-xdg-open' that could be moved
to a more general file like simple.el.

Thanks for the poin= ter.
--001a1135f8dcbc811604ff6bdd85--