unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
Date: Thu, 30 Mar 2023 20:06:04 +0000	[thread overview]
Message-ID: <e246266e9f065ee39d9b@heytings.org> (raw)
In-Reply-To: <e246266e9f5478856cdf@heytings.org>

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]


>>>> It's not perhaps the solution that would suit everyone, but I'd bet 
>>>> some users will prefer that to the way they are currently displayed. 
>>>> A third option would indeed be a kind of pop-up buffer.  And there 
>>>> are probably other options.
>>> 
>>> Popup buffer and popup frame (perhaps a child frame?) are IMO the only 
>>> viable alternatives that are worth having in Emacs.
>> 
>> A popup frame is not an option for terminal users.  A popup buffer 
>> could be an option, but if I had to choose between the two, I think I 
>> would choose the mode-line one, which is IMO less disturbing.
>
> And here is (a first draft of) the code for a popup buffer.
>

Two typos corrected.

[-- Attachment #2: popup-buffer-minibuffer-message.el --]
[-- Type: text/plain, Size: 1723 bytes --]

(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
		     (side . bottom)
		     (window-height . 1)))))
	  (with-current-buffer buffer
	    (setq-local mode-line-format nil cursor-type nil)
	    (erase-buffer)
	    (insert message)))
	t))))
(setq clear-message-function #'popup-buffer-minibuffer-message-clear)
(setq set-message-function #'popup-buffer-minibuffer-message-set)

  reply	other threads:[~2023-03-30 20:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  7:57 Is there a way to avoid clobbering minibuffer by messages? Platon Pronko
2023-03-30  8:53 ` Eli Zaretskii
2023-03-30  9:40   ` Platon Pronko
2023-03-30 10:32     ` Eli Zaretskii
2023-03-30 15:05       ` Gregory Heytings
2023-03-30 16:28         ` [External] : " Drew Adams
2023-03-30 16:35           ` Eli Zaretskii
2023-03-30 16:49             ` Drew Adams
2023-03-30 17:27               ` Eli Zaretskii
2023-03-30 17:32             ` Gregory Heytings
2023-03-30 17:51               ` Eli Zaretskii
2023-03-30 18:14                 ` John Yates
2023-03-30 18:28                   ` Eli Zaretskii
2023-03-30 20:08                     ` John Yates
2023-03-31  6:32                       ` Yuri Khan
2023-03-30 18:16                 ` Gregory Heytings
2023-03-30 18:31                   ` Eli Zaretskii
2023-03-30 19:37                     ` Sergey Organov
2023-03-30 19:45                     ` Gregory Heytings
2023-03-30 20:02                       ` Gregory Heytings
2023-03-30 20:06                         ` Gregory Heytings [this message]
2023-03-30 19:26             ` Jean Louis
2023-03-31 10:40               ` Eric S Fraga
2023-03-30 19:22           ` Jean Louis
2023-03-31  6:24         ` Platon Pronko
2023-03-31  6:58           ` Gregory Heytings
2023-03-31  7:01             ` Gregory Heytings
2023-03-31  7:10               ` Platon Pronko
2023-03-31  7:17                 ` Gregory Heytings
2023-03-31  7:45                   ` Gregory Heytings
2023-03-31 11:04                     ` John Covici
2023-03-31 11:09                       ` Gregory Heytings
2023-03-31 12:46                         ` John Covici
2023-03-30  9:52 ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e246266e9f065ee39d9b@heytings.org \
    --to=gregory@heytings.org \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).