From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12419: Mouse click changes layout Date: Sat, 15 Sep 2012 16:34:31 +0200 Message-ID: <505491F7.5080405@gmx.at> References: <504FB55D.5030405@t-online.de> <5050432C.4060203@gmx.at> <5052450F.8030001@t-online.de> <5052F242.4060303@gmx.at> <83a9wsvqk6.fsf@gnu.org> <50533344.2030000@gmx.at> <831ui4veny.fsf@gnu.org> <50534A48.5080805@gmx.at> <83zk4stuf1.fsf@gnu.org> <50538260.40900@gmx.at> <83wqzwtl57.fsf@gnu.org> <50545049.40101@gmx.at> <83boh7twig.fsf@gnu.org> <50545AE1.4020609@gmx.at> <83627ftu5c.fsf@gnu.org> <50547845.8070301@gmx.at> <831ui3tnm7.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347719707 15445 80.91.229.3 (15 Sep 2012 14:35:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Sep 2012 14:35:07 +0000 (UTC) Cc: occitan@esperanto.org, 12419@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 15 16:35:09 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TCtSd-0007Eh-QI for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Sep 2012 16:35:08 +0200 Original-Received: from localhost ([::1]:59999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCtSY-000055-66 for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Sep 2012 10:35:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCtSV-0008WT-VQ for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 10:35:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCtSU-00020I-Tb for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 10:34:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCtSU-000208-QR for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 10:34:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TCtTV-0008RO-Lf for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 10:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12419 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12419-submit@debbugs.gnu.org id=B12419.134771974732425 (code B ref 12419); Sat, 15 Sep 2012 14:36:01 +0000 Original-Received: (at 12419) by debbugs.gnu.org; 15 Sep 2012 14:35:47 +0000 Original-Received: from localhost ([127.0.0.1]:35628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCtTH-0008Qw-1e for submit@debbugs.gnu.org; Sat, 15 Sep 2012 10:35:47 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:46377) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TCtTD-0008Qm-Pb for 12419@debbugs.gnu.org; Sat, 15 Sep 2012 10:35:45 -0400 Original-Received: (qmail invoked by alias); 15 Sep 2012 14:34:39 -0000 Original-Received: from 62-47-39-101.adsl.highway.telekom.at (EHLO [62.47.39.101]) [62.47.39.101] by mail.gmx.net (mp072) with SMTP; 15 Sep 2012 16:34:39 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+J944rKqWJV3R5a2/lGJ1Iy/2BRCVAxCTcAMP9ge w8bBR4DEeg4M98 In-Reply-To: <831ui3tnm7.fsf@gnu.org> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64365 Archived-At: > 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