From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#42552: 28.0.50; Overlay 'face' property doesn't set the "underlying face" for 'after-string' Date: Fri, 7 Aug 2020 02:16:12 +0300 Message-ID: <7e9af86a-961e-8afd-0d62-0a1c79b96b40@yandex.ru> References: <46466541-6185-2bf3-87cc-b28c71fe69e7@yandex.ru> <838sf6gkvq.fsf@gnu.org> <83wo2ldrqb.fsf@gnu.org> <831rknbwb9.fsf@gnu.org> <831rkl9m1e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6776"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: 42552@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 07 01:17:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3p8I-0001cs-Q2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Aug 2020 01:17:10 +0200 Original-Received: from localhost ([::1]:53640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3p8H-0005e5-Bl for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Aug 2020 19:17:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3p8A-0005dy-KP for bug-gnu-emacs@gnu.org; Thu, 06 Aug 2020 19:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3p8A-0001JN-BQ for bug-gnu-emacs@gnu.org; Thu, 06 Aug 2020 19:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k3p8A-0006ql-2H for bug-gnu-emacs@gnu.org; Thu, 06 Aug 2020 19:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Aug 2020 23:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42552 X-GNU-PR-Package: emacs Original-Received: via spool by 42552-submit@debbugs.gnu.org id=B42552.159675578426283 (code B ref 42552); Thu, 06 Aug 2020 23:17:02 +0000 Original-Received: (at 42552) by debbugs.gnu.org; 6 Aug 2020 23:16:24 +0000 Original-Received: from localhost ([127.0.0.1]:55117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3p7Y-0006pr-J9 for submit@debbugs.gnu.org; Thu, 06 Aug 2020 19:16:24 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:39259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3p7V-0006pc-81 for 42552@debbugs.gnu.org; Thu, 06 Aug 2020 19:16:23 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id a5so35563908wrm.6 for <42552@debbugs.gnu.org>; Thu, 06 Aug 2020 16:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WcRNfUNX9PZEJyYPJnuuHzeLVfKfQqWLfiaqtXsAqvU=; b=XcIglk3Rc4LWfKzDNt1QnyLb44bqPfeUUq2dIhP9VHi274QlEkDv5Jxau0IYUZqgcl 3s+agqQPQ7y+KzjVSd5SatTXK1rCJrekIOBajpewwZoHzNXLRpDF2mMVvawtXKyFWuxG NfcuZXTQJIRwX6+KNFVp05rVHhYuVUGsidg3FYZV98ADMa2rX5+YvEaFNTHFqePmtCO3 5P7VhofudUJw74cvg5lLg/hm7SwfDgsaie16DJkNQM4JgH6EAjPc87AqJlYT6F2rs+SH SjWAQZa9lrIK/2pbqDu/UA+dKZ+6lQAOQFTZT3za2TEJYJeLXCCzoSpKSFhAKPer+Sgs CuWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WcRNfUNX9PZEJyYPJnuuHzeLVfKfQqWLfiaqtXsAqvU=; b=kWanUiSHqfXHp18zwIyaTbPKpYxi6wx5KpcfhdvMMZsTdCIJq8i9PyDIRcdqJHiioW WMSV+fdJLljI1QeGsw9O5SDcBCxuOGwwpjcAJkVYEJ3R7ML9JBgwHtVTJSwXez//WAGV fLjpRkuWf586y7jOq5czAGIE49L9sOSmoGalS+gD0QzWu+dFbgskYHHXm42g4SINERPD VFIWkfNHDQei2W6SGOctA0jJcgZ+I+YdEUn7v01yTkmpY+kFINux8aM/5kcPHKSRHcer VncIswe4vU71dPd7gKcYrQsYzcqDqn+D68kcXWzEeibtrf0gCcXoVOszh8rJ1B1GFzc1 bBSA== X-Gm-Message-State: AOAM531/nVkr+HN4zUef0x1Ilec6O8XVWTl9VRpFxujzC21yqJjvWUQz ORROrS+Vibl0haDDUqcGRKRHlDbw X-Google-Smtp-Source: ABdhPJw6JzURsUc/HEc+n0jJBhK8/Jyv38fcc0amsJXo3QRD6PVrp2e2FqzysZs1xMte4fpMWoPSYQ== X-Received: by 2002:a5d:6806:: with SMTP id w6mr9288833wru.244.1596755774891; Thu, 06 Aug 2020 16:16:14 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id y84sm8312179wmg.38.2020.08.06.16.16.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Aug 2020 16:16:14 -0700 (PDT) In-Reply-To: <831rkl9m1e.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184215 Archived-At: On 05.08.2020 17:58, Eli Zaretskii wrote: >> Should the "overlay string" obey the underlying face, though? It doesn't >> obey the 'face' property, like you explained. Seems inconsistent. > > Emacs always worked this way, so changing it now is probably a big > deal. AFAIU, the reason for this behavior is so that overlay strings > which specify no faces use the same face as the surrounding text. > Which sounds reasonable. Do you imagine creating a better consistency the other way (by having the 'face' property affect overlay strings) would be as likely to create problems? >>> Emacs 26 and before simply extended the face of the last character of >>> the line. Emacs 27 doesn't do that, it examines the faces in effect >>> anew, filtering out those which don't have the :extend attribute set, >>> so the result is different. This is exactly the change in behavior >>> that was intended, not a bug. >> >> But it should obey :extend set to nil, shouldn't it? > > It does, but :extend nil doesn't override :extend t, it just says that > the face with a nil :extend attribute should not be considered when > computing the face for the empty space past EOL. BTW, are there other attributes with a similar property? For example, I find that I have to add (:inverse-video nil) explicitly to the computed face which would be appended to the overlay string's 'face' properties. Otherwise, the newlines are still "extended" with the "inverse video" effect. Try this for an example: 1. Eval: (with-silent-modifications (insert (propertize "abc" 'font-lock-face '((:background "green" :extend t) default ( :inverse-video t :foreground "yellow" :extend t))))) 2. C-j The "extended" newline is yellow. >> That seems to work. It also has the significant benefit on working in >> Emacs 27, so if that's the approach you recommend in the end, the fix >> you already pushed to master might be unnecessary. > > The fix I pushed might not be necessary for company's sake, but it is > necessary for other use cases, because without it we don't behave as > documented when :extend attribute is not present: we extend using the > wrong background color. All right, thank you. I'll try to implement this all as suggested, and will come back after.