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, 29 Jul 2019 21:01:58 +0200 Message-ID: <87r2688y1l.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="147736"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35564@debbugs.gnu.org, monnier@iro.umontreal.ca, npostavs@gmail.com To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 29 21:03:10 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 1hsAvN-000cJh-RU for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jul 2019 21:03:09 +0200 Original-Received: from localhost ([::1]:55842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsAvM-000176-TT for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jul 2019 15:03:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60223) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsAvH-00016o-SC for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2019 15:03:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsAvG-00029N-MD for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2019 15:03:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40319) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsAvG-00028s-I8 for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2019 15:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hsAvG-0000Aq-By for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2019 15:03: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: Mon, 29 Jul 2019 19:03: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.1564426934601 (code B ref 35564); Mon, 29 Jul 2019 19:03:02 +0000 Original-Received: (at 35564) by debbugs.gnu.org; 29 Jul 2019 19:02:14 +0000 Original-Received: from localhost ([127.0.0.1]:49140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsAuU-00009c-5K for submit@debbugs.gnu.org; Mon, 29 Jul 2019 15:02:14 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:53506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsAuS-00009N-DB for 35564@debbugs.gnu.org; Mon, 29 Jul 2019 15:02:12 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id x15so54836963wmj.3 for <35564@debbugs.gnu.org>; Mon, 29 Jul 2019 12:02:12 -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=aRQyDNgtYQy/qxQO3lzKRNGeGaDzzdlVSGitbFb5nv8=; b=MWuceZ8qD+I86MgWvQcAeNdlC9VwADu8hnxjwr2mFME9U04eFE/sHfCDvJy0kv/QAn wyhni0S26YIR0RPGi4xP1hwISNoJ0VnX56xvzeCeVorOdT+JXUqE9/6JpGVnEVW/uVzH HwKogWPA0w7HGDJtHQkbSYLj+wVvOzlSMBTtdxCuEcTBJbPmrmXU70p7jSbjEgoV3jaF kd3ei9PwpRGwg4vIiwpsbATRzSzq5NuSYhh2t2GvdcdRogdtG/oE4NLPyKKEmVJxX3o8 IMKvWmd/NBOKWSsNgIASIj3hLL84eD5xvn05xYuLmdBa5kbvhBULnvMGhfA+7+aPpm5m ITLw== 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=aRQyDNgtYQy/qxQO3lzKRNGeGaDzzdlVSGitbFb5nv8=; b=dxtsbXuGw99mgy01u0g07Tk1VL07ccPHD101Nyi3h40I9xkC2qrvcWEF/XPBLq622n 3hvvfFsVzrMJI9vggi4WODYsM5q6CwW5Aiz+mq/Ynyf3UJRrK8+XzEyCB1gHfsG7dZQe Hj/a39RE5/98/W3t5NRedQtCYZLYRYXS1qKvcTg86qQBNPYBrXBpXugxqjKha+Qm4oNG NX4Q+/PvE3gxGvQLcYsrfLocdcJWUKR5d3jCRWbWvLx+6wSpNPLVq4Akc8pa6lyianz/ 0Kb5LnCSMg0NjPkeMK/eT3cSeWQ5lC9rLYhbLtctx60PkiGfT4t+DMnS0rw+HAYAtyDs Rzxg== X-Gm-Message-State: APjAAAUV70g2kiysn5OWwDz4dFi1FZhkTSGP334EpkFOHcwzMhx/viOr 79+JnB9arqejHwkvx0tZTgU= X-Google-Smtp-Source: APXvYqzi3fepklfWmYCUPE9GPma7gd/OKo3rPAP27DUgvPKCh4s6AbOCvS2+DuiwEh1uedblqsOMcA== X-Received: by 2002:a7b:cbcb:: with SMTP id n11mr25263588wmi.146.1564426926582; Mon, 29 Jul 2019 12:02:06 -0700 (PDT) Original-Received: from my-little-tumbleweed (71.142.13.109.rev.sfr.net. [109.13.142.71]) by smtp.gmail.com with ESMTPSA id j33sm130914762wre.42.2019.07.29.12.02.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 12:02:05 -0700 (PDT) In-Reply-To: <87imrl4ixr.fsf@web.de> (Michael Heerdegen's message of "Mon, 29 Jul 2019 05:29: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:164068 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Heerdegen writes: > I dunno if the double emphasizing in the y-n-prompt (coloring + > additional underlining with "^") is a bit too much. The patch series started out with just the coloring, which we figured might have accessibility issues on its own (we can't assume that the user can distinguish colors); we added the '^' markers to alleviate this; then=E2=80=A6 > A bit related: > Maybe the second line could be combined with the first line so that one > line is saved. (Assuming the first line you mention is "Confirm" and the second line is the command, which would make the '^' markers the third line; apologies if I misunderstood) =E2=80=A6 I realized that when the user fails to answer 'y' or 'n', y-or-n-p prepends "Please answer y or n." to the prompt, i.e. this=E2=80=A6 sed 's/?/!/' ^ =E2=80=A6 becomes this: Please answer y or n. sed 's/?/!/' ^ AFAICT, this means that we need a newline *before* the command (unless we add an optional RETRY-PROMPT argument to y-or-n-p or something). (I added comments to try to explain this in dired--no-subst-prompt; tell me if they need more work.) > I mean, the prompt is four lines high with this change, > quite a lot. Dunno what others think about it. It is fairly more heavyweight than before. And the irony is, I am still not 100% satisfied with it; I worry that the user will take "Send 1 occurrence of `*' as-is to shell?" to mean "Escape 1 occurrence of `*' so that the shell leaves it as-is?". Tell me if the shed is about to crumble under the weight of paint, but if we are fine with so many lines, could we perhaps rephrase=E2=80=A6 > Confirm > sed 's/?/!/' > ^ > Send 1 occurrence of `?' as-is to shell? =E2=80=A6 to: > Warning: the shell may interpret 1 occurrence of `?' as wildcard: > sed 's/?/!/' > ^ > Proceed anyway? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Tweak-dired-do-shell-command-warning-some-more.patch >From 97d5ec40ccbb3a2d366aaa05b45e29690ee5288a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Mon, 29 Jul 2019 20:48:53 +0200 Subject: [PATCH] Tweak dired-do-shell-command warning some more * lisp/dired-aux.el (dired--no-subst-prompt): Clarify what we are concerned about. (bug#28969, bug#35564) --- lisp/dired-aux.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 3887d75356..35052785ba 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -120,17 +120,18 @@ dired--no-subst-prompt ;; text will shove the command to the right, and the '^' markers ;; will become misaligned. (apply #'concat - `("Confirm:\n" + `(,(format-message + (ngettext + "Warning: the shell may interpret %d occurrence of `%s' as wildcard:\n" + "Warning: the shell may interpret %d occurrences of `%s' as wildcards:\n" + (length char-positions)) + (length char-positions) + (propertize (string (aref command (car char-positions))) + 'face 'warning)) ,command "\n" ,@(when add-markers (list (dired--mark-positions char-positions) "\n")) - ,(format-message - (ngettext "Send %d occurrence of `%s' as-is to shell?" - "Send %d occurrences of `%s' as-is to shell?" - (length char-positions)) - (length char-positions) - (propertize (string (aref command (car char-positions))) - 'face 'warning))))) + "Proceed anyway?"))) ;;;###autoload (defun dired-diff (file &optional switches) -- 2.22.0 --=-=-= Content-Type: text/plain (Can be applied on top of the patch series or the squashed patch; if the latter, the commit message can be discarded. Tests unchanged, since they only look at the command and the markers.) If everybody likes the prompt well enough without this umpteenth tweak, it's fine by me. Thank you all for your patience. --=-=-=--