From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Fill column indicator functionality Date: Tue, 12 Mar 2019 16:29:30 +0100 Message-ID: <20190312152928.73o4b5fk4paz7wm5@Ergus> References: <87sgwvco1l.fsf@Ergus.i-did-not-set--mail-host-address--so-tickle-me> <83r2cel3qf.fsf@gnu.org> <20190211165636.ch5x4wb2ibdt2dzy@Ergus> <83ef8el03u.fsf@gnu.org> <20190308185744.a4vnfoab5wdvqyny@Ergus> <83y35p871q.fsf@gnu.org> <20190309132207.w2ho3j6p5on6fyzw@Ergus> <838sxo87gc.fsf@gnu.org> <20190311104814.kp2nv6arv47hcykz@Ergus> <83y35l4ee0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="123799"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 12 16:29:54 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3jLj-000W3g-Jv for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 16:29:52 +0100 Original-Received: from localhost ([127.0.0.1]:54394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3jLi-0004OA-K9 for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 11:29:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3jLY-0004LN-Gp for emacs-devel@gnu.org; Tue, 12 Mar 2019 11:29:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3jLX-0002zm-Bf for emacs-devel@gnu.org; Tue, 12 Mar 2019 11:29:40 -0400 Original-Received: from sonic312-25.consmr.mail.ir2.yahoo.com ([77.238.178.96]:42683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3jLW-0002yG-Dw for emacs-devel@gnu.org; Tue, 12 Mar 2019 11:29:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1552404576; bh=HfIG1ZIOPZ4KAAyVEmuQK7Xe4fJ13DLoagQ5MMVc9qo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=JSzSfaUJNiKcou6MqJKUozqztHxMMvX68YbEy/BMtvflPVqK5N3auvQInyFMF8F2bd3JzLNyjvc3O4UGqGhVnkI/HOZved0VHBVee+/YeU+mFwPo1+D7AP8PT/0aiB4k7Mken6d3hARvBT7YBn3u9XpNE5Y9oBow5ZN96x+JxGrPEHFWAA3jUj+eBHcATghp017l0l03DelouwcZzlepX+Wv0PPYNbh7Lk/Ak0NN2Qy4lmhQPLgxFyVWhujzAY6HXIyyTj5Dhh5IJnTR7oQFmBSJxT0p3zzsrhZwPYzCPPCvpWki2awm6jOXn8YWr2IgpCGqBf7APEyyOQJ40cAGgg== X-YMail-OSG: uc_Ez9AVM1mDrFDQTL2pXwEHZ20s.o6SvQfALucVZrlTAOxhTYGzrm3PxWHFG7G Y0marizGWX_EIWOAI0fJXxNDQ0lwdv1LNCEHXGK32TIG2qEgcYRHr77qf9k9PPNKLX26fxzOnpf1 VhEaqG7D1KJlPu.ofVshV.oVPy6gNC2E_CyLElFqXKFThAbWpAQ2D9maJ1jC0OzKLcBQS40ERLuZ mV6CclkkJCPrfIloJv7Xb.eVGz6LDLGaHijS6s0b5w.ajLLd1jgkDcGuLhEbmxoFE3K0cnmjWIl8 Anmk8iZy5kEgBgtk4LZHxLmQobnMYxy7yOWRLeOTXeGYxT22swwwEXjnv4sJxe4viJ3d0bOE72aV tvteyENwg3IWGCZxD4wm9EDWGNKMp7DdozY7hQXzXaCE3cWbXtqHs42j2ntlJrHWT6WfGq_zmmT_ YouVtg_.L0YPqI8ihDNSC3rDMKtZh47SweeoSWCiKdl0nIom7JravIfpySc2DuvCzs7gXXnk10mU UQXGde_cLCo79tLv6oh7mKlQcsE8ZmXrVZtqmjwdDTPJ7Cp7Z62cKfhfIfL3dCTjcfklUQGgKoj0 Fpt3d877kCdt4YTMx.gdO4KsXfJzlCZcpo581Ft3RCurdU7FF.T14jw.pyj0_mZp_ZD9SKEFKfUe 1r5Ck7VZ_.J8kviAYN3dw2ZAKitwfmuKnfj3_BsMmPnYLzjWT6bXUbQxbsc_ZCEW3q2MNVlaL2.E _K29vnuEC.gv9DPr8FpjfUpdrXF.MchT1Ucj9148V0TNfjGmpHNUEDQ8Et8bULTslcKG5YKHWwbc hZAaRy53chHWT9fiOZpGenU_OrWfAy6dyXeZgTbNyA Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Tue, 12 Mar 2019 15:29:36 +0000 Original-Received: from 84.88.54.69 (EHLO Ergus) ([84.88.54.69]) by smtp416.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f80d43d515eb8ed475fc66e228922a74; Tue, 12 Mar 2019 15:29:33 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83y35l4ee0.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.178.96 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234101 Archived-At: Hi Eli: Sorry for being so annoying. But this is my first contribution and I am still understanding the details on the way. On Mon, Mar 11, 2019 at 05:30:47PM +0200, Eli Zaretskii wrote: > >I think you are missing this: > > /* If last glyph is a space or stretch, and it's trailing > whitespace, set the face of all trailing whitespace glyphs in > IT->glyph_row to `trailing-whitespace'. */ > if ((row->reversed_p ? glyph <= start : glyph >= start) > && BUFFERP (glyph->object) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > && (glyph->type == STRETCH_GLYPH > || (glyph->type == CHAR_GLYPH > && glyph->u.ch == ' ')) > && trailing_whitespace_p (glyph->charpos)) > >This test is for those stretch glyphs that came from a buffer, >i.e. those generated by TABs and 'space' display properties. But in >your case, the object of the stretch glyph is nil, as specified by the >2nd argument of append_stretch_glyph: > > append_stretch_glyph (it, Qnil, width, > it->ascent + it->descent, stretch_ascent); > >Moreover, I believe you are looking at the wrong code fragment to >explain why trailing-whitespace stopped working. I think the problem >happens a bit earlier, here: > > /* Skip over glyphs inserted to display the cursor at the > end of a line, for extending the face of the last glyph > to the end of the line on terminals, and for truncation > and continuation glyphs. */ > if (!row->reversed_p) > { > while (glyph >= start > && glyph->type == CHAR_GLYPH > && NILP (glyph->object)) > --glyph; > } > I tried: if (!row->reversed_p) { while (glyph >= start && (glyph->type == CHAR_GLYPH || glyph->type == STRETCH_GLYPH) && NILP (glyph->object)) --glyph; } But it didn't work. The behavior is the same: the whitespace is highlighted only when the line is crossed. The other corner case I have is because in graphical mode the space for the dot is always reserved, so when the last character in the line is just before the line, the line is not drawn for that line. I can live with that, but maybe there is a simple fix? In text mode I fixed this changing a while for a do while, but in graphical mode the approach is different. >> 2) What name do you suggest for this mode? I propose >> display-column-indicator. > >display-fill-column-indicator-mode? done. > >Thanks again for working on this. > >P.S. Thanks to you, I just uncovered an old bug, whereby >show-trailing-whitespace didn't work in R2L screen lines, and for the >same reason: the code didn't account for the stretch glyphs inserted >by the display engine at the left edge of such lines. > Best,