From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9782: 24.0.90; move-to-window-line not taking header line into account Date: Tue, 18 Oct 2011 10:00:11 -0400 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1318946479 5559 80.91.229.12 (18 Oct 2011 14:01:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 Oct 2011 14:01:19 +0000 (UTC) Cc: 9782@debbugs.gnu.org To: David Engster Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 18 16:01:15 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGAEE-0005B8-45 for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Oct 2011 16:01:14 +0200 Original-Received: from localhost ([::1]:35474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGAED-00083E-BL for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Oct 2011 10:01:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGAE7-0007ov-Ja for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:01:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGAE5-0001aZ-UA for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:01:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGAE5-0001aI-I2 for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:01:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGAEz-0006Ii-Gu for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Oct 2011 14:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9782 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9782-submit@debbugs.gnu.org id=B9782.131894647524168 (code B ref 9782); Tue, 18 Oct 2011 14:02:01 +0000 Original-Received: (at 9782) by debbugs.gnu.org; 18 Oct 2011 14:01:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGAEF-0006Hk-7L for submit@debbugs.gnu.org; Tue, 18 Oct 2011 10:01:15 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGAEB-0006Hc-F8 for 9782@debbugs.gnu.org; Tue, 18 Oct 2011 10:01:13 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RGADD-0008JI-Ht; Tue, 18 Oct 2011 10:00:11 -0400 In-reply-to: (message from David Engster on Tue, 18 Oct 2011 14:03:13 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 18 Oct 2011 10:02:01 -0400 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:52789 Archived-At: > From: David Engster > Date: Tue, 18 Oct 2011 14:03:13 +0200 > > Recipe: > > * emacs -Q > > * Enter in scratch buffer: > > (move-to-window-line (cdr (posn-actual-col-row (posn-at-point)))) > > and enter an additional newline so this is not the last line in the buffer. > > * Move behind last bracket an hit C-x C-e > > * Cursor will move to beginning of line, as expected. > > * Now do M-: (setq header-line-format "") RET > > * Evaluate the above again. You'll see that cursor now will move to the > beginning of the next line, which is wrong. > > > This behavior occurs since rev. 106022, which fixed posn-actual-col-row > when a header-line is active, but it seems move-to-window-line now has > to be fixed as well. Please provide some arguments as to why the current behavior is wrong. posn-actual-col-row returns a _row_ derived from a pixel position, while move-to-window-line accepts a _line_number_ starting from the beginning of the text displayed in the window. These two are not the same. Unless I'm mistaken, I see many users of move-to-window-line that would break if we make the change you suggest. E.g., what will happen to code that does this: (move-to-window-line 0) when there's a header line in the buffer, if your suggestion is implemented? Put it another way, the posn-* family of function deals with mouse events, which are inherently oblivious to where text is displayed and where we have window decorations. By contrast, move-to-window-line belongs to a different family of functions, one that deals with lines of text. Please show where this reasoning is wrong.