From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) Date: Fri, 24 Nov 2023 09:51:54 +0200 Organization: LINKOV.NET Message-ID: <86edgfk37h.fsf@mail.linkov.net> References: <87d2cn67zo.fsf@mail.jurta.org> <87bns6dcul.fsf@mail.jurta.org> <87silbstsc.fsf@mail.jurta.org> <83lf2k5gna.fsf@gnu.org> <83ilxn3qpo.fsf@gnu.org> <878ryizwyi.fsf@mail.linkov.net> <86y1eoxtrr.fsf@mail.linkov.net> <83leaofebt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37318"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 18132@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 24 09:23:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r6RT6-0009YW-32 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Nov 2023 09:23:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6RSl-0004vF-V7; Fri, 24 Nov 2023 03:22:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6RSj-0004u5-UR for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 03:22:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6RSj-0004Aa-M9 for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 03:22:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6RSn-0001pw-RW for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 03:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Nov 2023 08:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18132 X-GNU-PR-Package: emacs Original-Received: via spool by 18132-submit@debbugs.gnu.org id=B18132.17008141347004 (code B ref 18132); Fri, 24 Nov 2023 08:23:01 +0000 Original-Received: (at 18132) by debbugs.gnu.org; 24 Nov 2023 08:22:14 +0000 Original-Received: from localhost ([127.0.0.1]:35569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6RS1-0001ou-MI for submit@debbugs.gnu.org; Fri, 24 Nov 2023 03:22:13 -0500 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:60477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6RRy-0001oR-7V for 18132@debbugs.gnu.org; Fri, 24 Nov 2023 03:22:10 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 9447C1C000F; Fri, 24 Nov 2023 08:21:57 +0000 (UTC) In-Reply-To: <83leaofebt.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Nov 2023 21:40:38 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274847 Archived-At: >> > Then its possible options for such hook could include: >> > >> > - xdg-open-function >> > - mailcap-function that adds mailcap candidates >> > - dired-x-guess that adds existing dired-guess-shell-alist-default >> > - Windows-specific candidates from w32-shell-execute >> > - etc. >> >> Here is the implementation: > > Thanks, but please don't put this stuff in simple.el. There's no > reason to have this preloaded in Emacs. I can't find other place to put these 50 lines. I added to simple.el near read-shell-command because it's used by read-shell-command. If you want this could be moved to dired-aux.el and placed near dired-guess-shell-command. But would it be quite inappropriate since shell-command-guess is a more general feature? > And let's try to implement this in a way that won't load mailcap, xdg, > dired, and dired-aux whenever shell-command is invoked. It already doesn't load mailcap, xdg, dired, and dired-aux when shell-command is invoked. It loads these files only when the user needs to use them and types 'M-n' twice in the minibuffer of read-shell-command ('M-!' and 'M-&'). Also shell-command-guess is used by dired-read-shell-command ('!' and '&' on a file in dired).