From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Question about display engine Date: Sun, 08 Sep 2019 20:51:52 +0300 Message-ID: <83imq24qx3.fsf@gnu.org> References: <318675867.1913640.1567711569517.ref@mail.yahoo.com> <318675867.1913640.1567711569517@mail.yahoo.com> <97f66744-8481-084a-ef23-2c50444e1f05@gmx.at> <20190906093117.25qfim4kcrmiqunk@Ergus> <83o8zw5zh8.fsf@gnu.org> <83mufg5yn1.fsf@gnu.org> <20190908005109.s7hhcczkrcbzewdc@Ergus> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="193092"; mail-complaints-to="usenet@blaine.gmane.org" Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 08 19:51:58 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i71Ly-000o4C-4y for ged-emacs-devel@m.gmane.org; Sun, 08 Sep 2019 19:51:58 +0200 Original-Received: from localhost ([::1]:49966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i71Lw-0007Ol-AD for ged-emacs-devel@m.gmane.org; Sun, 08 Sep 2019 13:51:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40584) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i71Lq-0007OT-6E for emacs-devel@gnu.org; Sun, 08 Sep 2019 13:51:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i71Lp-0003x8-OY; Sun, 08 Sep 2019 13:51:49 -0400 Original-Received: from [176.228.60.248] (port=3428 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i71Lo-0006Y9-Vl; Sun, 08 Sep 2019 13:51:49 -0400 In-reply-to: <20190908005109.s7hhcczkrcbzewdc@Ergus> (message from Ergus on Sun, 8 Sep 2019 02:51:10 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:239942 Archived-At: > Date: Sun, 8 Sep 2019 02:51:10 +0200 > From: Ergus > Cc: rudalics@gmx.at, emacs-devel@gnu.org > > Please give a look to the attached patch and check if it is working fine > for you. (I added a new branch "extend_face_id" in savannah too) > > I tried to make it as optimized and less changes as possible from the > beginning. > > In general I added a parameter to handle_face_prop renamed to > handle_face_prop_general (keeping the original name as a wrapper with > the same signature.) > > And the extra parameter is an enum lface_attribute_index. The parameter > is passed from function to function until merge_named_face which checks: > > (attr_filter == 0 || (!NILP (from[attr_filter]) > && !UNSPECIFIEDP (from[attr_filter]))) > > So if we pass zero as the parameter then the merge is unconditional; > else the attribute needs to be non-nil and specified to merge. > > I made it in this way because it is general enough and with low overhead > in case we want to condition the merge for different conditions in > the future. I didn't yet have time to have a close look at the changes, but I can already say that this handle_face_prop_general business I don't like. Passing a pointer to a face ID, like this: +handle_face_prop_general (struct it *it, int *face_id_ptr, + enum lface_attribute_index attr_filter) and then assigning to it via the pointer is gross. Also, the extension code doesn't need to return the HANDLED_NORMALLY value, AFAIU. Instead, it is much cleaner to have a new function with the guts of handle_face_prop, which would _return_ a face ID. Then handle_face_prop would then plug this into it->face_id, and the extension code will do what it needs. Can you make this change, please? > Now the only annoying thing is that when extend is disabled for the > region, the extra space after eol has the same face than the text before > (which for me is fine) but in the terminal it is not added... so I > should ask if you consider correct to add the space in terminal or > remove the extra "colored" space in gui? I vote for the first... but you > say. Yes, the terminal should use the same face as GUI for the first blank after end of line. Thanks.