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.devel Subject: Use of minibuffer-prompt face when minibuffer is not involved Date: Fri, 10 May 2019 20:35:39 +0200 Message-ID: <8736lmi2dg.fsf@gmail.com> 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="121530"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 10 21:57:17 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hPBds-000VVD-Tx for ged-emacs-devel@m.gmane.org; Fri, 10 May 2019 21:57:17 +0200 Original-Received: from localhost ([127.0.0.1]:49243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPBdr-0001Zb-UV for ged-emacs-devel@m.gmane.org; Fri, 10 May 2019 15:57:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPAN2-0002Wl-2U for emacs-devel@gnu.org; Fri, 10 May 2019 14:35:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPAN0-0000XZ-Og for emacs-devel@gnu.org; Fri, 10 May 2019 14:35:47 -0400 Original-Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:41193) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPAMz-0000Vq-Ds for emacs-devel@gnu.org; Fri, 10 May 2019 14:35:45 -0400 Original-Received: by mail-wr1-x430.google.com with SMTP id d12so8920926wrm.8 for ; Fri, 10 May 2019 11:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=7X3WhQ9H96LF2VT2ugW0OGj5jGUo8IAATNkhxVc8xW8=; b=s1Tkudj5cvJoliBmgA79NfZaNiwN9poFn7jWl3MTvNIyWWEcUTAbzK17iNf0McQOMe g94cveSqGNRAMxjjIt1Hu2k5G+STDqfhMxzIFs0l2hHO5AqKEMJdIJ7XRFKMiFeA+ehV llITE9sBAtaBAqxpzahAvbQHjmpkbN/5VBb46xTCOIRcCrT6s9QKZq4zZLkzgp7hYSby wKOeYEmgNlFi8J09/r0tahCHleqnKrxtVg2a898Wp8yiLH5VOKTdTdSik1+G7JGhbFOV tTiOVFhl23iYoEb+B/bAnAzMWEmXAarvYQ0HL+IdtuohTn9Ll+j2Gzx/KgOVnNxMsHYl ogKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=7X3WhQ9H96LF2VT2ugW0OGj5jGUo8IAATNkhxVc8xW8=; b=jtfs4pefpVZEluAwPi1nkO8WWa53voj4ucSAN3io4ttg0xKguU8BAgXwJjXWw6u8Po PJN8zI1A9Z/8LFi8RubfZ/UpiUnomJk6vNLkR7QyPiOCoid2Rj0LHiStAhnrP1h+wHXH 9mGGS+F/t50LLXob0OlQKUi/4s+fuxyGcjASFsFhLglxVQCOhavVkpdUUxM/S3sCA0lo HsNcfSjP7sXbarM4hMHtUPvzr1ZPf8q7ha7G6nU1P9Mctz85bs8/hjeQBm9bIfCMvDU6 vrtNIjFw8/mjJSM6InPsz0P4Y/DzK+Y8rCNAlag0F9PbM5lobqsnMKhPOD97LPwOOkCM OeVw== X-Gm-Message-State: APjAAAXzb+TRVERdlEpPZcISyoVB8cVp7D43keZe2USuzP4n4q74ugkJ IimBvCvCKy9qlEvaL58DujmaOr8H X-Google-Smtp-Source: APXvYqzPQ2zoOVl5JYL4rTkN3wiZGniQXV7g7fJ6qJK7UT+ClJMbQkrnlKOnM7sEb6gR1/CxMQfeZg== X-Received: by 2002:adf:dccf:: with SMTP id x15mr9035197wrm.139.1557513343765; Fri, 10 May 2019 11:35:43 -0700 (PDT) Original-Received: from nc10-laptop ([109.190.253.11]) by smtp.gmail.com with ESMTPSA id z74sm12593610wmc.2.2019.05.10.11.35.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 May 2019 11:35:43 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 X-Mailman-Approved-At: Fri, 10 May 2019 15:57:10 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236391 Archived-At: Hello Emacs, For some reason[1], I found myself wanting to add text properties to y-or-n-p's prompt. This is currently not possible, as the prompt's face property is hard-coded like so: (propertize (if (memq answer scroll-actions) prompt (concat "Please answer y or n. " prompt)) 'face 'minibuffer-prompt))))) An ad-hoc fix seems simple enough[2]; further discussion with Martin Rudalics and Drew Adams showed that: - there are other places where this (propertize =E2=80=A6 'face 'minibuffer-prompt) idiom is used, such as isearch prompts and read-char-choice; - these examples do not actually activate the minibuffer (AFAIU), so using the minibuffer-prompt face could be considered questionable. Considering all that, what course of action do you consider worth pursuing? 0. Do nothing. ("The face might be called minibuffer-prompt, but there are enough non-minibuffer uses of it that it's not worth fixing this inconsistency at this point.") 1. Introduce a new face named e.g. prompt, which by default would=E2=80=A6 1. =E2=80=A6 inherit minibuffer-prompt for "visual backward-compatibilit= y". 2. =E2=80=A6 differ from minibuffer-prompt to teach users the distinction between echo area and minibuffer. 2. Stop propertizing the prompt; no new face. I have no horse in this race[3]; I understand both the appeal of 0 (minimize churn and UI inconsistencies during the transition), 1.1 (configurability and smooth transition), 1.2 and 2 (consistency and pedagogy). WDYT? NB: the discussion on bug#35564 also touched on text properties with tooltips; I figured the subject of (message =E2=80=A6)'d prompts is substantial enough that tooltips could be discussed separately, but please make sure to check out Martin and Drew's thoughts on the matter if this is something you want to discuss. [1] To sum up my initial report over at bug#35564: - dired-do-shell-command's warning about "wildcard" characters annoys me, since AFAICT they may not be wildcards at all (e.g. they may be quoted or backslash-escaped). - Rather than coming up with a better warning, I toyed with text properties to build a prompt which highlights these characters. - I found out that y-or-n-p discards my prompt's text properties. [2] See patch at bug#35564#11. [3] Mainly I'd like to fix bug#35564. I assume it can be fixed whichever way this discussion goes: 1. either someone finds a better phrasing for Dired's warning, 2. or the highlighted prompt implemented in bug#35564#5 is deemed cute enough and we decide to change y-or-n-p's (propertize =E2=80=A6) into (add-face-text-property =E2=80=A6) 1. either locally in y-or-n-p, 2. or in a new function which could be re-used by read-char-choice et al., =20=20=20=20=20=20=20=20=20=20 3. or someone enlightens me as to why Dired calling these characters "wildcards" is TRT, making the bug report moot.