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

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Wed, 8 Jul 2015 18:11:02 UTC

Severity: minor

Found in version 25.0.50

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 21012 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21012 <at> debbugs.gnu.org
Subject: Re: bug#21012: 25.0.50;
 eww: last char of a line sometimes not fully visible
Date: Fri, 10 Jul 2015 21:19:18 +0200
Eli Zaretskii <eliz <at> gnu.org> 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.

Ok.

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

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?


Michael.




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.