From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Placing eol glyph (buffer-display-table) before an overlay after-string. Date: Sat, 12 Aug 2017 09:56:26 +0300 Message-ID: <83efshqnol.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1502521047 2485 195.159.176.226 (12 Aug 2017 06:57:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Aug 2017 06:57:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 12 08:57:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgQML-0000Fi-Vq for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2017 08:57:22 +0200 Original-Received: from localhost ([::1]:60522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgQMQ-0005bb-Pa for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2017 02:57:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgQLn-0005bB-67 for emacs-devel@gnu.org; Sat, 12 Aug 2017 02:56:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgQLi-0003lV-5l for emacs-devel@gnu.org; Sat, 12 Aug 2017 02:56:47 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgQLi-0003jV-1d; Sat, 12 Aug 2017 02:56:42 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1373 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dgQLc-0000bP-3C; Sat, 12 Aug 2017 02:56:36 -0400 In-reply-to: (message from Keith David Bershatsky on Fri, 11 Aug 2017 23:14:31 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:217458 Archived-At: > Date: Fri, 11 Aug 2017 23:14:31 -0700 > From: Keith David Bershatsky > > Is it feasible to reverse the order such that the eol glyph is laid before the overlays containing the after-string property? Not really. The Emacs display engine considers a screen line ended at the last glyph before the newline, disregarding the source of that newline, which could be buffer text, a display or overlay string, or a display table. When the display engine finds itself at the end of a screen line, it performs a set of bookkeeping operations and decisions that are important for text layout, and must be done immediately prior to the layout of the next screen line. Displaying anything after that bookkeeping, or somehow deferring this bookkeeping to later, would need extensive changes in what is already very complex piece of code, which handles several important issues, like overflow-newline-into-fringe. Current code assumes that no glyphs are produced on the current screen line after the end-of-line was consumed. > A hint as to the locations (in the C code) where I would start working on reversing the order would be greatly appreciated. There are 2 places: one in display_line, the other move_it_in_display_line_to and move_it_to. In all of those places, look for uses of the macro ITERATOR_AT_END_OF_LINE_P. Once again, I advise against such changes. > If there is a better way to handle this than trying to reverse the order in which things are happening, any insight would be helpful. Something like the workaround you use now: > WORKAROUND: I have been using a custom XPM image of a pilcrow that is the beginning of the after-string, and I change its coloration (foreground/background) as needed. The problem with this approach is that the XPM does not look as good as a native eol glpyh, and the XPM would need to be adjusted depending upon the font and size of the font. Why not use the real pilcrow character, e.g. as display string on the first character of your overlay string?