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 21:22:46 +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; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26996"; 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 23:24:03 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 1kSRm6-0006va-UG for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Oct 2020 23:24:02 +0200 Original-Received: from localhost ([::1]:41994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSRm6-000075-07 for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Oct 2020 17:24:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSRl2-0007s6-0D for emacs-devel@gnu.org; Tue, 13 Oct 2020 17:22:56 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:51020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSRkz-0007HX-Tq; Tue, 13 Oct 2020 17:22:55 -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 09DLMnYs002677 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 13 Oct 2020 21:22:49 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 09DLMnx6007724; Tue, 13 Oct 2020 21:22:49 GMT In-Reply-To: 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:257593 Archived-At: Hi Eli, > > 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. > Please ignore the code I sent you two hours ago, and replace it with the following one: (defvar minibuffer-message-mode-line-string nil) (defvar minibuffer-message-mode-line-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) (when (bufferp minibuffer-message-mode-line-buffer) (with-current-buffer minibuffer-message-mode-line-buffer (let ((mls (and (listp mode-line-format) (assq 'minibuffer-message-mode-line-string mode-line-format)))) (if mls (setq mode-line-format (cadr (remq mls mode-line-format)))))) (setq minibuffer-message-mode-line-buffer nil)))) (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-mode-line-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 (substring-no-properties message)) (force-mode-line-update)) t)))