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: Mon, 29 May 2023 15:07:36 +0300 Message-ID: <83sfbfgx2v.fsf@gnu.org> References: <838rdajmkk.fsf@gnu.org> <83jzwthsx5.fsf@gnu.org> <87fs7g53rx.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11053"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63744@debbugs.gnu.org, sdl.web@gmail.com To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 29 14:08:14 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 1q3bfZ-0002dy-6D for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 May 2023 14:08:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3bfP-0006ED-PW; Mon, 29 May 2023 08:08:03 -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 1q3bfO-0006Dw-4y for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 08:08: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 1q3bfN-00029p-Sl for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 08:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3bfN-00059G-Ny for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 08:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 May 2023 12:08:01 +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.168536202919722 (code B ref 63744); Mon, 29 May 2023 12:08:01 +0000 Original-Received: (at 63744) by debbugs.gnu.org; 29 May 2023 12:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:57298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3beX-000582-9M for submit@debbugs.gnu.org; Mon, 29 May 2023 08:07:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3beV-00057e-Ie for 63744@debbugs.gnu.org; Mon, 29 May 2023 08:07:08 -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 1q3beP-0001xy-Fu; Mon, 29 May 2023 08:07:01 -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=BvaK6Hi4f9HEiQczVeqWD2rmjr98NVta6bW+XkraEYU=; b=f5UArFYVbiJ/ 55uBihz1HAbuqwIidVSEFFzAwQgPDmJZ1UD9ic4vNAWFsyiuE+HHNVf1yjy3ztc4hA8xH3UevcTMI YQbHXiwU9xraAZseCWBSH4Q70UaBoaHkjFDnIoKNsZSEl+OdKYQUwHz2pFIncUOjP314FlD5/27fJ +1Ef6CvVbm2uHi+0va1F5VFfYUw7XuUJfXU3HzEK6Aa9JtjheiP3u2IwCGdo48gtKsUZTbdGMUAcb 65+Us4aW/5hDB4JkbRkHAWLYVE0/V7NDeDKJT6OMFfx6giTygTgavAv0LRn5g7syrFidYlydQtbfZ ORiUfx1A1ZDgDnV/lMWiLw==; 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 1q3beO-0005Bu-UM; Mon, 29 May 2023 08:07:01 -0400 In-Reply-To: <87fs7g53rx.fsf@web.de> (message from Michael Heerdegen on Mon, 29 May 2023 03:23:46 +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:262569 Archived-At: > From: Michael Heerdegen > Cc: Leo Liu , 63744@debbugs.gnu.org > Date: Mon, 29 May 2023 03:23:46 +0200 > > Eli Zaretskii writes: > > > > 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? > > I think he means: the user should not have to do this. If there's only one user who wants that, there's no difference... > > > (RE ("STR1" "STR2" ...)) > > > > Can't you generate the entire value of dired-guess-shell-alist-user > > dynamically, including the RE part? > > It's a real difference, actually a real win. Please don't only have > constant lists in mind. Does this answer my question above? If so, I don't think I understand the answer, please elaborate. I asked why not generate the whole value, including the REGEXP part, dynamically. > "Dynamically" means that dired can inspect the matched file (the file > name is provided via the variable 'file' bound when evaluating the > expression). This means the EXPR can look at the properties of the > file, it's type and modes etc, which allows a more fine grained user > customization. With such a change one can have entries looking like > > (RE (if COND (GET-DEFAULTS-FOR-COND) (GET-OTHER-DEFAULTS))) > > which would currently be have to be specified as several entries like > > (RE (when COND DEFAULT-FOR-COND-1)) > (RE (when COND DEFAULT-FOR-COND-2)) > ... > (RE (when COND DEFAULT-FOR-COND-n)) > (RE (when (not COND) OTHER-DEFAULT-1)) > ... > (RE (when (not COND) OTHER-DEFAULT-m)) > > and, much worse, testing the CONDITION would have to be performed many > times. Sorry, I don't see why it has to be so complicated. RE can be generated just once, and then consed into a list with whatever should follow it, and those other elements could be generated dynamically. Anyway, I don't see why we should keep arguing. I already said that I won't object to such an extension of the forms in dired-guess-shell-alist-user, I just think we should document them, and I'm quite sure such a change in the code is not for the released branch.