GNU bug report logs - #70038
29.3.50; Shift up/down in buffer with images on M-x other-window with some fonts

Previous Next

Package: emacs;

Reported by: Ramon Diaz-Uriarte <rdiaz02 <at> gmail.com>

Date: Wed, 27 Mar 2024 20:26:01 UTC

Severity: normal

Found in version 29.3.50

Full log


Message #53 received at 70038 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, rahguzar <at> zohomail.eu, r.diaz <at> uam.es, rdiaz02 <at> gmail.com,
 70038 <at> debbugs.gnu.org
Subject: Re: bug#70038: 29.3.50; Shift up/down in buffer with images on M-x
 other-window with some fonts
Date: Mon, 8 Apr 2024 11:07:50 +0200
IIUC the basic idea of all this is to preserve window start positions
when enlarging a mini window unless that would move a window's point
outside that window.  Once upon a time, resize_mini_window used window
configurations to get back the previous start positions but that was
maybe considered too costly and Gerd decided to "Don't save window
configuration, freeze window starts instead."

A possibly heretical question is in which way freezing start positions
permanently can harm.  IIUC, after a minibuffer interaction, currently
the only way to unfreeze start positions is to resize the minibuffer
window and trigger the corresponding call in shrink_mini_window.  But
setting the start position of any window while a minibuffer interaction
is going on seems to work here without problems.

Let's assume it can harm:

>> If the only
>> problem is that of restore_window_configuration, then minibuffer_unwind
>> looks like the right place.

That was silly.  minibuffer_unwind seems to care only about replacing
one minibuffer with another.  read_minibuf_unwind already should handle
this here (don't ask me what a future_mini_window is)

  /* When we get to the outmost level, make sure we resize the
     mini-window back to its normal size.  */
  if (minibuf_level == 0
      || !EQ (selected_frame, WINDOW_FRAME (XWINDOW (future_mini_window))))
    resize_mini_window (XWINDOW (minibuf_window), 0);

The only problem is that if the mini window was _not_ enlarged,
shrink_mini_window won't unfreeze starts.  Unconditionally unfreezing
start positions there as I mentioned in my first mail should fix that.

> Hmm...  read_char_help_form_unwind is called after we invoke
> help-form-show, and that one pops up a special buffer:
>
>    (defun help-form-show ()
>      "Display the output of a non-nil `help-form'."
>      (let ((msg (eval help-form t)))
>        (if (stringp msg)
> 	  (with-output-to-temp-buffer " *Char Help*"
> 	    (princ msg)))))
>
> Is there a way to make that use the echo-area? if so, can you tell how
> to do that?

IIUC that is called in a situation where the minibuffer is active.
Showing that text in the echo area (albeit shortly) doesn't look like
TRT to me.

IIUC read_char can resize the mini window here

	  if (minibuf_level
	      && EQ (minibuf_window, echo_area_window)
	      /* The case where minibuffer-message-timeout is a number
		 was already handled near the beginning of command_loop_1.  */
	      && !NUMBERP (Vminibuffer_message_timeout))
	    resize_mini_window (XWINDOW (minibuf_window), false);

so this should be covered by read_minibuf_unwind already.

martin




This bug report was last modified 1 year and 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.