unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: occitan@esperanto.org, 12419@debbugs.gnu.org
Subject: bug#12419: Mouse click changes layout
Date: Sat, 15 Sep 2012 16:34:31 +0200	[thread overview]
Message-ID: <505491F7.5080405@gmx.at> (raw)
In-Reply-To: <831ui3tnm7.fsf@gnu.org>

 > But why did you say that your proposed change in window.el doesn't
 > restore the Emacs 23 behavior?  AFAICS, it does: if I set
 > max-mini-window-height to a large number, like 100, Emacs 23 also
 > resizes windows other than the lowest one.

My algorithm growing the minibuffer window emulates Gerd's.  But there
is no algorithm for shrinking the minibuffer window because no reliable
one exists.  Gerd stores all original window heights before growing the
minibuffer window and emulates shrinking to the original line by writing
them back into the height fields of the window structure.  This requires
some care and can fail, for example, when resizing the frame with an
enlarged minibuffer.  And IIUC this is also the reason for the somewhat
strange default value `grow-only' for `resize-mini-windows'.

Look at Gerd's shrinking routine below:

shrink_mini_window (w)
      struct window *w;
{
   struct frame *f = XFRAME (w->frame);
   struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));

   if (save_restore_orig_size (root, CHECK_ORIG_SIZES))

----> This is taken if heights were stored earlier and the size check
       suceeds.  Note that it just restores the original sizes, there's
       no shrinking from say 3 to 2 lines.

     {
       save_restore_orig_size (root, RESTORE_ORIG_SIZES);
       adjust_glyphs (f);
       FRAME_WINDOW_SIZES_CHANGED (f) = 1;
       windows_or_buffers_changed = 1;
     }
   else if (XFASTINT (w->total_lines) > 1)

----> This is the branch taken in the `resize-mini-windows' t case or
       when the size check above fails.  It does the old enlarge_window
       routine which can shed bad results and in some cases even delete
       the windows it's supposed to enlarge.  This could also shrink a
       minibuffer from 3 to 2 lines; but that feature is not used, likely
       because Gerd trusted that nobody would want it.  So, by force, the
       minibuffer window always shrinks back to one line.

     {
       /* Distribute the additional lines of the mini-window
	 among the other windows.  */
       Lisp_Object window;
       XSETWINDOW (window, w);
       enlarge_window (window, 1 - XFASTINT (w->total_lines), 0);
     }
}

martin





  reply	other threads:[~2012-09-15 14:34 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 22:04 bug#12419: Mouse click changes layout Daniel Pfeiffer
2012-09-12  2:59 ` Eli Zaretskii
2012-09-12  8:09 ` martin rudalics
2012-09-13 20:41   ` Daniel Pfeiffer
2012-09-14  9:00     ` martin rudalics
2012-09-14 10:36       ` Eli Zaretskii
2012-09-14 13:38         ` martin rudalics
2012-09-14 14:10           ` Drew Adams
2012-09-14 15:08             ` martin rudalics
2012-09-14 16:18               ` Drew Adams
2012-09-14 19:14                 ` martin rudalics
2012-09-14 19:40                   ` Drew Adams
2012-09-15  9:51                     ` martin rudalics
2012-09-15 10:31                       ` martin rudalics
2012-09-14 14:53           ` Eli Zaretskii
2012-09-14 15:16             ` martin rudalics
2012-09-14 16:20               ` Drew Adams
2012-09-14 19:14                 ` martin rudalics
2012-09-14 16:56               ` Eli Zaretskii
2012-09-14 19:15                 ` martin rudalics
2012-09-14 20:16                   ` Eli Zaretskii
2012-09-15  9:54                     ` martin rudalics
2012-09-15 10:23                       ` Eli Zaretskii
2012-09-15 10:39                         ` martin rudalics
2012-09-15 11:14                           ` Eli Zaretskii
2012-09-15 12:44                             ` martin rudalics
2012-09-15 13:35                               ` Eli Zaretskii
2012-09-15 14:34                                 ` martin rudalics [this message]
2012-09-14 15:45             ` Stefan Monnier
2012-09-14 19:14               ` martin rudalics
2012-09-14 19:56                 ` Stefan Monnier
2012-09-15  9:51                   ` martin rudalics
     [not found]       ` <5055D769.1060804@t-online.de>
2012-09-16 17:45         ` martin rudalics
2012-09-22 20:29           ` Daniel Pfeiffer
2012-09-23  9:21             ` martin rudalics
2012-09-23 21:56               ` Daniel Pfeiffer
2012-09-24  8:17                 ` martin rudalics
2012-09-24 14:33                   ` Eli Zaretskii
2012-09-25  9:58                     ` martin rudalics
2012-09-25 12:09                       ` Eli Zaretskii
2012-09-25 14:12                         ` martin rudalics
2012-09-26  8:22                           ` Eli Zaretskii
2012-09-26 11:03                             ` martin rudalics
2012-09-26 11:55                               ` Eli Zaretskii
2012-09-26 12:43                                 ` martin rudalics
2012-09-26 13:17                                   ` Eli Zaretskii
2012-09-26 13:44                                     ` martin rudalics
2012-09-26 13:57                                       ` Eli Zaretskii
2012-09-24 22:20                   ` Daniel Pfeiffer
2012-09-25  6:32                     ` Eli Zaretskii
2012-09-25  9:58                     ` martin rudalics
2020-09-13 17:06               ` Lars Ingebrigtsen
2020-12-07 16:43                 ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=505491F7.5080405@gmx.at \
    --to=rudalics@gmx.at \
    --cc=12419@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=occitan@esperanto.org \
    /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 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).