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: Sat, 27 May 2023 12:10:15 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39429"; 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:D0bJRZqSf9GttrV0i2Q8ZhqgSh0= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 27 06:11:25 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 1q2lH3-000A9F-I3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 May 2023 06:11:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2lGm-0003pv-DY; Sat, 27 May 2023 00:11:08 -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 1q2lGh-0003pc-Sr for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 00:11:05 -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 1q2lGg-0000cn-8E for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 00:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2lGf-0001wB-TS for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 00:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 May 2023 04:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 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.16851606297376 (code B ref -1); Sat, 27 May 2023 04:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 May 2023 04:10:29 +0000 Original-Received: from localhost ([127.0.0.1]:51167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2lG8-0001uu-VY for submit@debbugs.gnu.org; Sat, 27 May 2023 00:10:29 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2lG6-0001ul-U1 for submit@debbugs.gnu.org; Sat, 27 May 2023 00:10:27 -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 1q2lG5-0003mD-9H for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 00:10:26 -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 1q2lG3-0000Pd-Kb for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 00:10:24 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1q2lG0-00095q-M1 for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 06:10:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC 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.249, 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:262458 Archived-At: --=-=-= Content-Type: text/plain I have this customisation (setq dired-guess-shell-alist-user '(("." EXP))) where EXP evaluates to a list of strings. It has been working for ~10 years until Emacs 28. After some digging it turns out there is a rewrite of `dired-guess-default' which is not compatible. Previously returning a list of strings from EXP accidentally worked. (eval (car cmds) `((file . ,file))) ; single command but if it evaluates to a list of strings it is perfectly fine as per the documentation of dired-guess-default. I propose the following patch for remedy. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-dired-guess-default.patch Content-Description: 0001-Fix-dired-guess-default.patch >From 16fbf6eb7e054d715326801647af579715f2911f Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 27 May 2023 12:03:08 +0800 Subject: [PATCH] Fix dired-guess-default * lisp/dired-x.el (dired-guess-shell-alist-user): Document COMMAND can also return a list of strings. (dired-guess-default): Handle list of strings from eval COMMAND. --- lisp/dired-x.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index bc85da2c..0420a86c 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -950,9 +950,9 @@ If several files are to be processed, REGEXP has to match all the files. Each COMMAND can either be a string or a Lisp expression that evaluates -to a string. If this expression needs to consult the name of the file for -which the shell commands are being requested, it can access that file name -as the variable `file'. +to a string or list of strings. If this expression needs to consult +the name of the file for which the shell commands are being requested, +it can access that file name as the variable `file'. If several COMMANDs are given, the first one will be the default and the rest will be added temporarily to the history and can be retrieved @@ -975,9 +975,9 @@ See `dired-guess-shell-alist-user'." (let* ((case-fold-search dired-guess-shell-case-fold-search) (programs (delete-dups - (mapcar + (mapcan (lambda (command) - (eval command `((file . ,(car files))))) + (ensure-list (eval command `((file . ,(car files)))))) (seq-reduce #'append (mapcar #'cdr -- 2.32.0 (Apple Git-132) --=-=-=--