all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is there a way to avoid clobbering minibuffer by messages?
@ 2023-03-30  7:57 Platon Pronko
  2023-03-30  8:53 ` Eli Zaretskii
  2023-03-30  9:52 ` Gregory Heytings
  0 siblings, 2 replies; 34+ messages in thread
From: Platon Pronko @ 2023-03-30  7:57 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!

I use ivy and tramp, and I often notice that tramp messages are output to minibuffer while I'm in the process of connecting to the host, which breaks formatting of the minibuffer. I also noticed messages messing up minibuffer contents on many other occasions.

Is there a way to put messages somewhere else? Or maybe the other way around - keep messages in minibuffer, but use ivy in some other minibuffer?

--
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  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  9:52 ` Gregory Heytings
  1 sibling, 1 reply; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30  8:53 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 30 Mar 2023 15:57:15 +0800
> From: Platon Pronko <platon7pronko@gmail.com>
> 
> I use ivy and tramp, and I often notice that tramp messages are output to minibuffer while I'm in the process of connecting to the host, which breaks formatting of the minibuffer. I also noticed messages messing up minibuffer contents on many other occasions.
> 
> Is there a way to put messages somewhere else? Or maybe the other way around - keep messages in minibuffer, but use ivy in some other minibuffer?

What Emacs version is that?  Emacs 28 changed how echo-area messages
are displayed when the minibuffer is active, so if you are using an
older Emacs, maybe upgrading will fix the problem for you.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30  8:53 ` Eli Zaretskii
@ 2023-03-30  9:40   ` Platon Pronko
  2023-03-30 10:32     ` Eli Zaretskii
  0 siblings, 1 reply; 34+ messages in thread
From: Platon Pronko @ 2023-03-30  9:40 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On 2023-03-30 17:35, Eli Zaretskii wrote:
>> Date: Thu, 30 Mar 2023 17:02:58 +0800
>> From: Platon Pronko <platon7pronko@gmail.com>
>>
>> What was supposed to change in Emacs 28?
> 
> The echo-area messages are now displayed without overwriting the
> minibuffer contents.

Yes, they are not overwriting - they are appended to the minibuffer contents, which is often ugly and looks like something got broken (less broken than when it directly overwrote the buffer, of course).

-- 
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  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:52 ` Gregory Heytings
  1 sibling, 0 replies; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30  9:52 UTC (permalink / raw)
  To: Platon Pronko; +Cc: help-gnu-emacs


>
> I use ivy and tramp, and I often notice that tramp messages are output 
> to minibuffer while I'm in the process of connecting to the host, which 
> breaks formatting of the minibuffer. I also noticed messages messing up 
> minibuffer contents on many other occasions.
>
> Is there a way to put messages somewhere else? Or maybe the other way 
> around - keep messages in minibuffer, but use ivy in some other 
> minibuffer?
>

You can display these messages whereever you want by defining your own 
variant of set-minibuffer-message and doing (setq set-message-function 
'my-set-minibuffer-message).




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30  9:40   ` Platon Pronko
@ 2023-03-30 10:32     ` Eli Zaretskii
  2023-03-30 15:05       ` Gregory Heytings
  0 siblings, 1 reply; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30 10:32 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 30 Mar 2023 17:40:40 +0800
> From: Platon Pronko <platon7pronko@gmail.com>
> 
> On 2023-03-30 17:35, Eli Zaretskii wrote:
> >> Date: Thu, 30 Mar 2023 17:02:58 +0800
> >> From: Platon Pronko <platon7pronko@gmail.com>
> >>
> >> What was supposed to change in Emacs 28?
> > 
> > The echo-area messages are now displayed without overwriting the
> > minibuffer contents.
> 
> Yes, they are not overwriting - they are appended to the minibuffer contents, which is often ugly and looks like something got broken (less broken than when it directly overwrote the buffer, of course).

