From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster 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 16:23:37 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1318947864 16808 80.91.229.12 (18 Oct 2011 14:24:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 Oct 2011 14:24:24 +0000 (UTC) Cc: 9782@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 18 16:24:20 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 1RGAaZ-0008Dq-Jh for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Oct 2011 16:24:19 +0200 Original-Received: from localhost ([::1]:50566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGAaZ-0001uf-54 for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Oct 2011 10:24:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGAaT-0001uN-B5 for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:24:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGAaL-0008L8-8v for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:24:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGAaK-0008Kl-P3 for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:24:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGAbF-0006oY-Nh for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2011 10:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Engster Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Oct 2011 14:25: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.131894788726170 (code B ref 9782); Tue, 18 Oct 2011 14:25:01 +0000 Original-Received: (at 9782) by debbugs.gnu.org; 18 Oct 2011 14:24:47 +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 1RGAb0-0006o2-R4 for submit@debbugs.gnu.org; Tue, 18 Oct 2011 10:24:47 -0400 Original-Received: from randomsample.de ([83.169.19.17]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGAax-0006nr-0U for 9782@debbugs.gnu.org; Tue, 18 Oct 2011 10:24:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=m73NlHFdxJhK2ZxXemE47xAQ6a8wXZ1cXaGNN1HWT8Q=; b=ISmxZi7ceKkzrsR6ZSubl4XX0+/Raz9Smx49Ly8VAQ1tM/Ilm2L3KNa4IOarcS/7Xg9eQM0Vja6Ue5P6Bw+SPFxJzmWOvAxfTscjxkt10GlyqL6dUbtYZ1KA3Zyg0Ko3; Original-Received: from ibookg4-c2.pc.gwdg.de ([134.76.4.219]) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1RGAa0-0000tW-3R; Tue, 18 Oct 2011 16:23:44 +0200 In-Reply-To: (Eli Zaretskii's message of "Tue, 18 Oct 2011 10:00:11 -0400") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 18 Oct 2011 10:25: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:52791 Archived-At: Eli Zaretskii writes: >> 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? Yes, this would be wrong, obviously. > 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. I can't. My report was motivated by seeing that the tooltip display of company-mode (currently in ELPA) broke due to the change in posn-actual-col-row. Company-mode happens to depend on the above test case, that means it first determines the actual row at point, moves to (1+ row) through move-to-window-line and then displays the overlay there. I don't know why it chooses this way to do this, but it has worked for years, so I figured move-to-window-line has to be fixed. If this new behavior is the correct one, then please close this report and I will send a bug report to the author of company-mode. Thanks, David