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

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

bug#38645: 26.3; minibuffer input is called with multi-line window when


From: ynyaaa
Subject: bug#38645: 26.3; minibuffer input is called with multi-line window when multi-line message is shown
Date: Wed, 18 Dec 2019 19:52:44 +0900

Eli Zaretskii <eliz@gnu.org> writes:
> On December 17, 2019 1:55:48 PM GMT+02:00, ynyaaa@gmail.com wrote:
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > On December 17, 2019 8:49:17 AM GMT+02:00, ynyaaa@gmail.com wrote:
>> >> 
>> 
>> > That's a feature: by default the mini-window only grows
>> automatically,
>> > and doesn't get reset to its original 1 line until the echo area is
>> > cleared.  If you don't like this, customize resize-mini-windows to
>> the
>> > value t, or bind it temporarily while running code such as in the
>> > recipe.
>> 
>> This may happen with unrelated commands.
>> Commands below shows an example.
>> Please input M-x as one key event, not ESC x.
>> 
>> M-: "1\n2" RET
>> M-x
>
> When I type this with resize-mini-windows set to t, typing M-x causes
> the mini-window to shrink back to its original one-line height.  So I
> don't think I understand the complaint.

Evaluate the form below and type 3 2 1, minibuffer window shrinks each
time. This behavior is inconsistent with read-string.
To check echo area contents just before read-string, type 3 4
and the tmp variable value is nil, which indicates that the echo area
has been cleared without shrinking the minibuffer window.

(let ((buf (generate-new-buffer "tmp"))
      (map (make-sparse-keymap)))
  (switch-to-buffer buf)
  (define-key map "1" (lambda () (interactive) (message "1")))
  (define-key map "2" (lambda () (interactive) (message "a\nb")))
  (define-key map "3" (lambda () (interactive) (message "A\nB\nC")))
  (define-key map "4" (lambda () (interactive)
                        (let ((tmp (current-message)))
                          (read-string "input: ")
                          (message "tmp: %s" tmp))))
  (use-local-map map))


By the way, read-string with empty PROMPT make the minibuffer window
shrink.

(progn
  (message "1\n2")
  (read-string ""))

Also it make the window shrink when all the minibuffer content is
deleted, even though read-string is not finished.

M-: (read-string "") RET
C-q C-j
C-q C-j
DEL
DEL





reply via email to

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