From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: New multi-command facility displays in the wrong echo area. Date: Tue, 13 Oct 2020 19:27:28 +0000 Message-ID: References: <20201009163445.GB4027@ACM> <20201009203810.GC4027@ACM> <83imbi609a.fsf@gnu.org> <20201010103233.GB5662@ACM> <834kn25o6b.fsf@gnu.org> <20201010124446.GC5662@ACM> <831ri65jpc.fsf@gnu.org> <83zh4u44mx.fsf@gnu.org> <83imbg4yl3.fsf@gnu.org> <837drv4ij6.fsf@gnu.org> <83mu0r3030.fsf@gnu.org> <83ft6j2wep.fsf@gnu.org> <837dru2pfz.fsf@gnu.org> Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40279"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (NEB 394 2020-01-19) Cc: acm@muc.de, juri@linkov.net, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 13 21:28:13 2020 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 1kSPy0-000AOe-My for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Oct 2020 21:28:12 +0200 Original-Received: from localhost ([::1]:49272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSPxz-0004bv-Ml for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Oct 2020 15:28:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSPxT-0004As-SP for emacs-devel@gnu.org; Tue, 13 Oct 2020 15:27:39 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:61435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSPxR-0000be-DF; Tue, 13 Oct 2020 15:27:39 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 09DJRUMW015494 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 13 Oct 2020 19:27:30 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 09DJRr2n007428; Tue, 13 Oct 2020 19:27:53 GMT In-Reply-To: <837dru2pfz.fsf@gnu.org> Received-SPF: pass client-ip=205.166.94.24; envelope-from=ghe@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/13 15:22:16 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:257569 Archived-At: Hi Eli, Thanks for your comments. >> (defvar minibuffer-message-mode-line-string nil) >> (setq minibuffer-message-clear-timeout 3) > > This seem to make the message clear automatically after a 3-sec timeout? > If so, this is also a change in behavior wrt what 'message' does: the > current behavior is to clear the message only when an input event comes > in, the timeout is optional and off by default. > Indeed, sorry, I forgot to remove that line (which I used to test the function) before sending my mail. It can of course be removed. Here is a slightly improved version of the code, which removes the (minibuffer-message-mode-line-string ...) from mode-line-format when clearing the minibuffer message. (defvar minibuffer-message-mode-line-string nil) (defvar minibuffer-message-buffer nil) (defun clear-minibuffer-message () (when (not noninteractive) (when (timerp minibuffer-message-timer) (cancel-timer minibuffer-message-timer) (setq minibuffer-message-timer nil)) (setq minibuffer-message-mode-line-string nil) (if (bufferp minibuffer-message-buffer) (with-current-buffer minibuffer-message-buffer (let ((mls (and (listp mode-line-format) (assq 'minibuffer-message-mode-line-string mode-line-format)))) (if mls (setq mode-line-format (remq mls mode-line-format)))))))) (defface minibuffer-message-face `((t (:background ,(face-attribute 'default :background) :foreground ,(face-attribute 'default :foreground)))) "") (defun set-minibuffer-message (message) (when (and (not noninteractive) (window-live-p (active-minibuffer-window)) (eq (window-frame) (window-frame (active-minibuffer-window)))) (progn (when (numberp minibuffer-message-clear-timeout) (setq minibuffer-message-timer (run-with-timer minibuffer-message-clear-timeout nil #'clear-minibuffer-message))) (with-current-buffer (window-buffer (or (window-in-direction 'above (minibuffer-window)) (minibuffer-selected-window) (get-largest-window))) (clear-minibuffer-message) (when (and mode-line-format (not (and (listp mode-line-format) (assq 'minibuffer-message-mode-line-string mode-line-format)))) (setq minibuffer-message-buffer (current-buffer)) (setq mode-line-format (list "" '(minibuffer-message-mode-line-string (" " (:propertize minibuffer-message-mode-line-string face minibuffer-message-face) " ")) mode-line-format))) (setq minibuffer-message-mode-line-string message) (force-mode-line-update)) t)))