From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Change to `use-dialog-box-p' Date: Sun, 21 May 2023 10:40:44 +0300 Message-ID: <83ttw6qghv.fsf@gnu.org> References: <87o7mf3em6.fsf.ref@yahoo.com> <87o7mf3em6.fsf@yahoo.com> <83y1ljsg03.fsf@gnu.org> <87jzx33487.fsf@yahoo.com> <83wn13s9lp.fsf@gnu.org> <877ct32yjr.fsf@yahoo.com> <83r0rbs5ki.fsf@gnu.org> <87353r2qwm.fsf@yahoo.com> <83h6s7rxcz.fsf@gnu.org> <87pm6u1pex.fsf@yahoo.com> <834jo6s06u.fsf@gnu.org> <875y8m1903.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 21 09:41:08 2023 Return-path: Envelope-to: ged-emacs-devel@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 1q0dgh-00069k-Ni for ged-emacs-devel@m.gmane-mx.org; Sun, 21 May 2023 09:41:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q0dg4-0005Ky-7B; Sun, 21 May 2023 03:40:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q0dg2-0005Ka-T0 for emacs-devel@gnu.org; Sun, 21 May 2023 03:40:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q0dg1-0005pf-CV; Sun, 21 May 2023 03:40:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/hYJ3udh8wDdmo4RXxfUP3CWoU2eg30/dxNBQU4zEOY=; b=L81NoB7yUf7E wF7Rp2Kdr4/xyhHIP95ZqTFRNHNFn+MYAhPjwMoAqCh9cEnsmcQFGvwfJizHXr+zdMbjCp2/ZZhCt XhNCdaAMZy9Fio1TX/K5kw4OvFsJSCDeE4owFbv/JpgmaW4fGELrFtGviky8iaSIbGm8DbIu27XGs qPiM5au6tbvooN8lAA2HzH6wA8D1fHM0awc8hFnx7PDL1vLJ6Nv1t5bsN/WLyEoVHk8RawTzCSapP Oy6kditPOPiyK6ueQoI56mn3KfegbL6PQAQ+cbmoBonyerq6lhKWBAvBokXAVjCBA81ec73GOGoqO WJnzlD+kINdnyWkwohX0wg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q0dg0-0002m2-SN; Sun, 21 May 2023 03:40:25 -0400 In-Reply-To: <875y8m1903.fsf@yahoo.com> (message from Po Lu on Sun, 21 May 2023 14:41:48 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306247 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Sun, 21 May 2023 14:41:48 +0800 > > Eli Zaretskii writes: > > > I guess that's only with a Yes/No dialog, and only if you press RET to > > accept the default response. But GUI dialogs can show much more than > > that, and this function is for all of them. It would be unthinkable > > for us to pop up a File Selection dialog, for example, when > > last-nonmenu-event is nil. > > Right, but then, what could lead to a file selection dialog being > displayed immediately after startup? Where's the condition "immediately after startup" in this case? This function is general-purpose. And why should a question Emacs asks after startup _always_ pop up the GUI dialog? Such behavior makes no sense at all! > > If you want to convince me to make some change, please describe how to > > distinguish between this particular case which is of interest to you > > and the other ones, when last-nonmenu-event is nil. > > How about ``if the function displaying the dialog is y-or-n-p?'' No, not good enough. We ask these questions all the time. See below for some descriptive examples. > > And even then I still don't see why we should pop up a GUI dialog in > > this situation. Once again: Emacs defaults to not showing GUI > > dialogs, it's our long-time behavior, and this situation doesn't seem > > to have any aspects that would require us to show a dialog. It is > > simply a bug that we were showing a dialog in previous versions: the > > code didn't distinguish between nil and a proper list. > > But then, why does yes-or-no-p say: > > If dialog boxes are supported, a dialog box will be used > if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. > > I would expect use-dialog-box-p to behave identically to yes-or-no-p. Is this a documentation problem? Augmenting yes-or-no-p's doc string is easy. Or do you mean that you want emacs -Q --eval "(yes-or-no-p \"What?\")" to pop up a GUI dialog? Also, please note that use-dialog-box is nowadays non-nil on TTY frames as well, so what you want will make emacs -Q -nw --eval "(yes-or-no-p \"What?\")" pop up the dialog as well. Is that reasonable behavior? Btw, use-dialog-box-p also looks at last-input-event, and only pops up a dialog box if that is non-nil. In your scenario, is last-input-event non-nil? If so, what is it, and where did it come from? > > Just get over it. > > I don't think that's the right attitude to take towards user visible > changes in behavior. It's not a "behavior", it's a bug! The behavior we will get with the change you suggest will surprise (and annoy) many more users!