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: Thu, 08 Aug 2019 12:40:03 +0200 Message-ID: <87tvas2b5o.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="20246"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: npostavs@gmail.com, 35564@debbugs.gnu.org, monnier@iro.umontreal.ca, Juri Linkov To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 08 12:41:11 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 1hvfr4-00058w-4x for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Aug 2019 12:41:10 +0200 Original-Received: from localhost ([::1]:48226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvfr2-0006Ie-64 for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Aug 2019 06:41:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35874) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvfqx-0006IS-Oo for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2019 06:41:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvfqw-0000fS-Ia for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2019 06:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvfqw-0000fD-CK for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2019 06:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hvfqw-0004ul-75 for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2019 06:41:02 -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: Thu, 08 Aug 2019 10:41:02 +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.156526081418832 (code B ref 35564); Thu, 08 Aug 2019 10:41:02 +0000 Original-Received: (at 35564) by debbugs.gnu.org; 8 Aug 2019 10:40:14 +0000 Original-Received: from localhost ([127.0.0.1]:39967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hvfq9-0004te-Na for submit@debbugs.gnu.org; Thu, 08 Aug 2019 06:40:14 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:36311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hvfq8-0004tO-2f for 35564@debbugs.gnu.org; Thu, 08 Aug 2019 06:40:12 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id g67so1911801wme.1 for <35564@debbugs.gnu.org>; Thu, 08 Aug 2019 03:40:11 -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; bh=1o9+YTpAW6qlZO8YFvbPezXiltVbtL8n+5BObfySA08=; b=puXF3mECsL633vODi6Viq/SExA7NIKUDUAFxbgmH4MbHgX78bwZoFheWpXmTbS/jp7 +ulT/2rF2QR6n8s+hQeNJX1vWUMmJmRByGVvyPTMu2u3IBSi7Mr0wYj+Q2AGkX+t6rVp TTelbjE2NGw1eXSwcsJtBTlWoSM06YC3JRKNK9LG3oad4FDJ01N1XKVxb9nlXlDqA1r6 4ivYeqx8ykSZwzmA7cjo3jZYLCHe1tEpLIdWGlaHsvjbKofbrjUin6NK3RxG7maDnAlm Y/mh8C9OlL2xjoF8kPHXdPFWkHXqojNjsmrtLNq9IvS5Xzdy1d3D6+IYck8GwKokTh37 Lhpg== 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; bh=1o9+YTpAW6qlZO8YFvbPezXiltVbtL8n+5BObfySA08=; b=XTDQR0PzRYFHgJObXeWTz5HtpyiL0lCdAR2VJTNfcS7gc5RJxB8HDe6T1MaxpHx5eJ M+o/EhdIt9hJ7eZVtzsvUURMdvGGXSUv+NPI3WInLNTosYtI9DsSoY3jh4vuuTD1SoJI repzwvoiHnhRyKiamqUzi8CTZmVpDMjkp5oXDxDfDvnuSqT9/dgXtAYPYFpRvVZpU4TR P5XH9ZmbzjffKtbO5vADKaVQ8G5Hx40LNVoYVJvvSYnyFJUXOXNpY1nwCIXE6GGODi6p 5SJjMvepO/SFwWCaQ5x2mTsyQSHKh7jkhhVHj/SGQpwwMm+wpuj+GMkPdN/3SjfdILdT 6jSg== X-Gm-Message-State: APjAAAXuyLfIH7MNfq0h8ZHv00NLt7iy6YdyxuxtafRQv1tDU0OVcGnF NuYy9FI2wv0RPPQEHpvbFk8= X-Google-Smtp-Source: APXvYqxBvksmIB189mpdhkWOEtOBAaY3+2Vjxh/lYtjxLbFWed4v1v9DwPqIn+sh9/0JcAsxT5tdQg== X-Received: by 2002:a1c:a70d:: with SMTP id q13mr3797934wme.26.1565260806267; Thu, 08 Aug 2019 03:40:06 -0700 (PDT) Original-Received: from nc10-laptop (2a01cb04010fc800c8771fb97d0446e3.ipv6.abo.wanadoo.fr. [2a01:cb04:10f:c800:c877:1fb9:7d04:46e3]) by smtp.gmail.com with ESMTPSA id k9sm29661398wrd.46.2019.08.08.03.40.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Aug 2019 03:40:05 -0700 (PDT) In-Reply-To: <87sgqkjfxv.fsf@web.de> (Michael Heerdegen's message of "Fri, 02 Aug 2019 07:26:36 +0200") 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:164755 Archived-At: First, apologies for taking so long to respond - I was AFK last week. I might not be very reactive these coming weeks either. Michael Heerdegen writes: > Yeah, as mentioned, when coloring is possible, I would also just leave > out the ^ underlining. OK. What exactly do we mean by "coloring is possible"? 1. "Does the warning face have a distinct foreground or background from the prompt face?" 2. "Are the colors distinguishable enough?" (e.g. what shr-color-visible tries to guess IIUC) 3. Something else? What bothers me is that even if we can assert #2, nothing guarantees that these colors will be distinguishable *to the user* (who may e.g. have some form of color blindness). It would therefore be nice if this user could force Emacs to use ^ markers; I guess that would involve a new variable. I stayed away from this path because I wasn't convinced that we needed a full-blown customization option for a supposedly rare branch in dired-do-shell-command, and that we could live with the redundant coloring plus underlining. I'd be happy to make the prompt more succinct, as soon as I'm sure I understand what we mean by "coloring is possible"! >> > Warning: the shell may interpret 1 occurrence of `?' as wildcard: >> > sed 's/?/!/' >> > ^ >> > Proceed anyway? > > I'm not happy with that either. Look at it: there are quotes around the > critical part, so the user might become crazy trying to find out why > Emacs thinks the shell might interpret that as a wildcard. Right. Becoming crazy because Emacs sees phantom wildcards is the reason why I started this bug report; I hoped that by saying "*may* interpret", the user would understand that Emacs is basically saying "this looks like a common footgun; I don't speak shell though so you tell me". > Maybe just telling what dired did not do would be better? Like > "N occurrences of X will not be replaced with the file/file list - > proceed? That would be the most correct description of the situation. I didn't go that way because the user might not be aware of this feature; I failed to come up with a short prompt that would 1. explain the substitution feature and 2. explain why Dired will not activate it here. > Because, there are two things we mix up: (1) dired does not substitute > with files, though the user might have wanted that, and (2) the char is > send to the shell and is a wildcard there, so the result might also not > be what the user intended. Do we want to warn about (1) or (2)? Both > seems to be too much for one line of text. Very much agreed. > If we don't find a good wording maybe use something like > `read-multiple-choice' or some other mechanism where the user is allowed > to hit a help key (?, and that key should also be visible in the > prompt). We can leave an explanation that doesn't have to fit into one > line in the help text. I only mention `read-multiple-choice' because it > provides all of that out of the box, of course there are alternative > ways. That sounds like a good compromise. I'll see what I can come up with.