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: Thu, 31 Oct 2019 00:10:43 +0200 Organization: LINKOV.NET Message-ID: <875zk57sqk.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> <87pnifcdzd.fsf@mail.linkov.net> <87d0efxfxg.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="146486"; 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 23:57:39 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 1iPwuG-000bwW-63 for ged-emacs-devel@m.gmane.org; Wed, 30 Oct 2019 23:57:36 +0100 Original-Received: from localhost ([::1]:45228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPwuF-0003vs-27 for ged-emacs-devel@m.gmane.org; Wed, 30 Oct 2019 18:57:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45811) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPwsL-00026A-My for emacs-devel@gnu.org; Wed, 30 Oct 2019 18:55:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPwsK-0007V6-Lp for emacs-devel@gnu.org; Wed, 30 Oct 2019 18:55:37 -0400 Original-Received: from cheetah.birch.relay.mailchannels.net ([23.83.209.34]:2328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iPwsK-0007OR-DP for emacs-devel@gnu.org; Wed, 30 Oct 2019 18:55:36 -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 DA8E6580F87; Wed, 30 Oct 2019 22:55:34 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a39.g.dreamhost.com (100-96-8-64.trex.outbound.svc.cluster.local [100.96.8.64]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7014E580D78; Wed, 30 Oct 2019 22:55:34 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a39.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); Wed, 30 Oct 2019 22:55:34 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-White-Illustrious: 785986ca04d4442f_1572476134701_1875112974 X-MC-Loop-Signature: 1572476134701:4140160686 X-MC-Ingress-Time: 1572476134701 Original-Received: from pdx1-sub0-mail-a39.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a39.g.dreamhost.com (Postfix) with ESMTP id 1DF0682B59; Wed, 30 Oct 2019 15:55:31 -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=kCl+YuW9XsNbAVRQSEiE07TsL9Q=; b= T6Zxx/Ho/3UVpQP0aUZR5MVOR1CxOrA2S3vQleuSzwXmbPXLY+0tXdlJadGG1MLf KSaTbmnZKogQ7wLIpHTm3zTs29KCbIb76Edjhfd4oTe6GNt4HqHy4+52w95ChnQP 97gGhQoV8NWqNo/6eNZOPgY88L4mwn0g1NwqykIWMRU= 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-a39.g.dreamhost.com (Postfix) with ESMTPSA id ECB6482B63; Wed, 30 Oct 2019 15:55:27 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a39 In-Reply-To: <87d0efxfxg.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 30 Oct 2019 00:58:19 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.209.34 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:241656 Archived-At: >> '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? ")) > > Oh, nice. I guess whenever we're displaying things from an async > context, we should be using minibuffer-message? 'minibuffer-message' just calls the 'message' when used outside of the minibuffer. Maybe the dependency should be reversed so 'message' could call 'minibuffer-message' when used in the minibuffer. >> 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? ")) > > Then I'm all for your suggestion to rewrite y-or-n-p with > read-from-minibuffer... but without a history. (And yes-or-no-p too, > somehow, I guess.) (Or fix both of those functions to work the same > with respect to minibuffer-message.) Without a history is fine. There is another problem with backward-compatibility: currently 'y-or-n-p' uses 'query-replace-map' to translate input characters to y/n answers via act/skip symbols. Users customize 'query-replace-map' to map more characters to act/skip symbols, so we need to use 'query-replace-map', but not directly like (let ((prompt "Confirm? ")) (read-from-minibuffer prompt nil query-replace-map)) that obviously fails with call-interactively: (wrong-type-argument commandp act) query-replace-map needs to be translated to another keymap where the same characters from 'query-replace-map' run real commands, not intermediate symbols.