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#23574: 24.5; Overzealous underlining in emacs-nox Date: Fri, 10 Jun 2016 17:24:39 +0300 Message-ID: <83eg85p1eg.fsf@gnu.org> References: <83porxwg1f.fsf@gnu.org> <83d1nxudrb.fsf@gnu.org> <83wpm3tyvn.fsf@gnu.org> <83twh7tt83.fsf@gnu.org> <83r3cbt5l3.fsf@gnu.org> <83h9d6tl3j.fsf@gnu.org> <5755AACE.8030303@gmx.at> <831t4ataep.fsf@gnu.org> <57568F86.8040902@gmx.at> <83eg89roam.fsf@gnu.org> <5757BC3A.5070402@gmx.at> <83lh2fr4pt.fsf@gnu.org> <57592B18.2030808@gmx.at> <83bn3ar1k3.fsf@gnu.org> <575A6932.70908@gmx.at> <83r3c5piq0.fsf@gnu.org> <575A793E.7090302@gmx.at> <83k2hxpe3a.fsf@gnu.org> <575AC7CD.1030506@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1465568726 4591 80.91.229.3 (10 Jun 2016 14:25:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 14:25:26 +0000 (UTC) Cc: 23574@debbugs.gnu.org, john.b.mastro@gmail.com, cwoodbury@azavea.com, npostavs@users.sourceforge.net To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 10 16:25:14 2016 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 1bBNN3-0001cz-Jl for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jun 2016 16:25:13 +0200 Original-Received: from localhost ([::1]:41387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBNN2-0003OF-Tx for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jun 2016 10:25:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBNMw-0003Mh-KQ for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2016 10:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBNMs-0005Nh-BD for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2016 10:25:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBNMs-0005Nd-8C for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2016 10:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bBNMs-0001hm-4M for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2016 10:25: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 Jun 2016 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23574 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 23574-submit@debbugs.gnu.org id=B23574.14655686556495 (code B ref 23574); Fri, 10 Jun 2016 14:25:02 +0000 Original-Received: (at 23574) by debbugs.gnu.org; 10 Jun 2016 14:24:15 +0000 Original-Received: from localhost ([127.0.0.1]:35906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBNM7-0001gh-0T for submit@debbugs.gnu.org; Fri, 10 Jun 2016 10:24:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBNM5-0001gT-3H for 23574@debbugs.gnu.org; Fri, 10 Jun 2016 10:24:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBNLy-00052Z-SX for 23574@debbugs.gnu.org; Fri, 10 Jun 2016 10:24:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBNLs-00051N-Tl; Fri, 10 Jun 2016 10:24:00 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4575 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bBNLq-0008T4-Hw; Fri, 10 Jun 2016 10:23:59 -0400 In-reply-to: <575AC7CD.1030506@gmx.at> (message from martin rudalics on Fri, 10 Jun 2016 15:59:41 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:119383 Archived-At: > Date: Fri, 10 Jun 2016 15:59:41 +0200 > From: martin rudalics > CC: npostavs@users.sourceforge.net, 23574@debbugs.gnu.org, > john.b.mastro@gmail.com, cwoodbury@azavea.com > > I meant the time overhead to find each newline (or the character before > it) in the buffer and put the property on it. If they decide to do this, they get what they deserve, no? > > Yes, a few. Look at the comments at the beginning of 'struct glyph' > > definition in dispextern.h. > > These ones > > glyph standing for newline at end of line 0 > empty space after the end of the line -1 > overlay arrow on a TTY -1 > ... > > ? Yes. > >> Is there any other way to get the size of the empty space after text > >> on each row? > > > > "Other way"? other than what? > > Other than subtracting the pixel_width from the window text width. I > obviously want to just retrieve a calculated value, not recalculate it. I guess that's the natural way, yes. Of course, you can only use it when the display is up to date, otherwise the glyph matrix cannot be trusted, and you need the move_it_* functions instead. > >> > row->pixel_width is computed in compute_line_metrics, > >> > after the stretch glyph (and any other glyphs needed for line display) > >> > were already inserted. compute_line_metrics doesn't care about what > >> > glyphs are there, it counts them all. > >> > >> Hmm... How would I get the width of that stretch glyph then? > > > > It's recorded in the glyph's pixel_width. > > So for R2L text to get the width of the empty space on the left of a row > I have to calculate the pixel_width of the leftmost character on that > row. Something like the following for a given row? > > struct glyph *glyph = row->glyphs[TEXT_AREA]; > width = glyph->pixel_width; Yes, modulo the usual caveats of hscroll etc.