From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Strange use of (run-with-timer 0 nil #'foo args) in do-after-load-evaluation Date: Wed, 30 Oct 2019 01:45:58 +0200 Organization: LINKOV.NET Message-ID: <87pnifcdzd.fsf@mail.linkov.net> References: <20191026101407.GA17424@ACM> <87o8y3d4ur.fsf@gnus.org> <87mudl3l83.fsf@mail.linkov.net> <87v9s9b12x.fsf@gnus.org> <87ftjctsx5.fsf@mail.linkov.net> <87k18n233r.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="7891"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Alan Mackenzie , Stefan Monnier , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 30 00:53:36 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPbIu-0001tn-2j for ged-emacs-devel@m.gmane.org; Wed, 30 Oct 2019 00:53:36 +0100 Original-Received: from localhost ([::1]:35256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPbIs-0001m0-CB for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2019 19:53:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53382) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPbHZ-0001NC-MN for emacs-devel@gnu.org; Tue, 29 Oct 2019 19:52:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPbHX-0006PV-I3 for emacs-devel@gnu.org; Tue, 29 Oct 2019 19:52:13 -0400 Original-Received: from blue.elm.relay.mailchannels.net ([23.83.212.20]:22292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iPbHV-0006HE-Bi for emacs-devel@gnu.org; Tue, 29 Oct 2019 19:52:11 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 44C4D5A02B2; Tue, 29 Oct 2019 23:52:06 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (100-96-38-238.trex.outbound.svc.cluster.local [100.96.38.238]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id C81695A0327; Tue, 29 Oct 2019 23:52:05 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Tue, 29 Oct 2019 23:52:06 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Quick-Spot: 64a4d06f7b037703_1572393126054_7891396 X-MC-Loop-Signature: 1572393126054:40075525 X-MC-Ingress-Time: 1572393126053 Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id CF02C817F4; Tue, 29 Oct 2019 16:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=PAoodkpLhjNtYrDsw6A1BiPADcM=; b= qlsm1jjJzgqUF0jT30z6cyxRsAtCXES9fZ6M0623Tv/UXC/wnLA7vBWCfpHNqDN1 9PB0r9wbl5w1lzbYzwu9QJA1KcTnVJEdvJMKNGPy9ZI8M8cpDmYcEfcV+TwkuX3x jABagUsZJxx9v26O0NwWRn/cgyVlVgrztkG7nh86YnQ= Original-Received: from mail.jurta.org (m91-129-101-77.cust.tele2.ee [91.129.101.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTPSA id CE1C881801; Tue, 29 Oct 2019 16:51:56 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a3 In-Reply-To: <87k18n233r.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 29 Oct 2019 12:38:48 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:241612 Archived-At: >> An asynchronous message doesn't hide the minibuffer. It's displayed >> at the end of the minibuffer text. > > The original bug report was about: > > (progn > (run-at-time 2 nil (lambda () (message "foo"))) > (y-or-n-p "Yes? ")) > > But this seems to have the same problem? > > (progn > (run-at-time 2 nil (lambda () (message "foo"))) > (read-from-minibuffer "Yes? ")) > > When I eval that, "foo" completely hides the prompt -- it's not appended > or reasserted. 'message' can be easily replaced with 'minibuffer-message', then it doesn't obscure the minibuffer: (progn (run-at-time 2 nil (lambda () (minibuffer-message "foo"))) (read-from-minibuffer "Yes? ")) Whereas it obscures the prompt in y-or-n-p: (progn (run-at-time 2 nil (lambda () (minibuffer-message "foo"))) (y-or-n-p "Yes? ")) >>> I think having a history for y-or-n-p doesn't sound very useful? >>> Hitting `M-p' doesn't to get to the previous answer just sounds >>> confusing to me. >> >> Please try the example I sent earlier. It feels quite naturally >> typing 'M-p RET' to repeat a previous y/n answer. > > I played with it a bit, and I'm not very enthusiastic about that. Like > Stefan K says, it seems error-prone, and I think it would just create > frustration. And it's a bigger change in the interface than it first > sounds like -- people may be used to hitting as a way to reassert > the prompt, for instance. In case of doubt, we could add a new function read-y-or-n-p, not to replace the implementation of the existing y-or-n-p. Then like many users already put in init files: (fset 'yes-or-no-p 'y-or-n-p) it will be possible to put: (fset 'yes-or-no-p 'read-y-or-n-p) (fset 'y-or-n-p 'read-y-or-n-p) And when it will prove to work better than the current y-or-n-p, maybe after the next release the implementation of y-or-n-p could be switched to read-y-or-n-p later.