From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21012: 25.0.50; eww: last char of a line sometimes not fully visible Date: Fri, 10 Jul 2015 21:45:17 +0300 Message-ID: <837fq7c0n6.fsf@gnu.org> References: <87twteh65g.fsf@web.de> <83d202v2m2.fsf@gnu.org> <87wpya5rey.fsf@web.de> <83a8v6ukbe.fsf@gnu.org> <834mlduyz8.fsf@gnu.org> <87egkh3xl3.fsf@web.de> <83pp40blcq.fsf@gnu.org> <874mlcgoka.fsf@web.de> <83bnfkb1rs.fsf@gnu.org> <87pp40nlnj.fsf@web.de> <838uaoax9a.fsf@gnu.org> <87fv4vsxc4.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1436553987 22375 80.91.229.3 (10 Jul 2015 18:46:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 18:46:27 +0000 (UTC) Cc: 21012@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 10 20:46:09 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZDdJJ-0005OT-KM for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 20:46:09 +0200 Original-Received: from localhost ([::1]:45817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDdJJ-0001dT-54 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 14:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDdJF-0001dO-UP for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 14:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDdJC-0003Uj-G4 for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 14:46:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDdJC-0003Uf-Cc for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 14:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZDdJB-0002fX-Vv for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 14:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jul 2015 18:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21012 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21012-submit@debbugs.gnu.org id=B21012.143655392710179 (code B ref 21012); Fri, 10 Jul 2015 18:46:01 +0000 Original-Received: (at 21012) by debbugs.gnu.org; 10 Jul 2015 18:45:27 +0000 Original-Received: from localhost ([127.0.0.1]:46409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDdIc-0002e7-SC for submit@debbugs.gnu.org; Fri, 10 Jul 2015 14:45:27 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:48238) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDdIa-0002dh-Tr for 21012@debbugs.gnu.org; Fri, 10 Jul 2015 14:45:26 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NRA00M00BL7F700@mtaout27.012.net.il> for 21012@debbugs.gnu.org; Fri, 10 Jul 2015 21:42:06 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NRA00E1TBY6DR80@mtaout27.012.net.il>; Fri, 10 Jul 2015 21:42:06 +0300 (IDT) In-reply-to: <87fv4vsxc4.fsf@web.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104897 Archived-At: > From: Michael Heerdegen > Cc: 21012@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.