help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to avoid clobbering minibuffer by messages?


From: John Covici
Subject: Re: Is there a way to avoid clobbering minibuffer by messages?
Date: Fri, 31 Mar 2023 07:04:19 -0400
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Would this work if I am using a virtual console -- in that case there
would be no frame or anything like that?

On Fri, 31 Mar 2023 03:45:09 -0400,
Gregory Heytings wrote:
> 
> [1  <text/plain; us-ascii (7bit)>]
> 
> >> I think of modeline as something buffer-specific, so I don't
> >> want to put global messages there.
> > 
> > In that case you can try the other file I posted, with which
> > messages are displayed in a popup buffer.
> > 
> 
> Here it is again, with a few corrections.  Again messages are
> displayed in a popup buffer only when the minibuffer is active.
> [2 popup-buffer-minibuffer-message.el <text/plain; us-ascii (base64)>]
> (defvar popup-buffer-minibuffer-message-window nil)
> (defvar popup-buffer-minibuffer-message-timer nil)
> (defun popup-buffer-minibuffer-message-clear ()
>   (when (not noninteractive)
>     (when (timerp minibuffer-message-timer)
>       (cancel-timer popup-buffer-minibuffer-message-timer)
>       (when (window-live-p popup-buffer-minibuffer-message-window)
>       (delete-window popup-buffer-minibuffer-message-window)))))
> (defun popup-buffer-minibuffer-message-set (message)
>   (let* ((minibuf-window (active-minibuffer-window))
>          (minibuf-frame (and (window-live-p minibuf-window)
>                              (window-frame minibuf-window))))
>     (when (and (not noninteractive)
>                (window-live-p minibuf-window)
>                (or (eq (window-frame) minibuf-frame)
>                    (eq (frame-parameter minibuf-frame 'minibuffer) 'only)))
>       (progn
>         (when (numberp minibuffer-message-clear-timeout)
>           (setq popup-buffer-minibuffer-message-timer
>                 (run-with-timer minibuffer-message-clear-timeout nil
>                                 #'popup-buffer-minibuffer-message-clear)))
>       (let ((buffer (get-buffer-create " *Popup Echo Area*")))
>         (unless (window-live-p popup-buffer-minibuffer-message-window)
>           (setq popup-buffer-minibuffer-message-window
>                 (display-buffer
>                  buffer
>                  '(display-buffer-in-side-window (window-height . 1)))))
>         (with-current-buffer buffer
>           (setq-local mode-line-format nil cursor-type nil)
>           (erase-buffer)
>           (insert message))
>         (fit-window-to-buffer popup-buffer-minibuffer-message-window
>                               10 1))
>       t))))
> (setq clear-message-function #'popup-buffer-minibuffer-message-clear)
> (setq set-message-function #'popup-buffer-minibuffer-message-set)

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         covici@ccs.covici.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]