From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#63744: 28.2; fix dired-guess-default Date: Sun, 28 May 2023 10:40:16 +0800 Message-ID: References: <838rdajmkk.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="31568"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (macOS 11.7.6) To: 63744@debbugs.gnu.org Cancel-Lock: sha1:pmcaXO/Tnfm5Cvlzjk67woD15M8= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 28 04:41:22 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 1q36LQ-00080k-BA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 May 2023 04:41:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q36LA-0006jx-I7; Sat, 27 May 2023 22:41:04 -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 1q36L8-0006ji-Ls for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 22:41:02 -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 1q36L8-00057z-De for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 22:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q36L7-0004Kz-R7 for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 22:41:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 May 2023 02:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63744 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168524164716639 (code B ref -1); Sun, 28 May 2023 02:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 May 2023 02:40:47 +0000 Original-Received: from localhost ([127.0.0.1]:52853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q36Kt-0004KJ-9p for submit@debbugs.gnu.org; Sat, 27 May 2023 22:40:47 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q36Kr-0004KB-D3 for submit@debbugs.gnu.org; Sat, 27 May 2023 22:40:45 -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 1q36Kq-0006hb-PE for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 22:40:44 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q36Kp-000558-BS for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 22:40:44 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1q36Kn-0007Ml-PZ for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 04:40:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAElBMVEUAAAAAAP+LRRP0pGC+ vr7///+7mT1iAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMO DhglKe4AAAEsSURBVCjPbZNBboQwDEV/Cd4X9QJRThApmn0XYW+Jyf2v0m+HhqDBgiAe9rcTG7QH w/1Vn2Ar8gBb/ocywSN3qK9T3z4eFDB4eApocBpeBs1RSykoJd8gQcm8pGmHXFso3ajnmsqV0TnY DQkOfXUfN5NwaI7AWTVOyEhcu1aHmdWItHddUVUcUgUBCkitu8V6ditHVOVdqzl2EQ1ZVGTbdK0V 7cqn8vWzoU5Q/bF9Y/Y0cRU1xwkys5dJ+Dt6pBDWifcNQml8Gh2JVmPSoQzo7en0grswkxrUGYJ7 0hSxxAGr7ZMwYcHIzprpi7TENEE1xtiYxixRlCfPBsUUrwHD7uGIwATrbnODJcVrPpVn3hxiGloe m/S+z3CtuzUSMo83N4DPH+F0evwR3P4A2k+75838OKQAAAAASUVORK5CYII= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:262499 Archived-At: 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. `---- [snipped 10 lines] > 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. There is no alternative at the moment other than redefining dired-guess-default. 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" ...)) WDYT?