From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <raaahh@gmail.com>
Cc: emacs-devel@gnu.org, dgutov@yandex.ru
Subject: Re: bug#9782: 24.0.90; move-to-window-line not taking header line into account
Date: Sat, 16 Aug 2014 11:03:44 +0300 [thread overview]
Message-ID: <83oavkeu8v.fsf@gnu.org> (raw)
In-Reply-To: <53EE98D8.5010605@gmail.com>
> Date: Sat, 16 Aug 2014 03:33:44 +0400
> From: Dmitry Gutov <raaahh@gmail.com>
> CC: emacs-devel@gnu.org
>
> On 05/07/2013 09:19 PM, Dmitry Gutov wrote:
> > On 07.05.2013 20:50, Eli Zaretskii wrote:
> >>> I mean fixing the row number <-> line number discrepancy from the other
> >>> side, by making a wrapper for `move-to-window-line', the only function
> >>> of the bunch that deals with line numbers. It's used in
> >>> `company-pseudo-tooltip-show'.
> >>
> >> count-screen-lines also deals with line numbers.
I don't see this part in the bug discussion. Where did it take place?
> Now we've used the following function to get the current line number,
> for a while:
>
> (defun company--row (&optional pos)
> (save-excursion
> (when pos (goto-char pos))
> (count-screen-lines (window-start)
> (progn (vertical-motion 0) (point)))))
>
> It has a fundamental problem: it doesn't deal well with `display'; this
> is most apparent in the `M-x report-emacs-bug' buffer, leading to bugs
> like this: https://github.com/company-mode/company-mode/issues/136
>
> The actual behavior is a bit different in my Emacs compared to the
> screenshot, but the problem is there.
>
> Since `vertical-motion' doesn't jump into the "virtual" text inside the
> multiline `display' property, `company--row' returns lower values than
> it should. `move-to-window-line' takes multiline `display' into account
> just fine, so (move-to-window-line (company--row)) might move to a
> different line than the point is at.
>
> Do you have any further suggestions? Should we revert to using
> `posn-col-row'?
If the only problem with posn-col-row is that it errs by one when
there's a header line, adding one in that case sounds like an easy way
out.
next prev parent reply other threads:[~2014-08-16 8:03 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
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 [this message]
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=83oavkeu8v.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=raaahh@gmail.com \
/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.