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#63744: 28.2; fix dired-guess-default Date: Sun, 28 May 2023 09:27:34 +0300 Message-ID: <83jzwthsx5.fsf@gnu.org> References: <838rdajmkk.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28229"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63744@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 28 08:28:23 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 1q39t8-00075f-SG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 May 2023 08:28:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q39sr-0000ZB-07; Sun, 28 May 2023 02:28:05 -0400 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 1q39sp-0000Wk-CR for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 02:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q39so-0001cB-Vh for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 02:28:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q39so-0002Ge-F0 for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 02:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 May 2023 06:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63744 X-GNU-PR-Package: emacs Original-Received: via spool by 63744-submit@debbugs.gnu.org id=B63744.16852552278651 (code B ref 63744); Sun, 28 May 2023 06:28:02 +0000 Original-Received: (at 63744) by debbugs.gnu.org; 28 May 2023 06:27:07 +0000 Original-Received: from localhost ([127.0.0.1]:53023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q39ru-0002FT-Gt for submit@debbugs.gnu.org; Sun, 28 May 2023 02:27:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q39rt-0002Ex-3e for 63744@debbugs.gnu.org; Sun, 28 May 2023 02:27:05 -0400 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 1q39rn-0001Js-Lj; Sun, 28 May 2023 02:26:59 -0400 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=jpcZnABxvDIEPwX0WIxmEa9sgbr6DpLKVlqjzKlZaXY=; b=SlgDmV4EPxcQ lUaYCb5RPaSPkvfxwugSIFAcAIqI/uIg4SZnSIW9lQ1nK76hNu5IZ2sTwLTl6+HrjGdQ6Lv9krHjX MTMIlqr0yknwKr+3qjlUjjn6+LqlRnRDe6KC0d2MrgYxuzK4DuRXfn+sutfiWj1Tg23wvWrY8+ya/ PiL1R51mAIeK3dH/+OceeKohWfhE8P+uGTbslEdTR5u/qkFANkF1B8JO97TXmIRE/WKdKd+KxQ99D kZDepCc4IL3IFl0gN1rWip9DrtaiSfvyRIcljUbNz9SEl+zANpFagEJt8WnNpYd0VxiZyguQ3pR8Y HEbSW9hnTw2WKPoh6YIJ0g==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q39rn-0002t8-2h; Sun, 28 May 2023 02:26:59 -0400 In-Reply-To: (message from Leo Liu on Sun, 28 May 2023 10:40:16 +0800) 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:262513 Archived-At: > From: Leo Liu > Date: Sun, 28 May 2023 10:40:16 +0800 > > On 2023-05-27 09:49 +0300, Eli Zaretskii wrote: > [snipped 10 lines] > > What is the semantics of a list of strings in this case? > > shell-command takes a single string as its argument COMMAND, it > > doesn't take a list of strings. > > See the documentation of dired-guess-default. > > ,---- > | Return a shell command, or a list of commands, appropriate for FILES. > `---- That's not the same, but I get the intent. > > I'd rather not proliferate an undocumented "feature" that is merely a > > side effect of the particular implementation we had at some point, > > without understanding what it gives us. > > I agree in principle. > > > The alternative is for you to change your customization so that EXP > > returns the car of the list it returned before, and that should be > > both easy and backward-compatible, AFAIU. > > Unfortunately many (or most) things in Emacs grow from a 50% solution. Where are you when I'm trying to convince people on emacs-devel not to install such 50% solutions? If every marginally-useful change that can "potentially" help someone is press-pushed into the code base, with the main reason being "why not?", the result is what you observe. But almost no one tries to see this in advance when half-baked changes are brought up, so stuff gets in. Help in reviewing extensions and noticing such marginal solutions will be greatly appreciated. But I digress. > There is no alternative at the moment other than redefining > dired-guess-default. But your suggestion is also a change in that function, so what's the difference? > If you have a static list it can be expressed as an element in > dired-guess-shell-alist-user as such: > > (RE "STR1" "STR2" ...) > > If you have a dynamic list (for example a list from querying the OS) you > are stuck. The patch makes this possible and in my view makes > dired-guess-shell-alist-user more coherent. (RE "STR1" "STR2" ...) can > be regarded as another syntax for > > (RE ("STR1" "STR2" ...)) Can't you generate the entire value of dired-guess-shell-alist-user dynamically, including the RE part? Anyway, you are requesting a new feature: that the elements of the alist could be of the form (REGEXP (COMMAND1 COMMAND2 ...)). I don't see how this makes dired-guess-shell-alist-user more coherent, but I have nothing against such an extension. However, it's too late for such extensions on the emacs-29 release branch, so it could only go to master, for Emacs 30. And it should be properly documented, of course.