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: Mon, 24 Sep 2012 10:17:25 +0200 Message-ID: <50601715.6030108@gmx.at> References: <504FB55D.5030405@t-online.de> <5050432C.4060203@gmx.at> <5052450F.8030001@t-online.de> <5052F242.4060303@gmx.at> <5055D769.1060804@t-online.de> <50561046.60902@gmx.at> <505E1FB6.1050504@t-online.de> <505ED4AB.7070009@gmx.at> <505F8576.8070902@t-online.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1348474704 28283 80.91.229.3 (24 Sep 2012 08:18:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2012 08:18:24 +0000 (UTC) Cc: 12419@debbugs.gnu.org To: occitan@esperanto.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 10:18:29 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 1TG3s4-0002L6-AQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2012 10:18:28 +0200 Original-Received: from localhost ([::1]:35126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG3rz-0002JC-GD for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2012 04:18:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG3rw-0002J4-Oa for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 04:18:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG3rl-0006cg-FK for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 04:18:20 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG3rl-0006cS-BM for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 04:18:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TG3tZ-0000NO-LH for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 04:20: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: Mon, 24 Sep 2012 08:20: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.13484747791413 (code B ref 12419); Mon, 24 Sep 2012 08:20:01 +0000 Original-Received: (at 12419) by debbugs.gnu.org; 24 Sep 2012 08:19:39 +0000 Original-Received: from localhost ([127.0.0.1]:52072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TG3tC-0000Mk-LH for submit@debbugs.gnu.org; Mon, 24 Sep 2012 04:19:39 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:33023) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TG3t9-0000Mb-Do for 12419@debbugs.gnu.org; Mon, 24 Sep 2012 04:19:36 -0400 Original-Received: (qmail invoked by alias); 24 Sep 2012 08:17:31 -0000 Original-Received: from 62-47-46-191.adsl.highway.telekom.at (EHLO [62.47.46.191]) [62.47.46.191] by mail.gmx.net (mp016) with SMTP; 24 Sep 2012 10:17:31 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18bBGkd9lEb1N3dNvcnFqVS4kzNJ00CnJL/aE62vY xHLSzLuBts2WZU In-Reply-To: <505F8576.8070902@t-online.de> 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:64839 Archived-At: > However my first informatics lesson the professor told us: the most > common bug is being off by one. That is alas still the case with your > patch: After C-x 2 the lower window is one row higher than the upper > one. After our little experiment, it's the other way round, with this > result: When letting go of the mouse, I still marked to the line above, > which is now in the position of my mouse-down event. Sounds like an > integer division rounding problem, though I don't see such a thing in > your patch. If both windows together have an even number of rows (by > resizing the frame) it's fine. You should get a similar behavior if you have a root window with an odd number of lines, split that window via C-x 2, shrink the frame by one line, and enlarge it again by one line: The upper window has stolen one line from the lower one. As a matter of fact, this is not an off-by-one error but more deeply rooted in the history of Emacs' window handling. You can skip the following explanation if you want. Beginning with Emacs 24.1, windows have a normal height (a floating point number) which is the fraction of their ideal height wrt to their parent. When you do C-x 2 the normal height of both emanating windows is 0.5. However, when the original window has an odd number of lines, I have to give the lower window the one remaining line in order to be consistent with the traditional splitting behavior. This means that, if the original window has 11 lines, the upper window gets 5 and the lower window gets 6 lines. If I now enlarge the parent window to 22 lines, the upper window gets 11 (and not 10) lines and the lower window 11 (and not 12 lines). Sizing back the parent to 11 lines should restore the initial state but it doesn't because I resize windows in the "opposite" direction (from top to bottom/from left to right) which preferably gives to/steals from the topmost/leftmost window. So I have to fix this regardless of the topic we're discussing here. > If however I split either of the two windows again (even the top one, > which is out of reach of the resizing echo area) the disturbing new > before-your-patch behaviour comes back. I suppose you should try again. If I split the top window, only the bottom window resizes and I can't observe what you observe here. If I make a new bottom window instead, the line where `point' appears in that window moves to the top of the window and I can observe the behavior. However, I don't see any difference wrt Emacs 23 which means I do not see a "disturbing new" before-my-patch behavior. If you nevertheless do, please give me a detailed step-by-step scenario I can repeat here. >> The second scenario you sketched is [...] > The point is moving the mouse over to the i, which causes the 1st > scroll, and then letting go, which causes the scrolled region to be > marked, plus it causes a 2nd scroll by the same amount. So the point is > now far from the highlighted part. I guess this comes from a different > code location. Only the user experience feels to me like both cases > should be consistent with one another. OK. I see something in this regard. But Emacs 23 seems to behave in exactly the same way. Or do you see a difference? martin