[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21012: 25.0.50; eww: last char of a line sometimes not fully visible

From: Michael Heerdegen
Subject: bug#21012: 25.0.50; eww: last char of a line sometimes not fully visible
Date: Fri, 10 Jul 2015 21:19:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> > 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?

I thought this is obvious.

> 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.

I missed that because I always have goal-column -> 0.

> 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?

I don't know.  That's why the last sentences in my message were

But are you sure that `vertical-motion' does not hit that limitation?
For example, AFAIK `vertical-motion' stops at the end of a visual line
if the first arg is a cons cell with COLS larger than available cols in
the line.  How does that work when that line is not displayed somewhere?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]