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: Sat, 9 Mar 2019 14:22:09 +0100 Message-ID: <20190309132207.w2ho3j6p5on6fyzw@Ergus> References: <20190206222524.zic6idgs2vkglg7h@Ergus> <8736p0nznz.fsf@tcd.ie> <837eebsmaj.fsf@gnu.org> <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> 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="124843"; 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 Sat Mar 09 14:24:19 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 1h2bxb-000WOj-6n for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2019 14:24:19 +0100 Original-Received: from localhost ([127.0.0.1]:58832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2bxa-0004RP-7N for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2019 08:24:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2bvg-0003SW-KD for emacs-devel@gnu.org; Sat, 09 Mar 2019 08:22:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2bvf-0000FL-NI for emacs-devel@gnu.org; Sat, 09 Mar 2019 08:22:20 -0500 Original-Received: from sonic304-22.consmr.mail.ir2.yahoo.com ([77.238.179.147]:39419) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2bve-0000CG-LF for emacs-devel@gnu.org; Sat, 09 Mar 2019 08:22:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1552137733; bh=W93xAQvlam+XcJp9TrPnwGXwY2X2/k/GlVMEMngZn4o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=c9EsGhb65dAMrMIcCtMaxUKeURsJDj/GDJiEZK2U1yUWQOtuYq2hZ2OH2jaX9MZZ1+o2NxVLorq5N27d1YI9hzG6pGX9AMdQmhwxO8lFAXJWHhZyuyXDp8Q/z6rQtcRrTtOSMBL6lofUdE7ZozMIw4RFzviB8xqvN6KBV2x5DoNsN1z3IJoMpBYJ9xxkJ1pP+P8o0NQ+5fY6un8WF0NYZASyzza7c3L3Rmodj1gAomsY6qRrNhBnP1+UmPNkpuM9Ldwp2JGvf2Y3zQpdjZVpKYDq2k13t95Su4qn+jimeBozzI7U6ZgSnLGy6TqnmYwVoKvnGi1eqPBifH6eYqbztQ== X-YMail-OSG: xbl0o0IVM1kD1d9WBcpR2dSObzuwPWie_.bEYKO1rEFOOoaH_ZrdaRH.kPqBajT _nP19ezC6hT08OBDe_nL.XSNi0cTUf0x3MdSOI5UvmOPeqsdhPQ2usKP6O0Zo1RSxsDJHXOlDZa0 JisP8BzOLDWT2hlgNX7ETLf.TF4wgV_17cr.w27IxcatPs1M1PAKx1N7ptspAOwFEbiuCnLmmHVI A6NrXIFCQgeumeFx3lhv8B1098AymTsK1XpTr_Ea1c2RUe_WQTrMtways4eeww2a533aL9GcU2Eb 2ZuUCpv.tYEDO2DWZXcvm8TXoGQeoR0dKRWBnmTLzSjAhg0KemqKVhPJe1EJCOJCZtyTmsIIKwmS WkClPPxdYDixdNF7oR2PjobXVvoguBd_emU9LQu5CmO11ekDm1CwHgkYugJ6wN2GE2irrd__y9PG fsxCWAxleMINTzK0W9fzSomS2gAZM7IORGB68laTGOwvgb1uNigIQAWyGqaH.vaHfpcDsXjAp3SM oA2rHP7ga82GaDw0DUzU3mnoGAzIctd6X8YUKJYcFTzAfDugnnTAEqQZNlUoVydM0IqMxvQoQKGK zSlfpdGlwA57lMlptNTYPqnlT5TeY1qgr8Do1WAAo6IL3aWdGNdHrmYjqRmFiId40t7i42IJGZyB 96GZk._y2XU60HikVx_6oqujC02zEpHGC4tZGSc0m0WCl3IliaxPFCwwl1TGBXFqLjZq5Ln6Y1FK cniAWAlWPzRiVQAp.UT_zPPyFZDk0Qimzk7G19ssbfYLZj32sp_p5swkiqwZ7kRSN4nLqHeQI.8q ObovPZniBCTrasQj1yqdj27737Xv8IDT8rchGalDqV Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Sat, 9 Mar 2019 13:22:13 +0000 Original-Received: from 2.152.205.184.dyn.user.ono.com (EHLO Ergus) ([2.152.205.184]) by smtp414.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0bb8b2770add46904fc4e7972609cf3d; Sat, 09 Mar 2019 13:22:12 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83y35p871q.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.179.147 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:233963 Archived-At: On Fri, Mar 08, 2019 at 10:06:41PM +0200, Eli Zaretskii wrote: >> Date: Fri, 8 Mar 2019 19:57:46 +0100 >> From: Ergus >> Cc: emacs-devel@gnu.org >> >> I have been playing with the display engine in order to try to implement >> this functionality (at least a proof of concept). But after reading the >> comments and the ~33E3 lines in xdisp.c there are more questions now >> than answers. > >Feel free to ask the questions here. > >> The simplest approach I see is to add a '|' (or similar) in the desired >> column in the "at_end_of_line:" label. But maybe there is a better >> approach? > >You are on the right track. But I'd suggest to do this inside the >function extend_face_to_end_of_line. It is called near that label, >but you will see that it's called in several more places; I expect at >least some of them to need the same changes. > Hi Eli, I just finished a working version (pretty simple as a proof of concept). That works in terminal mode. But in graphical mode we should look for another approach because extend_face_to_end_of_line returns in: if (FRAME_WINDOW_P (f) && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) && face->box == FACE_NO_BOX && FACE_COLOR_TO_PIXEL (face->background, f) == FRAME_BACKGROUND_PIXEL (f) #ifdef HAVE_WINDOW_SYSTEM && !face->stipple #endif && !it->glyph_row->reversed_p) return; So it don't write until the line end. In graphical mode maybe it is better to do this change writing directly a vertical line in the windows' frame background. That way it will be maybe more efficient because we only do it once. But I don't know if this is possible-recommended. Else, we can follow a similar approach than in terminal version and generate a glygh for that cases. What do you think? BTW: Is it possible to generate a single wider glyph instead of doing a loop?. The glyph concept is actually not clear for me yet, specially in graphical mode. >> My approach is somehow based on the display_line_numbers, but taking >> into account that in this case the characters are always the same, maybe >> there is a way to set them in the background and it will be simpler? > >Simpler than what? Can you tell what kind of complexity did you want >to avoid? > >Display of line numbers needs to calculate the number of each screen >line, and that of course is not needed in this case. You just need >to calculate the width of a stretch glyph that will display as >whitespace between the end of the line and the fill column. You will >see that extend_face_to_end_of_line already does something similar in >the case of R2L lines. > >> Is it there any documentation about this? > >Maybe, but to point you to it I need to understand what "this" means >in this context. > >> specially the relations between the data structures? > >Which data structures? there are quite a few of them, so please be >more specific. > glyph <-> it: why this looks so complex? Because "it" has too many properties I can't understand their functionalities and sometimes I think I could reinvent the wheel. >> because the it and the glyphs are very confusing. > >Feel free to ask any questions about these two, especially about what >confuses you. > >> Any help please? > >I'm here to help. > >And thanks for working on this. > Thanks to you.