all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: David Engster <deng@randomsample.de>
Cc: 9782@debbugs.gnu.org
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	[thread overview]
Message-ID: <E1RGADD-0008JI-Ht@fencepost.gnu.org> (raw)
In-Reply-To: <m2hb361p8e.fsf@ibookg4-c2.pc.gwdg.de> (message from David Engster on Tue, 18 Oct 2011 14:03:13 +0200)

> From: David Engster <deng@randomsample.de>
> 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.





  reply	other threads:[~2011-10-18 14:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18 12:03 bug#9782: 24.0.90; move-to-window-line not taking header line into account David Engster
2011-10-18 14:00 ` Eli Zaretskii [this message]
2011-10-18 14:23   ` David Engster
2011-10-18 16:00     ` Eli Zaretskii
2013-05-04 21:12       ` Dmitry Gutov
2013-05-05  2:47         ` Eli Zaretskii
2013-05-05  2:59           ` Dmitry Gutov
2013-05-05 15:53             ` Eli Zaretskii
2013-05-06  3:38               ` Dmitry Gutov
2013-05-06 16:38                 ` Eli Zaretskii
2013-05-07  1:26                   ` Dmitry Gutov
2013-05-07  2:54                     ` Eli Zaretskii
2013-05-07  7:41                       ` Dmitry Gutov
2013-05-07 16:50                         ` Eli Zaretskii
2013-05-07 17:19                           ` Dmitry Gutov
2014-08-15 23:33                             ` Dmitry Gutov
2014-08-16  8:03                               ` Eli Zaretskii
2014-08-16  8:27                                 ` Dmitry Gutov
2014-08-16 11:12                                   ` Eli Zaretskii
2014-08-19  4:51                                     ` Dmitry Gutov

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

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

  git send-email \
    --in-reply-to=E1RGADD-0008JI-Ht@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=9782@debbugs.gnu.org \
    --cc=deng@randomsample.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.