From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Date: Thu, 14 Jan 2021 11:00:16 +0200 Organization: LINKOV.NET Message-ID: <875z3z50if.fsf@mail.linkov.net> References: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> <87ft378gjk.fsf@mail.linkov.net> <8735z6xx11.fsf@mail.linkov.net> <7763f3e7-475c-9adb-ce62-7801faf47a90@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20762"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 45780@debbugs.gnu.org To: Clemens Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 14 10:41:48 2021 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 1kzz8W-0005GH-FE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 10:41:48 +0100 Original-Received: from localhost ([::1]:44302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzz8V-0000Bb-Hr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 04:41:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzz6p-0006lW-Er for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 04:40:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzz6p-0001RG-6L for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 04:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kzz6p-00086R-0q for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 04:40:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2021 09:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45780 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161061716931090 (code B ref 45780); Thu, 14 Jan 2021 09:40:02 +0000 Original-Received: (at 45780) by debbugs.gnu.org; 14 Jan 2021 09:39:29 +0000 Original-Received: from localhost ([127.0.0.1]:37223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzz6G-00085O-JY for submit@debbugs.gnu.org; Thu, 14 Jan 2021 04:39:28 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:42975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzz6E-00084z-NQ for 45780@debbugs.gnu.org; Thu, 14 Jan 2021 04:39:27 -0500 X-Originating-IP: 91.129.98.64 Original-Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 209C31BF205; Thu, 14 Jan 2021 09:39:18 +0000 (UTC) In-Reply-To: <7763f3e7-475c-9adb-ce62-7801faf47a90@posteo.net> (Clemens's message of "Wed, 13 Jan 2021 19:06:38 +0100") 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:197936 Archived-At: >> 1. when only annotation suffix string is provided, then the face >> completion-annotations is added; >> 2. when both prefix and suffix are provided, then the client decides >> what face to add. Also it's possible to provide an empty prefix >> string to be able to specify a custom face for the suffix string. >> So when the client wants to override the default annotation face, >> this is already easy to do using something like (this is not a patch >> to commit, but just demonstration of current abilities): > > I would prefer the more automatic behaviour I proposed as having > completion-annotations face is nice when the client has not thought about > it but when the client has provided a string with a face it is likely the > client wants exactly that face and not a combination with > completion-annotations face. Basing the decision on a provided prefix seems > a bit arbitrary and one would need to figure this out by looking at > the code. Do you want to use the completion-annotations face conditionally only for annotations, i.e. when only the suffix is provided by the client? Because when a prefix is provided as well, then it's not an annotation anymore, so the completion-annotations face is not applicable to prefixes. Doing this is not something new, we already have the same logic in minibuffer-message: (unless (or (null minibuffer-message-properties) ;; Don't overwrite the face properties the caller has set (text-properties-at 0 message)) (setq message (apply #'propertize message minibuffer-message-properties))) Is this logic suitable for completion-annotations?