all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings via "Emacs development discussions." <emacs-devel@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: acm@muc.de, Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org, drew.adams@oracle.com, juri@linkov.net
Subject: Re: Where to show message output while inputting [was: New multi-command facility displays in the wrong echo area]
Date: Wed, 14 Oct 2020 21:22:04 +0000	[thread overview]
Message-ID: <alpine.NEB.2.22.394.2010142041310453.6095@sdf.lonestar.org> (raw)
In-Reply-To: <jwvk0vs3ent.fsf-monnier+emacs@gnu.org>

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


Hi Stefan,

>>> Eldoc's purpose is different from the purpose of displaying echo-area 
>>> messages.  For example, nothing significantly bad can happen if you 
>>> miss the Eldoc's hints, but the same is not true for some important 
>>> echo-area messages.
>>
>> AFAICS you can't miss them with the proposed solution: they are 
>> displayed on the left of the mode-line, with a different background and 
>> foreground.
>
> In my setup, the minibuffer is in its own frame, with no mode-line in 
> sight.  So indeed I don't get the eldoc hints in `M-:` because they're 
> placed in a non-displayed mode-line.  E.g.:
>
>    % src/emacs -Q --eval '(setq default-frame-alist (quote ((minibuffer . nil))))'
>    M-: (format
>    ...wait a little...
>
> ...and see that the mode-line doesn't display anything about `format`
>

I tried your recipe with Emacs 25 to 28, and the modeline _does_ display 
the eldoc info about 'format', so I'm not quite sure what you mean.

Your remark did, however, prompt me to look closer at this case, and to 
improve my "minibuffer-message-in-mode-line" feature a second time.  I 
attach its last version.  Could you perhaps have a look at/try this, and 
give your opinion on it?  It's an attempt to give a more robust solution 
to bug#38457.

[-- Attachment #2: Type: text/plain, Size: 2441 bytes --]

(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))
             (or (eq (window-frame) (window-frame (active-minibuffer-window)))
                 (eq (frame-parameter (window-frame (active-minibuffer-window)) 'minibuffer) 'only)))
    (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 message)
        (force-mode-line-update))
      t)))

  reply	other threads:[~2020-10-14 21:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 17:31 Where to show message output while inputting [was: New multi-command facility displays in the wrong echo area] Drew Adams
2020-10-13 18:39 ` Where to show message output while inputting Kévin Le Gouguec
2020-10-13 19:42 ` Where to show message output while inputting [was: New multi-command facility displays in the wrong echo area] Gregory Heytings via Emacs development discussions.
2020-10-13 20:38   ` Drew Adams
2020-10-13 20:59     ` Gregory Heytings via Emacs development discussions.
     [not found]       ` <2bedd6ef-c49a-4e0e-b0e4-4e3c6b8b79ce@default>
2020-10-13 21:55         ` Gregory Heytings via Emacs development discussions.
2020-10-14 14:39       ` Eli Zaretskii
2020-10-14 14:58         ` Gregory Heytings via Emacs development discussions.
2020-10-14 17:27           ` Stefan Monnier
2020-10-14 21:22             ` Gregory Heytings via Emacs development discussions. [this message]
2020-10-15  1:52               ` Stefan Monnier
     [not found] ` <87eelo6iio.fsf@blind.guru>
2020-10-24 17:31   ` Drew Adams

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

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

  git send-email \
    --in-reply-to=alpine.NEB.2.22.394.2010142041310453.6095@sdf.lonestar.org \
    --to=emacs-devel@gnu.org \
    --cc=acm@muc.de \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=ghe@sdf.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    /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.
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.