From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#35564: [PATCH v4] Tweak dired warning about "wildcard" characters Date: Mon, 19 Aug 2019 06:55:28 +0200 Message-ID: <87wof9u533.fsf@gmail.com> References: <87zho2cd4f.fsf@gmail.com> <87wohvf22u.fsf@gmail.com> <87h88cvpkj.fsf_-_@gmail.com> <87imsinbmr.fsf_-_@gmail.com> <87y313z3tp.fsf@gmail.com> <83wog3lo5c.fsf@gnu.org> <87wog3pewu.fsf@gmail.com> <87v9vndsnj.fsf@web.de> <87imrl4ixr.fsf@web.de> <87r2688y1l.fsf@gmail.com> <87sgqkjfxv.fsf@web.de> <87tvas2b5o.fsf@gmail.com> <87d0hffjda.fsf@mail.linkov.net> <87k1bmfr1b.fsf@gmail.com> <87mugajgg8.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="36924"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen , 35564@debbugs.gnu.org, monnier@iro.umontreal.ca, npostavs@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 19 06:56:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzZiF-0009R7-5l for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2019 06:56:12 +0200 Original-Received: from localhost ([::1]:44462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzZiD-0002rg-Dc for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2019 00:56:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzZi7-0002qJ-2R for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 00:56:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzZi6-0005AP-1m for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 00:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50232) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzZi5-00059j-Qb for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 00:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hzZi5-0000PY-Ot for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2019 00:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2019 04:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35564 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35564-submit@debbugs.gnu.org id=B35564.15661905421547 (code B ref 35564); Mon, 19 Aug 2019 04:56:01 +0000 Original-Received: (at 35564) by debbugs.gnu.org; 19 Aug 2019 04:55:42 +0000 Original-Received: from localhost ([127.0.0.1]:59053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzZhl-0000Ot-PZ for submit@debbugs.gnu.org; Mon, 19 Aug 2019 00:55:41 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:46744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzZhk-0000Og-0j for 35564@debbugs.gnu.org; Mon, 19 Aug 2019 00:55:40 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id z1so7202304wru.13 for <35564@debbugs.gnu.org>; Sun, 18 Aug 2019 21:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=18SxVqew43C9g9VKvCkbua9VtoNgRRld09X2sGDQ03A=; b=kemCrht2EBQ3ULpu6tR1Vc4TYyf55gwW8o6FYnGu4VZZMur5OY8Dz+2jI7NxD+d+hH z0GNr1Jl53tFDlwTzW3BydM1PxXEYJS39mgDAw2UG0GzPdNXw0cbSySAcylcytZxkbZ4 SGhMFlQXMltm9IbkxWKv14rLWkizU6LQ0apPFq7oawgiiDYuelgXnYcClw48eD5fgVQN ET5Ioanqq9dwjNxfEzgLcubXBMY/9vJ/PJawJZsiopaqdlOoG3Vow5KBVybCgdhvS4Gs kpLeKHs0QB1yDJZTiHLqOrsM4mkPGuJ7XoHzfmj0FbTpsBmSaml4gtXglanitbKG4h3X Y/lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=18SxVqew43C9g9VKvCkbua9VtoNgRRld09X2sGDQ03A=; b=NTLDnATCmulvhrV5DMTEobXGZ54DRterjvRxn7q7wcHGl4AiVKdjt1PLu08+FzkUex 5OZZVw15RfAaJXw9IxjmeNZAPP3Su9oOiTl85dRfsa/rSu9RW+2GXD2vOk1eAx17Yaf8 CSfnORoRX5rOe2XCsVsbZdlO06WwQw2lzx42hcj/W53HxeWg6jryyc/J8buavxZkm7Gj jAUmHWreoB24kNiTCCD7fvEKEd4u78bXiTCBfx7GMzI1EJ/LkMyWkHCuDSMJtQDPVOSM OGzrbPxUHnBTe6kWc5n7b3INwlVzYmLsfLgaLID3HDnyC5s2+YDmQDFhssmWr1p6vcf7 6mvQ== X-Gm-Message-State: APjAAAVM//BGhuE9LRZnlWdM4aUnTKplTHREWQ5WDhs9XX7oyWty0wXj y494ucnw0C2VRDdFDiDQwGs= X-Google-Smtp-Source: APXvYqzV/NhOgXLYgWnzd7YACuiAJZ+wrSgL0Yqrw1Co8KcTFeIe+kFjaOtJkrJfBu0ixGrL1T8C6Q== X-Received: by 2002:a5d:5591:: with SMTP id i17mr24225552wrv.280.1566190534196; Sun, 18 Aug 2019 21:55:34 -0700 (PDT) Original-Received: from nc10-laptop ([109.190.253.11]) by smtp.gmail.com with ESMTPSA id t14sm10889336wrv.12.2019.08.18.21.55.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Aug 2019 21:55:33 -0700 (PDT) In-Reply-To: <87mugajgg8.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 15 Aug 2019 23:56:23 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165370 Archived-At: Juri Linkov writes: > Now the missing case - how to do the same that =E2=80=98cat ./`?`=E2=80= =99 does, > i.e. how to substitute =E2=80=98*=E2=80=99 by marked files in such Dired = prompt: > > ! cat ./`*` > Confirm--do you mean to use =E2=80=98*=E2=80=99 as a wildcard? (y or = n) y > $ cat ./`*` marked > /bin/bash: marked: command not found > cat: ./: Is a directory > > Why can't it run this shell command: > > $ cat ./marked AFAICT, because dired--star-or-qmark-p does not handle `*`: > Isolated means that MATCH is surrounded by spaces or at the beginning/end > of STRING followed/prefixed with an space. A match to =E2=80=98`?`=E2=80= =99, > isolated or not, is also valid. I've skimmed the docstrings and comments for dired--star-or-qmark-p, dired-shell-stuff-it and dired-do-shell-command, but I could not find a rationale for not handling that case. git log -G'`\*`' hasn't finished yet but so far it hasn't told me anything either. If this is something we want[1], we can add it independently of this bug report. If no-one has committed it (or created a new bug report for it) by the time I get back to coding, I might throw in a patch for that in the series; chances are it might simplify the code somewhat, since ? and * will then be handled similarly. Thanks for the survey Juri! [1] I see no reason not to support it, since otherwise the shell translates `*` into the command first-file-according-to-locale other-files=E2=80=A6 which doesn't strike me as very useful behaviour. Substituting `*` for the file list, like we substitute `?` for each file, could make sense, e.g. for ! some-command "`*`" where some-command wants a space-separated file list as a single argument (though I can't come up with an actual command off the top of my head).