From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) Date: Fri, 24 Nov 2023 16:24:41 +0200 Message-ID: <83zfz3dyae.fsf@gnu.org> 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> <86edgfk37h.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14946"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 18132@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 24 15:27:04 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 1r6X95-0003gw-S3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Nov 2023 15:27:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6X85-0003YN-AJ; Fri, 24 Nov 2023 09:26:01 -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 1r6X82-0003Xo-83 for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 09:25:58 -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 1r6X81-0003qV-UA for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 09:25:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6X85-00060P-UH for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 09:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Nov 2023 14:26: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.170083590323013 (code B ref 18132); Fri, 24 Nov 2023 14:26:01 +0000 Original-Received: (at 18132) by debbugs.gnu.org; 24 Nov 2023 14:25:03 +0000 Original-Received: from localhost ([127.0.0.1]:36044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6X78-0005z7-Ir for submit@debbugs.gnu.org; Fri, 24 Nov 2023 09:25:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6X73-0005yb-Ba for 18132@debbugs.gnu.org; Fri, 24 Nov 2023 09:25:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6X6s-0002x9-Ms; Fri, 24 Nov 2023 09:24:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kGax45+vFxEj15jF2fEJw3qtrTI9IIOkerE4Ut+95co=; b=JgJUO6p8F62r MfgSmbxw05YDQ3SFSaDLt98ItdoW8X7+aSHuNori+r2aqUsix73/rS6FyyDDUloj95Diobox5ZISK GsbFuKu4is73HzZxMOeXSMfgDgUaM9aAVG/KmwXkZTHeLYph5JRymPnpBVoszxNSYFQQJtLHWwCJY 4Z4Plb5Em4tvvgRO8OoWE/xHav+6IFoLPd5c8kTD+H5SY5/hC1DSt38V34rOCi0h7K90qkDh0rpNI F1GBZaydu9tl4WWPSNhnqILdHa+BeLFIYsDXciU5NCdqC0NDqAKr3GRM/OH9OUvnAa52zW8EMEKhT DZNQK356o47zDXPNMipCJg==; In-Reply-To: <86edgfk37h.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 24 Nov 2023 09:51:54 +0200) 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:274864 Archived-At: > From: Juri Linkov > Cc: 18132@debbugs.gnu.org > Date: Fri, 24 Nov 2023 09:51:54 +0200 > > >> > 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. IMO, read-shell-command should not by default call these helpers. If we cannot find a suitable non-preloaded file to put this stuff (is subr-x.el okay, for example?), it's okay to start a new file. > > 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-&'). That's immaterial: M-n is an integral part of shell-command (of any command, really), and thus should not cause such massive loading of helper stuff, not by default anyway. Why do we think we can second-guess what user wants from shell-command guessing? why do we think the user will want XDG in this picture? or mailcap? These are explicit user preferences, and we should leave it to the users to express their preferences. > Also shell-command-guess is used by dired-read-shell-command > ('!' and '&' on a file in dired). Likewise here: users should by default be able to invoke these Dired commands without automatically loading those helpers, which come with quite tangible ballast. For Dired, this is perhaps less important, since Dired itself is an optional package, but still: I think it's wrong to do this by default.