GNU bug report logs -
#21012
25.0.50; eww: last char of a line sometimes not fully visible
Previous Next
Full log
View this message in rfc822 format
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: 21012 <at> debbugs.gnu.org
> Date: Fri, 10 Jul 2015 20:04:43 +0200
>
> Can't we find the position of the last completely visible char of a
> line with
>
> --8<---------------cut here---------------start------------->8---
> (save-excursion
> (let ((truncate-lines nil))
> (when (line-move-visual +1 t)
> (backward-char 1))
> (point)))
> --8<---------------cut here---------------end--------------->8---
I'd prefer to exchange ideas rather than code that I need to second
guess. So what's the idea behind this?
Is the idea to turn off truncate-lines and thus avoid partially
visible characters at end of line? If so, how do you find the last
visible character? Doing what you suggest above won't work with
bidirectional text, where (backward-char 1) from the leftmost
character of a visual line doesn't necessarily put you on the last
character of the previous visual line. I think you need to let-bind
visual-order-cursor-movement to t and invoke left-char instead.
Next, line-move-visual will only move to the leftmost character of the
next line if you are already on the leftmost character of the current
line, so you'd need to make that happen first. Not hard to do, but
should be part of the code, or maybe I'm missing something.
Finally, portions of line-move-visual and its subroutines only work
when the line is visible in some window, so won't that again hit the
same limitation of posn-at-point?
Thanks.
This bug report was last modified 9 years and 290 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.