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: Question about display engine Date: Sun, 8 Sep 2019 20:23:46 +0200 Message-ID: <20190908182346.hheaveun2pw5usb6@Ergus> 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> <83imq24qx3.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="54342"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 08 20:24:10 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 1i71r7-000Dz5-RI for ged-emacs-devel@m.gmane.org; Sun, 08 Sep 2019 20:24:10 +0200 Original-Received: from localhost ([::1]:50060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i71r6-0004Sr-1z for ged-emacs-devel@m.gmane.org; Sun, 08 Sep 2019 14:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i71qy-0004PS-MA for emacs-devel@gnu.org; Sun, 08 Sep 2019 14:24:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i71qw-0006CW-8D for emacs-devel@gnu.org; Sun, 08 Sep 2019 14:23:59 -0400 Original-Received: from sonic304-22.consmr.mail.ir2.yahoo.com ([77.238.179.147]:39295) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i71qv-0006BY-Ox for emacs-devel@gnu.org; Sun, 08 Sep 2019 14:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1567967036; bh=znxRvX66RkvEvpWGiW9dAgHgmmbCGdWI2VmWFZD3oWs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=WneAvai5zuFb2CoX0IhdvMIwDos6IfWCotjfu3F0Fn0V29uFKwkEkv2nZd7ss4a5UYHKKpvgHg6XrQEpEmBPUSM2il6ZkWmYn7rkZWHlrQRchkbZlGE5oUvTwzWuARslTR8sJ/PyGKtXRWF9rdjPcixASzbOcM5kSNU0WTs9q7Iy+hl8lvg4U3AyoOuyS2GlV51daVJ4xUwQ7QJwRe3YQhp2C7yRNmJQJBd+xlI0gPfdX2pg+WMjM6h5ginK/AF8f2HA5iMygGXLPScKe0gtncnz2wNPyS9omX8oA5qCpOAIamzlLpFcRAQXYbo00Fio4A6gwe1o5B8DJfbfARTpiw== X-YMail-OSG: y84U6pwVM1lLJSN9GBQ2OFEOosWrfcrkVtBtbF0W.Zyf9QBnlsb3u72eO9OPyHJ tdvoMhBBlkL7Ubwu0PfE_5Ud.p5g1RK2wuJNCVENQdck9VkS086LHOpRMRvcUE4xQ_gKl7fSQkhE 52cQwkpsf3KSLI0azfT.ebgFMYm4BPBXFJvA3tgjcBFxpjLTkVKhQR1C0T7teQrA9AEDeD_A6M4T N7jAPDPecubDxGOiXPJE_81TombF8ir5ucBR5Egxy2wy96VfU.wjhFLsSMwMKW488uKgjOK8byan PV0CcX8GCqz_kXAOVE0W55x2Z5PnqEEhLiyglZuG5EpV87dKr4eSqxHhYq8OEicY3DK_Ir7q_cdj 9QoQqGIszIfDHxqNnP9Vb4x1AfTZ0ac60mZP5bQjrOwWPgWTXRx0WJx53HNpLyAtdoq3a81l2eNj eXf_xK0nMEzTlKXF7FY6nh_04LHLnMdZ2.EHb1dOps7BGF4rViXX_Ed7nw1ysTZCHYFUcP.beb2R 1AoDr.WqtCK5Mmbin.CY8yJG.r8gJo71M_GSHAdupJ71Cxp.h0AsG67D4cVrf_yLKPn9Zvzmu0__ HhLz06MOWUsERXR9bDJlOcFIT3IjdF8y6LIZCGbJNkn5BDtgP3SatzJOBhqdoVvlV50zVGQ.YMZT 2o62zgUYAr8y_zSa27HeE4x9mozM1JKsJeX4M8_so20cWlDrHIUL34Dq64Ge__91sSOuZnn38OQS rJCaN6CStZo7BvcN67hEddN.9hWHW_kj0D9WrA7llsAWijyxePdAyBx7OXC76mpy04Q.AdpfqaoJ JnLTbCWw71j734AnP_vcVeDu_fK_bH_0ca29QpfhIo Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Sun, 8 Sep 2019 18:23:56 +0000 Original-Received: by smtp416.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID fd4ae05e5041b262a1789c411d2dd689; Sun, 08 Sep 2019 18:23:54 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83imq24qx3.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.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:239945 Archived-At: Hi Eli: I know all that, I was just concerned about functionality and the changes I made in the merge_ref function if they are conceptually right or if they could produce some issues in some use cases that maybe I am ignoring. (specially the method I use to filter.) I implemented this in the face_at_buffer but in the same function there is a face_at_string equivalent... is it possible in some conditions to reach that part of the code at eol? if so I will need to modify that one too... The filter now in merge_ref only works when !CONSP(ref_name). As it only bypass the extra parameter to merge_named... it this right in the general case? I will change that detail you mention and some others in the interface later. But I need to be sure if the filter conditions already implemented are enough. (With the first implementation I learned that functional does not mean right.) On Sun, Sep 08, 2019 at 08:51:52PM +0300, Eli Zaretskii wrote: >> 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.