From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#52877: [External] : Re: bug#52877: 27.2; Let `use-dialog-box' apply to more than just yes/no questions Date: Mon, 17 Jan 2022 17:18:31 +0000 Message-ID: References: <87r199wc44.fsf@gnus.org> <83bl0cysh1.fsf@gnu.org> <83o84awmu7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10104"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "larsi@gnus.org" , "52877@debbugs.gnu.org" <52877@debbugs.gnu.org> To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 17 18:19:12 2022 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 1n9Vew-0002Q2-JS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jan 2022 18:19:10 +0100 Original-Received: from localhost ([::1]:49078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9Veu-0002UM-TV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jan 2022 12:19:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9Veo-0002UD-9T for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 12:19:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9Veo-0000Oo-09 for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 12:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9Ven-0006Ej-Td for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 12:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jan 2022 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52877 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 52877-submit@debbugs.gnu.org id=B52877.164243992123940 (code B ref 52877); Mon, 17 Jan 2022 17:19:01 +0000 Original-Received: (at 52877) by debbugs.gnu.org; 17 Jan 2022 17:18:41 +0000 Original-Received: from localhost ([127.0.0.1]:47817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9VeS-0006E3-NU for submit@debbugs.gnu.org; Mon, 17 Jan 2022 12:18:41 -0500 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9VeN-0006Dq-LP for 52877@debbugs.gnu.org; Mon, 17 Jan 2022 12:18:38 -0500 Original-Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20HGaj0M002150; Mon, 17 Jan 2022 17:18:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=O8Hfv4OJKMsppoc+4nxfWc6sXsEcGVl12prQVddKzak=; b=RMGCLpNqzPEpIIBWAjofWVDYtNthS7Hk9ypYj7pzVcDdHw2TIQA4aV0gJgXQWF+5Qd8p pvZnJ2akS2Y2NW2FbCcDVRyrd0HhumES/9ess2y0FPk+9mX0LBW17Ke/wkrWfH6sr8kl kbLmR9An/RA6ycloqshCgkbRa+dbvccxdhQnFLPUB5W1l2bGYaosKF45EA6CyuBnr9wd WCzGW6jPyCzNPYsH9kqFVxmDrpiXUipZhppXKY5mDJg07r3bPbO/Rir/ZhR3XG98OCg/ QPH1JH1xwUMZMHJq9vqRaI5kTfERIfscwhzx0VexfrRkL6Co5Wii+9GX2hhRll2MtqRz yw== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dnc4q02p4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 17:18:34 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20HHGJXx159894; Mon, 17 Jan 2022 17:18:34 GMT Original-Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by aserp3020.oracle.com with ESMTP id 3dkp3342u8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 17:18:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ELNKVVqc+PV+6Ko9lGu0UEiE96cDQzc79yTDSKRKCqYRKAyK25PW0a0KVMtIlZn6txUOM6lSaA6CAwEAuVwB3P0R5ylZ2XP/0ZUQpxAsCAMEfxVdlFP/gMMyzdzcMDGd8wlihnwQUidOr3+gtBYiCGl/4bf9kxNvtBUjpLzp5nVtdfzmpSHnElho6zhfoTxDOY2fJBnpVaovqAID/e+AhH0bQQXBOHWMs+lmTS9yEZgoXU4IblgRmVyMljNqGfnPbe0grJngXnhgQqsIx82UI+fLG6LdiPtmsoWvFSixA9yHuxlJCBwJ/h413odBmBaOXOZDyLFZWCPGY1w+hWvxOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O8Hfv4OJKMsppoc+4nxfWc6sXsEcGVl12prQVddKzak=; b=Z0p+quZYusweuhV2J4bKAB0u/kQlZ8uNthD0Ycd6j77Z7EZr/GGdc9XpQ0BhAmALZs4PASCAnLMSoJhxdFTn84wSpVP9NpqhNg7qN8bd+NREY3Won5/kWmfEzSXTgxqoBh3YsLds5+lUBf7PmpeZjLCgwL18V+1ekb9qIL88qsxGIYyQGEOnWrCivuZyDZ4aFEbeKNwvqSC1sdoBdFhnLIkPKujspsBDIEBWRTGsXckPtNG/7FyBSSxzmUuash3xqNLrj72VZ3I1PeklDdtMtAGkJPoNdFX2VjS52JovO7lFCO3fWic10sitFb8EFmm2f5yUukUSmweyD2Ut0VhoFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O8Hfv4OJKMsppoc+4nxfWc6sXsEcGVl12prQVddKzak=; b=CFIxVlvFlBkyxSLyB0VOjBDzsjZhWDEUDfxEfwS9LbgdY9JJP3qHW2BSoAhyRWTRfggckYmiCwDIFzSD0SP//hFBmq2DgnmcrYWsBbgkqzgszCKtp1aYKhSjbOfvzAI6WH9CeoVA0/hyNLlEDjg8OUj8YRS2gW1jtuoVEnmLJKg= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BN6PR10MB1283.namprd10.prod.outlook.com (2603:10b6:404:45::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Mon, 17 Jan 2022 17:18:31 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::99a4:696f:5f30:36b3]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::99a4:696f:5f30:36b3%7]) with mapi id 15.20.4888.014; Mon, 17 Jan 2022 17:18:31 +0000 Thread-Topic: bug#52877: [External] : Re: bug#52877: 27.2; Let `use-dialog-box' apply to more than just yes/no questions Thread-Index: Adf83BGvgz7Hu9fcTX2mlrN80W/EjwOxHGxoAAgYslA= In-Reply-To: <83o84awmu7.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd698600-9b8e-4ccd-c123-08d9d9dd62bd x-ms-traffictypediagnostic: BN6PR10MB1283:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Qcju7q9ckf0MDXUa8qGO4gKM4cAqQqWVAn8ukGnlhfZQnH0qTtP7mt/QS05f4Irr7A8mUCnLFQG/hTnK6RmpOqm8jDIaDNpBBo/alXZNf+3ZakIDkw1sRHR+GBuFvaNtT2CooNEFxAVcARtxvjiZlJ2yzcuu2r2X30dHaFEtYayLd9br5NcR0nDUS2VuQOYyLRZ7L3MO2wFznC2KT/dJoenVFuARuZrPYKziln+bQdHmiM4Sx5qI93z4r5pAsWnageoAbaWmDxDrcyblUlBPZCdLh8nEQm05TM+0lt57khL86QbEFnJadqEhwM9TldWC/BbK+ku8brG9wiCVFuDSiJ0PwWtS+gU9xDc2yFY+/ET9MmUha0upRk9z9zpbBkRMV1hWkKiRLF13XnwgcsCE/h//W5KaCV8sEK/9Jo9jOwNPkgfUenARLUVUKRwre0iVhFF0v5geDS8EPLs+3p20ZPNytfw7J+3YdRJG+jQolCKs9CIezFubQN07TV4kHkpputcJf9OaNL1wilaY3OjyAE4ppPFawsgxFv96UH4cVQkWpaJamJ/p88F0n/ASf2MXZYOIK6AC/Qkej9nur3y9tZW7vfMFOJPCQwGQvI7fVFoh2C5mjgA4J+f+h0s/W2l45b91DegY7z5sUpan813+J4U5XTZppy8UVvY2n5cRszq6aXz4tMKU1jtlJDYG/uwO7xzGkYLcAaQAy2aTXW160rp2hsrAuuWQkrP2mq4ZS6U= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(508600001)(33656002)(122000001)(8936002)(6506007)(8676002)(4326008)(86362001)(26005)(66556008)(66946007)(64756008)(5660300002)(71200400001)(66446008)(7696005)(186003)(38070700005)(76116006)(83380400001)(55016003)(316002)(54906003)(38100700002)(2906002)(9686003)(6916009)(52536014)(66476007)(44832011)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: CqWR4ZTAbAlDUu9ALx34ozUR3gIoGiD0lQ1nC6+50j0+G46QdwlKUMZmz1ArZYcP7LUMPcZCRAf5IYsTf7v6KgKQBEhxJlToyJvbtfqaCpLjfXB04MQ9nUulqMfo/wjZ6uT/RndvLwMUoSeGmrAaYLi0Cnmy2yA4ZkBlxjJEKyo8PXlF0QLixJZEIXYjoZJutk7pIe/9ufRqfHVXiIOaD60aPTNqE+r85YP45l/Ek8mV+DnPktWiT5LPqzfsCnxvh6Rus3c+dHKQqSWE3PstdKzeLF1n8s7k7UnD8EsL+znaJrjmaQ2H2jVht2uwVkcPKlKJsP/tGvE7rRVKy0+RnWQKVov7OHGMA++tG+alpEoRX4DPTsiQbc0iWdvFgmTFoYhlz+Hlbc8ynMvWvCNZtwO79T9ixd0Jsjv3DOIy3+w/o1oT0UXdhXoJ91om79OvIWp3Jlq0SSWVDZSMnc/G4m8kaX9JEvWJRbjE1awiNCg2NESwLYv8nSrNmyXIWcc4JGV3RoHYQ+xmoEgMlcN1sbNu5CUvIVErGR5idz5JGtv0TJQvFocDq058NFHS/4w4nlf8NawTdbB/OGCmLrzfdd2fUrFgDajvZwZFL8Z1r+5W0MDdUrk+H3JROqtjx5ZSvkYgEGwtNZqAUUZKmhTWBDLVJwgaH6VreLReNzgAABwM2sGnK++8AmKeteoSLjlzpRA5xw+No0mzpGI4ewyXEzW+DGJ0a5vdpqBnE40tmDo+Ofd/kK1g9SR680 L91s7pG2GiYJEOGkqN8Seoc2Oq8lzT0F3uPxB7gUp+CvUftLsrVn6KLo5byjHypom2XuK7ane3g8v6h+fzGf7X/shyT/d1ueZ6 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd698600-9b8e-4ccd-c123-08d9d9dd62bd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2022 17:18:31.5988 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Kd4nCKR0hT2LBoWbFQvqUd0TRmICidPJr+KvPZ8GhqsZ3mB4uj3Kh2xqgRriwNzJaApPpyzpeBIvXSwOwYxJLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1283 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10230 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170108 X-Proofpoint-GUID: 4uGh-rCpxo66WRC-_DRZ3ESGlEI2FqI8 X-Proofpoint-ORIG-GUID: 4uGh-rCpxo66WRC-_DRZ3ESGlEI2FqI8 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" Xref: news.gmane.io gmane.emacs.bugs:224459 Archived-At: > > 2. This is a general request, to do what's suggested > > for at least some commands that prompt for input > > other than yes/no or y/n: > > > > When the system provides a dialog box for choosing > > the input, let the command test `use-dialog-box', > > and use that dialog box when that var is non-nil, > > but use minibuffer input otherwise. > > > > Do this when it makes sense for a given command. > > If it truly makes no sense for some particular > > command - e.g., there's no way to get the required > > input except by using a dialog box - then don't > > try to do it for that command. >=20 > We already do that. IMNSHO, it doesn't make sense > in this particular case. "We already do that." Really? Please point to examples of commands that use `use-dialog-box' and prompt for input other than yes-no. And if that's really the case, then please correct the doc of `use-dialog-box', which says "This applies to `y-or-n-p' and `yes-or-no-p' questions asked by commands invoked by mouse clicks and mouse menu items." The two corrections would be (1) remove mention of yes-no, or add "including" or "for example", to make clear that use only _includes_ those 2 explicitly mentioned use cases and is not limited to them, and (2) clarify that the commands it applies to are commands that "can" be invoked with the mouse. > > (defun set-frame-font-all (font) > > "Set the default font to FONT on all existing and future frames. > > \(This is `set-frame-font' with `t' as argument FRAMES.)" > > (interactive > > (let* ((completion-ignore-case t) > > (font (completing-read > > "Font name: " > > (x-list-fonts "*" nil (selected-frame)) >=20 > It is wrong to use (x-list-fonts "*" ...) to produce the collection > of fonts suitable for Emacs. "Wrong", meaning what, exactly? I don't see how it's wrong in the sense of not being able to produce a collection of fonts suitable for Emacs - it can certainly do that. Perhaps you mean that it won't necessarily produce a collection that includes _all_ such fonts? Or perhaps you mean that it can also include fonts that are unsuitable for Emacs? Please specify what you mean. If there are any such qualifications they can be called out in the doc string of the command, to make users aware that, when `use-dialog-box' is nil the set of candidate fonts is limited in whatever particular way. Such qualification doesn't at all make the command useless. I've used this for years, to provide a set of font completion candidates: (let ((fonts (make-hash-table :test #'equal)) (fontset-lst (fontset-list))) (setq fontset-lst (delete "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default" fontset-lst)) (dolist (ft (append fontset-lst (x-list-fonts "*")) fonts) (puthash ft t fonts))) Doing better need not be held hostage to a demand for perfection. > Yes, I know: you said it's just an example. But providing an easy > example that cannot be extended to the Real Thing doesn't help us make > any progress of practical value. Whether you're interested in providing a command that sets the font using either a dialog box or keyboard input is irrelevant to this enhancement request. As is also any criticism of the code I presented as an illustration. Nothing about the enhancement request prevents looking for cases where `use-dialog-box' could reasonably be used to provide input to a command by both menu/mouse and keyboard. > > The point is more general than `menu-set-font'. The > > point is that there's no good reason to limit the > > use of `use-dialog-box' to yes-no questions. >=20 > That we already do. Examples? And see above - if "we already do" then please fix the doc string accordingly (in addition to providing some such examples here). ___ FYI - This font-choosing example came from the real world. When presented with the possibility of using keyboard input with completion to match menu items (with their paths through the menu forest), a user pointed out that although it made it possible to choose menu items with the keyboard, once an item such as setting the font is chosen you have to switch to the mouse anyway, to use the dialog box. In general, you shouldn't have to. In general, `use-dialog-box' nil should allow for minibuffer input instead. By "in general", here, I don't mean "always". At least sometimes, and likely often, it should be possible and reasonable to provide for minibuffer input as an alternative to using a dialog box. Whether we decide to do that in any particular case is a different question. The point is that it would be good to extend the use of `use-dialog-box' beyond yes-no questions.