If that is what you see, then it's the intended behavior.  That you
are not used to it doesn't mean it's incorrect or broken.
Functionally, it does the job, and we don't have any better
alternatives for the case when a message should be shown when the
minibuffer is active.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 10:32     ` Eli Zaretskii
@ 2023-03-30 15:05       ` Gregory Heytings
  2023-03-30 16:28         ` [External] : " Drew Adams
  2023-03-31  6:24         ` Platon Pronko
  0 siblings, 2 replies; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30 15:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

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


>
> If that is what you see, then it's the intended behavior.  That you are 
> not used to it doesn't mean it's incorrect or broken. Functionally, it 
> does the job, and we don't have any better alternatives for the case 
> when a message should be shown when the minibuffer is active.
>

It's true that we don't have any better _built-in_ alternatives, but I 
think what the OP wants is something like the code in the attached file.

[-- Attachment #2: mode-line-minibuffer-message.el --]
[-- Type: text/plain, Size: 2594 bytes --]

(defface mode-line-minibuffer-message-face
  `((t (:background ,(face-attribute 'default :background))))
  "")
(defvar-local mode-line-minibuffer-message-string nil)
(defvar mode-line-minibuffer-message-buffer nil)
(defvar mode-line-minibuffer-message-timer nil)
(defun mode-line-minibuffer-message-clear ()
  (when (not noninteractive)
    (when (timerp minibuffer-message-timer)
      (cancel-timer mode-line-minibuffer-message-timer)
      (setq mode-line-minibuffer-message-timer nil))
    (when (buffer-live-p mode-line-minibuffer-message-buffer)
      (with-current-buffer mode-line-minibuffer-message-buffer
	(setq mode-line-minibuffer-message-string nil)
	(force-mode-line-update)))))
(defun mode-line-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 mode-line-minibuffer-message-timer
                (run-with-timer minibuffer-message-clear-timeout nil
                                #'mode-line-minibuffer-message-clear)))
        (with-current-buffer
            (window-buffer
             (or (window-in-direction 'above minibuf-window)
                 (minibuffer-selected-window)
                 (get-largest-window)))
          (mode-line-minibuffer-message-clear)
          (setq mode-line-minibuffer-message-buffer (current-buffer))
          (when (and mode-line-format
                     (not (and (listp mode-line-format)
                               (assq 'mode-line-minibuffer-message-string
                                     mode-line-format))))
            (setq mode-line-format
                  (list '(mode-line-minibuffer-message-string
                          (:eval mode-line-minibuffer-message-string))
                        mode-line-format)))
	  (setq mode-line-minibuffer-message-string message)
	  (add-face-text-property 0 (length mode-line-minibuffer-message-string)
				  'mode-line-minibuffer-message-face t
				  mode-line-minibuffer-message-string)
          (force-mode-line-update))
        t))))
(setq clear-message-function #'mode-line-minibuffer-message-clear)
(setq set-message-function #'mode-line-minibuffer-message-set)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* RE: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 15:05       ` Gregory Heytings
@ 2023-03-30 16:28         ` Drew Adams
  2023-03-30 16:35           ` Eli Zaretskii
  2023-03-30 19:22           ` Jean Louis
  2023-03-31  6:24         ` Platon Pronko
  1 sibling, 2 replies; 34+ messages in thread
From: Drew Adams @ 2023-03-30 16:28 UTC (permalink / raw)
  To: Gregory Heytings, Eli Zaretskii; +Cc: help-gnu-emacs@gnu.org

> > If that is what you see, then it's the intended behavior.  That you are
> > not used to it doesn't mean it's incorrect or broken. Functionally, it
> > does the job, and we don't have any better alternatives for the case
> > when a message should be shown when the minibuffer is active.
> 
> It's true that we don't have any better _built-in_ alternatives, but I
> think what the OP wants is something like the code in the attached file.

FWIW, maybe it's time to add an _option_ to separate
the echo-area real estate from that of the minibuffer.

E.g., optionally use separate windows (or standalone
frames) for them.

____

Personally, I'm not a fan of the change introduced
in Emacs 28 (with no way to opt-out, IIUC).

IIUC, the problem it tries to fix (work around) is
the display of msgs that arrive during minibuffer
input (in particular from async processes).  Yes,
that's a real problem (which we've lived with for
decades).

The Emacs 28 "solution" substitutes (1) showing
the output (a message in [...] brackets) in the
minibuffer (an input area), at the _same time_ as
showing the input there, for (2) the longstanding
behavior of temporarily overwriting that shared
screen area, that is, momentarily showing the echo
area _instead of_ the minibuffer.

Arguably, at least for some users (I'm one), the
Emacs 28+ cure is worse than the traditional
disease.  It's not that I think the cure shouldn't
be available; I just think it should be optional -
one possible choice.

A better solution would be to let users choose to
substitute having ~persistently separate display
spaces for input and output.

That is, instead of both (1) the pre-28 behavior
of temporarily swapping what's shown in that
screen space shared between the minibuffer (for
input) and the echo area (for output), and (2)
the 28+ behavior of showing both input & output
in the same space at the same time.

IOW, _no space sharing_: be able to cut the cord
and separate the input and output screen spaces.

Further options could be added for _how_ to show
the output (messages): whether to dedicate a
window or just pop up a window, etc.

But the main thing would be to offer a choice to
just stop sharing screen real estate between
minibuffer (input) and echo area (output).

Why not let users choose among several behaviors?

 1. Emacs 28+ approach: message and input in
    minibuffer at the same time.

 2. Traditional approach: echo area displayed
    temporarily, in place of the minibuffer.

 3. Minibuffer and echo area shown separately,
    in different places?

And offer various choices for #3: how to show
the echo area.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 16:28         ` [External] : " Drew Adams
@ 2023-03-30 16:35           ` Eli Zaretskii
  2023-03-30 16:49             ` Drew Adams
                               ` (2 more replies)
  2023-03-30 19:22           ` Jean Louis
  1 sibling, 3 replies; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30 16:35 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Drew Adams <drew.adams@oracle.com>
> CC: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> Date: Thu, 30 Mar 2023 16:28:16 +0000
> 
> Why not let users choose among several behaviors?
> 
>  1. Emacs 28+ approach: message and input in
>     minibuffer at the same time.
> 
>  2. Traditional approach: echo area displayed
>     temporarily, in place of the minibuffer.
> 
>  3. Minibuffer and echo area shown separately,
>     in different places?
> 
> And offer various choices for #3: how to show
> the echo area.

Users can already choose between 1 and 2: see set-message-function.

As for the other alternatives: no one wrote the code to implement
them; patches welcome.  (Of course, they all can be implemented via
set-message-function.)



^ permalink raw reply	[flat|nested] 34+ messages in thread

* RE: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  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 19:26             ` Jean Louis
  2 siblings, 1 reply; 34+ messages in thread
From: Drew Adams @ 2023-03-30 16:49 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs@gnu.org



> -----Original Message-----
> From: help-gnu-emacs-bounces+drew.adams=oracle.com@gnu.org <help-gnu-
> emacs-bounces+drew.adams=oracle.com@gnu.org> On Behalf Of Eli Zaretskii
> Sent: Thursday, March 30, 2023 9:35 AM
> To: help-gnu-emacs@gnu.org
> Subject: Re: [External] : Re: Is there a way to avoid clobbering
> minibuffer by messages?
> 
> > From: Drew Adams <drew.adams@oracle.com>
> > CC: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> > Date: Thu, 30 Mar 2023 16:28:16 +0000
> >
> > Why not let users choose among several behaviors?
> >
> >  1. Emacs 28+ approach: message and input in
> >     minibuffer at the same time.
> >
> >  2. Traditional approach: echo area displayed
> >     temporarily, in place of the minibuffer.
> >
> >  3. Minibuffer and echo area shown separately,
> >     in different places?
> >
> > And offer various choices for #3: how to show
> > the echo area.
> 
> Users can already choose between 1 and 2: see set-message-function.

Good!  Sorry, I missed that; thank you.

I used menu-bar `Options > Customize Emacs >
New Options', and I searched for "minibuffer" and
"echo area", but didn't find any option for this.

Searching now for `set-message-function' I don't
see it listed either - it's a defvar, not a user
option.

Seems like this doesn't make it easy for users
to discover how to restore the pre-28 behavior,
or even let them do that easily, if they do
somehow manage to discover that variable.

> As for the other alternatives: no one wrote the code to implement
> them; patches welcome.  (Of course, they all can be implemented via
> set-message-function.)

Yes, a user can write code to implement
`set-message-function' to do <whatever>.  But
it would be good for Emacs to offer some OOTB
choices.

I understand that volunteers would be needed
to implement such things.  But it's unfortunate
that the Emacs 28 change wasn't accompanied by
some easy way for a user to revert that change,
getting back the pre-28 behavior.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 16:49             ` Drew Adams
@ 2023-03-30 17:27               ` Eli Zaretskii
  0 siblings, 0 replies; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30 17:27 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Drew Adams <drew.adams@oracle.com>
> Date: Thu, 30 Mar 2023 16:49:53 +0000
> 
> But it's unfortunate
> that the Emacs 28 change wasn't accompanied by
> some easy way for a user to revert that change,
> getting back the pre-28 behavior.

How hard is it to set a single variable to nil?



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 16:35           ` Eli Zaretskii
  2023-03-30 16:49             ` Drew Adams
@ 2023-03-30 17:32             ` Gregory Heytings
  2023-03-30 17:51               ` Eli Zaretskii
  2023-03-30 19:26             ` Jean Louis
  2 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30 17:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


>
> As for the other alternatives: no one wrote the code to implement them; 
> patches welcome.
>

No one?  Did you look at the code two messages above?




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  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:16                 ` Gregory Heytings
  0 siblings, 2 replies; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30 17:51 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 30 Mar 2023 17:32:27 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: help-gnu-emacs@gnu.org
> 
> > As for the other alternatives: no one wrote the code to implement them; 
> > patches welcome.
> 
> No one?  Did you look at the code two messages above?

Is that part of Emacs?

And I thought Drew wanted echo-area messages to pop in a separate
buffer.  The mode line is not a good place for showing messages,
IMNSHO.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 17:51               ` Eli Zaretskii
@ 2023-03-30 18:14                 ` John Yates
  2023-03-30 18:28                   ` Eli Zaretskii
  2023-03-30 18:16                 ` Gregory Heytings
  1 sibling, 1 reply; 34+ messages in thread
From: John Yates @ 2023-03-30 18:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Thu, Mar 30, 2023 at 1:51 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> And I thought Drew wanted echo-area messages to pop in a separate
> buffer.

Definitely not a fully general solution, but...

On my 4K monitors, using a moderately small font, splitting the one line
minibuffer into two columns, input and echo area, seems attractive to me.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 17:51               ` Eli Zaretskii
  2023-03-30 18:14                 ` John Yates
@ 2023-03-30 18:16                 ` Gregory Heytings
  2023-03-30 18:31                   ` Eli Zaretskii
  1 sibling, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30 18:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


>>> As for the other alternatives: no one wrote the code to implement 
>>> them; patches welcome.
>>
>> No one?  Did you look at the code two messages above?
>
> Is that part of Emacs?
>

No, but it could, it's a (kind of) patch.

>
> And I thought Drew wanted echo-area messages to pop in a separate 
> buffer.  The mode line is not a good place for showing messages, IMNSHO.
>

Hmmm... why not?  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.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 18:14                 ` John Yates
@ 2023-03-30 18:28                   ` Eli Zaretskii
  2023-03-30 20:08                     ` John Yates
  0 siblings, 1 reply; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30 18:28 UTC (permalink / raw)
  To: help-gnu-emacs

> From: John Yates <john@yates-sheets.org>
> Date: Thu, 30 Mar 2023 14:14:36 -0400
> Cc: help-gnu-emacs@gnu.org
> 
> On my 4K monitors, using a moderately small font, splitting the one line
> minibuffer into two columns, input and echo area, seems attractive to me.

Split how?  The Emacs display engine doesn't support column-wise
display that you are describing, it can only do that if the
mini-window is split into two side-by-side windows, but that will run
afoul of many assumptions everywhere that there's at most only one
min-window per frame.

So I'm not sure I understand the idea of your proposal.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  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
  0 siblings, 2 replies; 34+ messages in thread
From: Eli Zaretskii @ 2023-03-30 18:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 30 Mar 2023 18:16:22 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: help-gnu-emacs@gnu.org
> 
> > And I thought Drew wanted echo-area messages to pop in a separate 
> > buffer.  The mode line is not a good place for showing messages, IMNSHO.
> 
> Hmmm... why not?

Not enough screen estate, and cannot be enlarged to show more than one
screen line.  You cannot base a general-purpose feature such as
echo-area messages on the assumption that the message will never need
more than one screen line.

> 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.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 16:28         ` [External] : " Drew Adams
  2023-03-30 16:35           ` Eli Zaretskii
@ 2023-03-30 19:22           ` Jean Louis
  1 sibling, 0 replies; 34+ messages in thread
From: Jean Louis @ 2023-03-30 19:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: Gregory Heytings, Eli Zaretskii, help-gnu-emacs@gnu.org


I would like to be able to see those echo messages in the middle of
text area, and not as widget, just something like this:


      ╔═════════════╗
      ║ Hello there ║
      ╚═════════════╝

The bottom line is not really visible for messages. And desktop
notification could be also turned on for those messages.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 16:35           ` Eli Zaretskii
  2023-03-30 16:49             ` Drew Adams
  2023-03-30 17:32             ` Gregory Heytings
@ 2023-03-30 19:26             ` Jean Louis
  2023-03-31 10:40               ` Eric S Fraga
  2 siblings, 1 reply; 34+ messages in thread
From: Jean Louis @ 2023-03-30 19:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

* Eli Zaretskii <eliz@gnu.org> [2023-03-30 19:37]:
> Users can already choose between 1 and 2: see set-message-function.

I did this:

(setq set-message-function 'dunstify)

And now I get very visible message notifications on the desktop by
using program `dunst'. I can see much better what is going on in Emacs.

;;; Dunst

(defun rcd-pgrep-pid (program)
  "Return PID for PROGRAM by using system command `pgrep'."
  (let ((pgrep (executable-find "pgrep")))
    (rcd-unless pgrep
	"Can't find `pgrep' in $PATH"
      (let* ((pid (call-process-to-string pgrep nil nil "-x" program))
	     (pid (string-trim pid))
	     (pid (cond ((string= pid "") nil)
			(t (string-to-number pid)))))
	pid))))

 (defvar dunst-pid nil
  "Keep `dunst' PID.")

(defun dunst-launch ()
  "Launch `dunst' notification daemon."
  (interactive)
  (let ((pid (rcd-pgrep-pid "dunst")))
    (cond (pid (rcd-warning-message (format "`dunst' notification daemon already running with PID %s" pid)))
	  (t (setq dunst-pid pid)
	     (start-process "*dunst*" "*dunst*" "dunst")))))

(defun dunstify (title &optional text urgency timeout appname)
  ;; appname urgency hints action timeout icon raw-icon print-id replace-id block)
  "Dunstify TITLE with optional TEXT."
  (let* ((dunstify (executable-find "dunstify"))
	 (name (concat "*" dunstify "*"))
	 (buffer name)
	 (appname (cond (appname (list "-a" appname))
			(t nil)))
	 (timeout (cond (timeout (list "-t" (format "%s" timeout)))
			(t "10000")))
	 (urgency (cond (urgency (list "-u" (format "%s" urgency)))
			(t nil)))
	 (args (delq nil (append (list title) (flatten-list (list text appname timeout))))))
    (cond (dunstify 
	   (apply #'start-process name buffer dunstify args))
	  (t (rcd-warning-message "Program `dunstify' not found")))))

  ;; -u, --urgency=URG           The urgency of this notification
  ;; -h, --hints=HINT            User specified hints
  ;; -A, --action=ACTION         Actions the user can invoke
  ;; -i, --icon=ICON             An Icon that should be displayed with the notification
  ;; -I, --raw_icon=RAW_ICON     Path to the icon to be sent as raw image data
  ;; -p, --printid               Print id, which can be used to update/replace this notification
  ;; -r, --replace=ID            Set id of this notification.
  ;; -C, --close=ID              Close the notification with the specified ID
  ;; -b, --block                 Block until notification is closed and print close reason

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 18:31                   ` Eli Zaretskii
@ 2023-03-30 19:37                     ` Sergey Organov
  2023-03-30 19:45                     ` Gregory Heytings
  1 sibling, 0 replies; 34+ messages in thread
From: Sergey Organov @ 2023-03-30 19:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Thu, 30 Mar 2023 18:16:22 +0000
>> From: Gregory Heytings <gregory@heytings.org>
>> cc: help-gnu-emacs@gnu.org
>> 
>> > And I thought Drew wanted echo-area messages to pop in a separate 
>> > buffer.  The mode line is not a good place for showing messages, IMNSHO.
>> 
>> Hmmm... why not?
>
> Not enough screen estate, and cannot be enlarged to show more than one
> screen line.  You cannot base a general-purpose feature such as
> echo-area messages on the assumption that the message will never need
> more than one screen line.

There is no such assumption though, unless there is strict requirement
to show entire message. To me it looks fine to get only (part of) the
first line of the message, provided I can then check it in whole
elsewhere (if I decide to).

That said, I just checked my *Messages* buffer, and don't see anything
multi-line there, so multi-line echo area message is rather unusual to
encounter anyway?

>
>> 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.

Modeline looks more appealing to me, really hate popups.

Thanks,
-- Sergey



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  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
  1 sibling, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30 19:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


>> Hmmm... why not?
>
> Not enough screen estate, and cannot be enlarged to show more than one 
> screen line.  You cannot base a general-purpose feature such as 
> echo-area messages on the assumption that the message will never need 
> more than one screen line.
>

You may have seen that the mode-line is (on purpose) used if and only if 
the minibuffer is active.  IOW, most messages are still displayed in the 
echo area.

>> 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.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 19:45                     ` Gregory Heytings
@ 2023-03-30 20:02                       ` Gregory Heytings
  2023-03-30 20:06                         ` Gregory Heytings
  0 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30 20:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 658 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.

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

(defvar popup-buffer-minibuffer-message-window nil)
(defun popup-buffer-minibuffer-message-clear ()
  (when (not noninteractive)
    (when (timerp minibuffer-message-timer)
      (cancel-timer popup-buffer-minibuffer-message-timer)
      (when (live-window-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)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 20:02                       ` Gregory Heytings
@ 2023-03-30 20:06                         ` Gregory Heytings
  0 siblings, 0 replies; 34+ messages in thread
From: Gregory Heytings @ 2023-03-30 20:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

[-- 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)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 18:28                   ` Eli Zaretskii
@ 2023-03-30 20:08                     ` John Yates
  2023-03-31  6:32                       ` Yuri Khan
  0 siblings, 1 reply; 34+ messages in thread
From: John Yates @ 2023-03-30 20:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Thu, Mar 30, 2023 at 2:28 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> Split how?  The Emacs display engine doesn't support column-wise
> display that you are describing, it can only do that if the
> mini-window is split into two side-by-side windows, but that will run
> afoul of many assumptions everywhere that there's at most only one
> min-window per frame.

It was only an idea based on observing that on my high res screens
the full width minibuffer seems overly generous.  Hence my imagining
side-by-side windows.

Honestly, I do not have any real appreciation for the implications of
"only one min-window per frame" assumptions.  My thinking was
that the two side-by-side windows would be children of a single full-
width internal window which would in turn be a per-frame singleton.
This per-frame internal min-window would contain the per-frame
mini-buffer input window and the per-frame echo area output window.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 15:05       ` Gregory Heytings
  2023-03-30 16:28         ` [External] : " Drew Adams
@ 2023-03-31  6:24         ` Platon Pronko
  2023-03-31  6:58           ` Gregory Heytings
  1 sibling, 1 reply; 34+ messages in thread
From: Platon Pronko @ 2023-03-31  6:24 UTC (permalink / raw)
  To: Gregory Heytings, Eli Zaretskii; +Cc: help-gnu-emacs

On 2023-03-30 23:05, Gregory Heytings wrote:
> 
>>
>> If that is what you see, then it's the intended behavior.  That you are not used to it doesn't mean it's incorrect or broken. Functionally, it does the job, and we don't have any better alternatives for the case when a message should be shown when the minibuffer is active.
>>
> 
> It's true that we don't have any better _built-in_ alternatives, but I think what the OP wants is something like the code in the attached file.

Actually no, I don't think I would want to put messages into the modeline. As I understand it I have multiple modelines on my screen - one for each window, and that would be unnecessary duplication of information.

Thanks for the code, though - I'm sure that would be useful to somebody (I suspect many people won't be as opposed to putting echo messages into the mode line as I am).

-- 
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 20:08                     ` John Yates
@ 2023-03-31  6:32                       ` Yuri Khan
  0 siblings, 0 replies; 34+ messages in thread
From: Yuri Khan @ 2023-03-31  6:32 UTC (permalink / raw)
  To: John Yates; +Cc: Eli Zaretskii, help-gnu-emacs

On Fri, 31 Mar 2023 at 03:09, John Yates <john@yates-sheets.org> wrote:

> It was only an idea based on observing that on my high res screens
> the full width minibuffer seems overly generous.  Hence my imagining
> side-by-side windows.

How big is your 4K? If it’s 24″ or larger, you could be splitting it
to display two side-by-side frames, or an Emacs frame and a different
application.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31  6:24         ` Platon Pronko
@ 2023-03-31  6:58           ` Gregory Heytings
  2023-03-31  7:01             ` Gregory Heytings
  0 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-31  6:58 UTC (permalink / raw)
  To: Platon Pronko; +Cc: Eli Zaretskii, help-gnu-emacs


>
> Actually no, I don't think I would want to put messages into the 
> modeline. As I understand it I have multiple modelines on my screen - 
> one for each window, and that would be unnecessary duplication of 
> information.
>

Did you even try the code?  The message appears only in the modeline of 
the bottom window in the frame, right above the minibuffer.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31  6:58           ` Gregory Heytings
@ 2023-03-31  7:01             ` Gregory Heytings
  2023-03-31  7:10               ` Platon Pronko
  0 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-31  7:01 UTC (permalink / raw)
  To: Platon Pronko; +Cc: Eli Zaretskii, help-gnu-emacs


>> Actually no, I don't think I would want to put messages into the 
>> modeline. As I understand it I have multiple modelines on my screen - 
>> one for each window, and that would be unnecessary duplication of 
>> information.
>
> Did you even try the code?  The message appears only in the modeline of 
> the bottom window in the frame, right above the minibuffer.
>

(And it appears in the modeline only when the mini-buffer is active.)




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31  7:01             ` Gregory Heytings
@ 2023-03-31  7:10               ` Platon Pronko
  2023-03-31  7:17                 ` Gregory Heytings
  0 siblings, 1 reply; 34+ messages in thread
From: Platon Pronko @ 2023-03-31  7:10 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: Eli Zaretskii, help-gnu-emacs

On 2023-03-31 15:01, Gregory Heytings wrote:
> 
>>> Actually no, I don't think I would want to put messages into the modeline. As I understand it I have multiple modelines on my screen - one for each window, and that would be unnecessary duplication of information.
>>
>> Did you even try the code?  The message appears only in the modeline of the bottom window in the frame, right above the minibuffer.
>>
> 
> (And it appears in the modeline only when the mini-buffer is active.)
> 

I didn't try it out thoroughly, sorry. I saw that it appeared in minibuffer as usual and decided to not look into it further.

I think of modeline as something buffer-specific, so I don't want to put global messages there.

Regarding your code - I might be wrong, but won't message get stuck in the modeline if I reorder my windows before the timer runs out?

-- 
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31  7:10               ` Platon Pronko
@ 2023-03-31  7:17                 ` Gregory Heytings
  2023-03-31  7:45                   ` Gregory Heytings
  0 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-31  7:17 UTC (permalink / raw)
  To: Platon Pronko; +Cc: Eli Zaretskii, help-gnu-emacs


>
> 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.

>
> Regarding your code - I might be wrong, but won't message get stuck in 
> the modeline if I reorder my windows before the timer runs out?
>

No, it won't (barring bugs, of course).




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31  7:17                 ` Gregory Heytings
@ 2023-03-31  7:45                   ` Gregory Heytings
  2023-03-31 11:04                     ` John Covici
  0 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-31  7:45 UTC (permalink / raw)
  To: Platon Pronko; +Cc: Eli Zaretskii, help-gnu-emacs

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


>> 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.

[-- Attachment #2: popup-buffer-minibuffer-message.el --]
[-- Type: text/plain, Size: 1767 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 (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)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [External] : Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-30 19:26             ` Jean Louis
@ 2023-03-31 10:40               ` Eric S Fraga
  0 siblings, 0 replies; 34+ messages in thread
From: Eric S Fraga @ 2023-03-31 10:40 UTC (permalink / raw)
  To: help-gnu-emacs

On Thursday, 30 Mar 2023 at 22:26, Jean Louis wrote:
> (setq set-message-function 'dunstify)

Quite funny this: I have the opposite.  As I live in Emacs, I tend to
ignore everything else around me, including messages that are handled by
dunst.  So I have dunst tell Emacs about any popup messages via this
shell script:

--8<---------------cut here---------------start------------->8---
#!/bin/sh -f
# send dunst message to emacs to keep log in the *Messages* buffer
APPNAME="$1"
SUMMARY="$2"
BODY="$3"
ICON="$4"
URGENCY="$5"
DATE=$(date +%H.%M)
emacsclient -n --eval "(let ((s \"${DATE}: ${APPNAME}/${SUMMARY}: $BODY\") (inhibit-message t)) (message (substring s 0 (min (length s) (- (frame-width) 10)))))"
--8<---------------cut here---------------end--------------->8---

Sorry for interruption.  As you were.

eric

-- 
Eric S Fraga via gnus (Emacs 30.0.50 2023-03-21) on Debian 11.6




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31  7:45                   ` Gregory Heytings
@ 2023-03-31 11:04                     ` John Covici
  2023-03-31 11:09                       ` Gregory Heytings
  0 siblings, 1 reply; 34+ messages in thread
From: John Covici @ 2023-03-31 11:04 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: Platon Pronko, Eli Zaretskii, help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31 11:04                     ` John Covici
@ 2023-03-31 11:09                       ` Gregory Heytings
  2023-03-31 12:46                         ` John Covici
  0 siblings, 1 reply; 34+ messages in thread
From: Gregory Heytings @ 2023-03-31 11:09 UTC (permalink / raw)
  To: John Covici; +Cc: Platon Pronko, Eli Zaretskii, help-gnu-emacs


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

Of course.  Both the mode-line and the popup-buffer implementations work 
in a terminal.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Is there a way to avoid clobbering minibuffer by messages?
  2023-03-31 11:09                       ` Gregory Heytings
@ 2023-03-31 12:46                         ` John Covici
  0 siblings, 0 replies; 34+ messages in thread
From: John Covici @ 2023-03-31 12:46 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: Platon Pronko, Eli Zaretskii, help-gnu-emacs

Thanks,  we will see what happens.

On Fri, 31 Mar 2023 07:09:16 -0400,
Gregory Heytings wrote:
> 
> 
> > 
> > Would this work if I am using a virtual console -- in that case
> > there would be no frame or anything like that?
> > 
> 
> Of course.  Both the mode-line and the popup-buffer
> implementations work in a terminal.
> 
> 

-- 
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



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-03-31 12:46 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.