unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43813: [BUG] current-message not working with minibuffer-message
@ 2020-10-05  7:34 pinkanon pinkanon
  2020-10-05 12:42 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-05  7:34 UTC (permalink / raw)
  To: 43813

[-- Attachment #1: Type: text/html, Size: 631 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05  7:34 bug#43813: [BUG] current-message not working with minibuffer-message pinkanon pinkanon
@ 2020-10-05 12:42 ` Eli Zaretskii
  2020-10-05 15:56   ` pinkanon pinkanon
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-05 12:42 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Date: Mon, 05 Oct 2020 10:34:49 +0300
> 
> Eval this:
>  
> (progn (minibuffer-message "hello world") (print (format "current message: %s" (current-message))))
>  
> to get "current message: nil" in the *Messages*. If message is used in place of minibuffer message, works
> as expected.

I think your expectations are incorrect, and Emacs works correctly in
this case.

> The reason I think current-message should work with minibuffer-message is due to its docstring: "Return the
> string currently displayed in the echo area, or nil if none."

The echo area and the minibuffer are two different buffers.  They both
use the same mini-window to display their text, but they are not the
same.

> PS Is there some other way to get what's currently displayed in the echo area?

You mean, what is shown in the mini-window?  Is minibuffer-contents
what you want?





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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 12:42 ` Eli Zaretskii
@ 2020-10-05 15:56   ` pinkanon pinkanon
  2020-10-05 16:05     ` pinkanon pinkanon
  2020-10-05 16:08     ` Eli Zaretskii
  0 siblings, 2 replies; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-05 15:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 2399 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 15:56   ` pinkanon pinkanon
@ 2020-10-05 16:05     ` pinkanon pinkanon
  2020-10-05 16:08     ` Eli Zaretskii
  1 sibling, 0 replies; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-05 16:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 2759 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 15:56   ` pinkanon pinkanon
  2020-10-05 16:05     ` pinkanon pinkanon
@ 2020-10-05 16:08     ` Eli Zaretskii
  2020-10-05 16:33       ` pinkanon pinkanon
  1 sibling, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-05 16:08 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Cc: "43813@debbugs.gnu.org" <43813@debbugs.gnu.org>
> Date: Mon, 05 Oct 2020 18:56:12 +0300
> 
> (progn
>   (minibuffer-message "hello world")
>   (with-selected-window (minibuffer-window)
>     (print (format "ms: %s" (buffer-substring-no-properties (point-min) (point-max))))))

When minibuffer-message exits, the message is already deleted.





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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 16:08     ` Eli Zaretskii
@ 2020-10-05 16:33       ` pinkanon pinkanon
  2020-10-05 17:01         ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-05 16:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 927 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 16:33       ` pinkanon pinkanon
@ 2020-10-05 17:01         ` Eli Zaretskii
  2020-10-05 17:43           ` pinkanon pinkanon
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-05 17:01 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Cc: "43813@debbugs.gnu.org" <43813@debbugs.gnu.org>
> Date: Mon, 05 Oct 2020 19:33:47 +0300
> 
> Even though it's still displayed in the mini window? So, after it's been rendered, it's basically gone then?

No, it isn't displayed then, the mini-window is cleared.

You can see in the doc string of minibuffer-message that it displays
the message for some time, or until some input event arrives.  Then
the message is cleared.

Why do you need to get at the text shown by minibuffer-message?  For
what purpose?  That function specifically exists to show temporary
messages, so the text is ephemeral, it goes away as soon as the user
types something.






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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 17:01         ` Eli Zaretskii
@ 2020-10-05 17:43           ` pinkanon pinkanon
  2020-10-05 18:19             ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-05 17:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 1484 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 17:43           ` pinkanon pinkanon
@ 2020-10-05 18:19             ` Eli Zaretskii
  2020-10-06  7:52               ` pinkanon pinkanon
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-05 18:19 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Cc: "43813@debbugs.gnu.org" <43813@debbugs.gnu.org>
> Date: Mon, 05 Oct 2020 20:43:33 +0300
> 
> I am doing an eldoc sort of thing and I don't want my hint messages interfering with any other, probably more
> important, messages. I want to do it by seeing if there's anything at all displayed currently in the mini window
> and, if not, show my hint. I guess current-message should meet most of my needs, but I got curious and
> asked anyhow.

If the minibuffer is active (i.e. the user is typing a response for
some prompt), the hints you show via 'message' will not overwrite the
minibuffer stuff, but will be shown after it.  So you should have no
problems due to minibuffer editing in your application.





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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-05 18:19             ` Eli Zaretskii
@ 2020-10-06  7:52               ` pinkanon pinkanon
  2020-10-06  8:19                 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-06  7:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 1483 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06  7:52               ` pinkanon pinkanon
@ 2020-10-06  8:19                 ` Eli Zaretskii
  2020-10-06  8:46                   ` pinkanon pinkanon
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-06  8:19 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Cc: "43813@debbugs.gnu.org" <43813@debbugs.gnu.org>
> Date: Tue, 06 Oct 2020 10:52:23 +0300
> 
> It's not only minibuffer editing though. It could be just regular messages/minibuffer-messages from anywhere
> else. For instance messages from a linter or some callback response from some connection letting you
> know something's been set up. I don't want my low-priority hinting covering any of that up.

The messages displayed by minibuffer-message will always disappear
after the timeout, or when some input event arrives.  So they cannot
be a problem in your application, I think.

If you do see some problems, could you show some simple example of
that?





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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06  8:19                 ` Eli Zaretskii
@ 2020-10-06  8:46                   ` pinkanon pinkanon
  2020-10-06  9:04                     ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-06  8:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 1582 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06  8:46                   ` pinkanon pinkanon
@ 2020-10-06  9:04                     ` Eli Zaretskii
  2020-10-06 11:01                       ` pinkanon pinkanon
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-06  9:04 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Cc: "43813@debbugs.gnu.org" <43813@debbugs.gnu.org>
> Date: Tue, 06 Oct 2020 11:46:34 +0300
> 
> The problem is not in them not disappearing, the problem is when one message (aka low-priority hint) shows
> when another message (high-priority aka linting) is displaying (effectively killing the high-priority message).

Can you show an example of such problem?  I thought we've solved that
in Emacs 27, but maybe I'm missing something.





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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06  9:04                     ` Eli Zaretskii
@ 2020-10-06 11:01                       ` pinkanon pinkanon
  2020-10-06 11:06                         ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-06 11:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 1527 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06 11:01                       ` pinkanon pinkanon
@ 2020-10-06 11:06                         ` Eli Zaretskii
  2020-10-06 13:39                           ` pinkanon pinkanon
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2020-10-06 11:06 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813

> From: pinkanon pinkanon <pinkanon.pinkanon@yandex.com>
> Cc: "43813@debbugs.gnu.org" <43813@debbugs.gnu.org>
> Date: Tue, 06 Oct 2020 14:01:10 +0300
> 
> Here's an example:
>  
> ;; someone else's code (minibuffer-message "important message") // flycheck, whatever
> ;; ...
> ;; my code soon after:
> ;; (unless (current-message) (minibuffer-message "unimportant info"))
> echo area: "unimportant info" instead of "important info"

When I run this, I first see "important message" displayed for 2 sec,
then "unimportant message" is displayed.  So no important message
seems to be overwritten.

Are you doing this in Emacs 27?





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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06 11:06                         ` Eli Zaretskii
@ 2020-10-06 13:39                           ` pinkanon pinkanon
  2020-10-07  3:06                             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: pinkanon pinkanon @ 2020-10-06 13:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43813@debbugs.gnu.org

[-- Attachment #1: Type: text/html, Size: 1428 bytes --]

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

* bug#43813: [BUG] current-message not working with minibuffer-message
  2020-10-06 13:39                           ` pinkanon pinkanon
@ 2020-10-07  3:06                             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 17+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-07  3:06 UTC (permalink / raw)
  To: pinkanon pinkanon; +Cc: 43813@debbugs.gnu.org

pinkanon pinkanon <pinkanon.pinkanon@yandex.com> writes:

> Anyway, thanks for taking the time to understand my problem.

So there doesn't seem to be a bug here, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2020-10-07  3:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05  7:34 bug#43813: [BUG] current-message not working with minibuffer-message pinkanon pinkanon
2020-10-05 12:42 ` Eli Zaretskii
2020-10-05 15:56   ` pinkanon pinkanon
2020-10-05 16:05     ` pinkanon pinkanon
2020-10-05 16:08     ` Eli Zaretskii
2020-10-05 16:33       ` pinkanon pinkanon
2020-10-05 17:01         ` Eli Zaretskii
2020-10-05 17:43           ` pinkanon pinkanon
2020-10-05 18:19             ` Eli Zaretskii
2020-10-06  7:52               ` pinkanon pinkanon
2020-10-06  8:19                 ` Eli Zaretskii
2020-10-06  8:46                   ` pinkanon pinkanon
2020-10-06  9:04                     ` Eli Zaretskii
2020-10-06 11:01                       ` pinkanon pinkanon
2020-10-06 11:06                         ` Eli Zaretskii
2020-10-06 13:39                           ` pinkanon pinkanon
2020-10-07  3:06                             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

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