From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Clemens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2021 12:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45780 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 45780@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161036870516883 (code B ref -1); Mon, 11 Jan 2021 12:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jan 2021 12:38:25 +0000 Received: from localhost ([127.0.0.1]:55992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kywSn-0004OF-98 for submit@debbugs.gnu.org; Mon, 11 Jan 2021 07:38:25 -0500 Received: from lists.gnu.org ([209.51.188.17]:44244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kywSl-0004O7-DP for submit@debbugs.gnu.org; Mon, 11 Jan 2021 07:38:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kywSk-0005ho-PR for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 07:38:23 -0500 Received: from mout02.posteo.de ([185.67.36.66]:51531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kywSi-0007ZD-Ij for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 07:38:22 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 081FB240103 for ; Mon, 11 Jan 2021 13:38:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1610368696; bh=j9Jv8u3iCSrfqKUGGdWganxxhT/0aKK9S7SL8t2ECQs=; h=To:Subject:From:Date:From; b=P4lnGkXhJxdN5EaaA9itaTprj2N4UeOZwVWr2QOJ8szAeH23d1tEKz15qzMOANvmt OAZ1aJsYiUSD4tKtUyGaWMLldM8ytEEcjQxiMN+wwWu2Fm3aMmt0HYkQvNHWE6NXoZ HqBrNiWCmKdh8alJAL3wotoHtdJRupRtLHxQCFaMqL5vNhbWtkH0PHaeo7EI1GKeB+ +fpPaA53XGQfv9OiBcuwsRWvc5TE8glAla050L/vEBGBWBMSRnb+B0TpuauliVXeBT CsNZIjLTx/So3LPfHG8Jb5XgQuHTqINs0zbOhdkMR7ofowwe62SaMP5oojBCn3tNsR jrO2qA4pCQIBQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DDtXk4jtsz6tmV for ; Mon, 11 Jan 2021 13:38:14 +0100 (CET) From: Clemens Message-ID: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> Date: Mon, 11 Jan 2021 13:38:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------5BA9B8EA9FB8B9B8DA38CC0E" Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=clemera@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------5BA9B8EA9FB8B9B8DA38CC0E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit As per the comment above the affected code, the client can specify the face when prefix and suffix are provided. The prefix is already checked earlier and what remained was checking the suffix not the prefix. There is another thing I would like to bring up in this context: When the annotations returned by annotation/affixation functions already specify a face I think it would be nicer if the completion-annotations face wouldn't be applied generally. In Selectrum we use something like: (if (text-property-not-all 0 (length str) 'face nil str) str (propertize str 'face 'completions-annotations)) This gives the client full control over the visual appearance if that is preferred. Maybe this approach could also make sense to be included in Emacs? Currently for the annotation function the completions-annotations face is always applied and for the affixation function it also still gets applied when the affixation function returns a two candidate list (like read-extended-command--affixation on current master). The case of also allowing a two candidate list to be returned by affixation functions is also currently undocumented. Clemens --------------5BA9B8EA9FB8B9B8DA38CC0E Content-Type: text/x-patch; charset=UTF-8; name="affix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="affix.patch" diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 556f5d3a56..a6afb04efb 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1790,7 +1790,7 @@ completion--insert-strings ;; by the caller via affixation-function, ;; then allow the caller to decide ;; what faces to put on prefix and suffix. - (unless prefix + (unless suffix (font-lock-prepend-text-property beg end 'face 'completions-annotations)))) (put-text-property (point) (progn (insert (car str)) (point)) --------------5BA9B8EA9FB8B9B8DA38CC0E-- From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2021 19:01: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 To: Clemens Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.16103916609435 (code B ref 45780); Mon, 11 Jan 2021 19:01:02 +0000 Received: (at 45780) by debbugs.gnu.org; 11 Jan 2021 19:01:00 +0000 Received: from localhost ([127.0.0.1]:58264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz2R2-0002S6-23 for submit@debbugs.gnu.org; Mon, 11 Jan 2021 14:01:00 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:56497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz2Qz-0002Rm-L5 for 45780@debbugs.gnu.org; Mon, 11 Jan 2021 14:00:58 -0500 X-Originating-IP: 91.129.98.64 Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 3BDAAFF80C; Mon, 11 Jan 2021 19:00:49 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> Date: Mon, 11 Jan 2021 20:38:55 +0200 In-Reply-To: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> (Clemens's message of "Mon, 11 Jan 2021 13:38:13 +0100") Message-ID: <87ft378gjk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hi Clemens, > As per the comment above the affected code, the client can specify the face > when prefix and suffix are provided. The prefix is already checked earlier > and what remained was checking the suffix not the prefix. Shouldn't then this code with font-lock-prepend-text-property be removed completely? Since both prefix and suffix are non-nil, this makes code no-op. > There is another thing I would like to bring up in this context: When the > annotations returned by annotation/affixation functions already specify > a face I think it would be nicer if the completion-annotations face > wouldn't be applied generally. In Selectrum we use something like: > > (if (text-property-not-all 0 (length str) 'face nil str) > str > (propertize str 'face 'completions-annotations)) So you propose to search for the face text-property in the provided string to decide whether to add the default face in completion--insert-strings? > This gives the client full control over the visual appearance if that is > preferred. Maybe this approach could also make sense to be included in > Emacs? Do you see any possible backward-compatibility issues with changing this in Emacs? For example, when a package like Selectrum puts another face on the completion string, then it will be displayed instead of the default completion-annotations face. > Currently for the annotation function the completions-annotations > face is always applied and for the affixation function it also still gets > applied when the affixation function returns a two candidate list (like > read-extended-command--affixation on current master). The case of also > allowing a two candidate list to be returned by affixation functions is > also currently undocumented. Thanks for noticing the documentation problem. Do you think this fix is sufficient: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=affix-doc.patch diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3eca9d066f..227966020c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -122,7 +122,8 @@ completion-metadata returns a string to append to STRING. - `affixation-function': function to prepend/append a prefix/suffix to entries. Takes one argument (COMPLETIONS) and should return a list - of completions with a list of three elements: completion, its prefix + of completions with a list of either two elements: completion + and suffix, or three elements: completion, its prefix and suffix. This function takes priority over `annotation-function' when both are provided, so only this function is used. - `display-sort-function': function to sort entries in *Completions*. @@ -1941,6 +1942,7 @@ completion-extra-properties `:affixation-function': Function to prepend/append a prefix/suffix to completions. The function must accept one argument, a list of completions, and return a list where each element is a list of + either two elements: a completion, and a suffix, or three elements: a completion, a prefix and a suffix. This function takes priority over `:annotation-function' when both are provided, so only this function is used. --=-=-=-- From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Clemens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2021 20:09: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 To: Juri Linkov Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161039568715896 (code B ref 45780); Mon, 11 Jan 2021 20:09:02 +0000 Received: (at 45780) by debbugs.gnu.org; 11 Jan 2021 20:08:07 +0000 Received: from localhost ([127.0.0.1]:58356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz3Tz-00048K-HK for submit@debbugs.gnu.org; Mon, 11 Jan 2021 15:08:07 -0500 Received: from mout01.posteo.de ([185.67.36.65]:36863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz3Tx-00047m-6i for 45780@debbugs.gnu.org; Mon, 11 Jan 2021 15:08:06 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A6BFF16005C for <45780@debbugs.gnu.org>; Mon, 11 Jan 2021 21:07:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1610395678; bh=ApcUXNLVt09YYprXjh3m141ZP0oz8M1ODyUmtDXXgbw=; h=Subject:To:Cc:From:Date:From; b=GgGx5N9136Xe4hW5iCm1x/crdwLHbEw60gSoQu/4LuabocwkSGAnhJEkq+/shVERA YKi1z4pegyROT4pegOszTMKZGbppGwbL9uXb+6J6GgTb0t5kCtuRRJqAT/qo4TEsaB FaeoT5wG1Xsm2oicMKKChVEMuUMLXR2UO+H7zbgG/dis9cRSv6PEPlm5FCEtRBlx+X H4Cdcf92USFJLsGAzpi7UY/NxbP3AIOHjQZrQno+lqjmFLupyXchIAeI9TvmoR9PdX N2tpO1OXNjNyMAf5P3USATOF7XOO9a/2CqtZA7FUccD/n42mFWhVKWluEJzdYK09Rl 7j5tOWywy+D2g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DF4Wf01PQz6tmh; Mon, 11 Jan 2021 21:07:57 +0100 (CET) References: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> <87ft378gjk.fsf@mail.linkov.net> From: Clemens Message-ID: Date: Mon, 11 Jan 2021 21:07:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87ft378gjk.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> As per the comment above the affected code, the client can specify the face >> when prefix and suffix are provided. The prefix is already checked earlier >> and what remained was checking the suffix not the prefix. > > Shouldn't then this code with font-lock-prepend-text-property > be removed completely? Since both prefix and suffix are non-nil, > this makes code no-op. You are right I assumed the suffix can also be nil but looking at the let binding earlier in the code this can't be the case when there is a prefix which is derived from the fact that there is a suffix annotation in the first place :) >> There is another thing I would like to bring up in this context: When the >> annotations returned by annotation/affixation functions already specify >> a face I think it would be nicer if the completion-annotations face >> wouldn't be applied generally. In Selectrum we use something like: >> >> (if (text-property-not-all 0 (length str) 'face nil str) >> str >> (propertize str 'face 'completions-annotations)) > > So you propose to search for the face text-property in the provided string > to decide whether to add the default face in completion--insert-strings? Yes, the strings of the prefix/suffix. >> This gives the client full control over the visual appearance if that is >> preferred. Maybe this approach could also make sense to be included in >> Emacs? > > Do you see any possible backward-compatibility issues with changing this in > Emacs? For example, when a package like Selectrum puts another face > on the completion string, then it will be displayed instead of the default > completion-annotations face. We already do this for annotations/affixations in Selectrum but only based on the face of the annotation/affixation itself, the completion string doesn't affect this. I hope this wouldn't have any visual downsides for old code which assumes the faces get merged but I haven't encountered any cases where code tried to apply custom faces to annotations besides the marginalia package. Letting the client control it makes it easier to configure the display as it's hard to predict what will come out of face merging with the face the user has configured as `completion-annotations` face. This new behaviour could also only be applied for affixation functions to avoid any possibly bad effects of existing code. > Thanks for noticing the documentation problem. Do you think > this fix is sufficient: Looks good to me, too. Thank you! From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jan 2021 18:52:03 +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 To: Clemens Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161047747714552 (code B ref 45780); Tue, 12 Jan 2021 18:52:03 +0000 Received: (at 45780) by debbugs.gnu.org; 12 Jan 2021 18:51:17 +0000 Received: from localhost ([127.0.0.1]:33125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzOlB-0003md-EI for submit@debbugs.gnu.org; Tue, 12 Jan 2021 13:51:17 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:48465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzOl6-0003mD-Jm for 45780@debbugs.gnu.org; Tue, 12 Jan 2021 13:51:15 -0500 X-Originating-IP: 91.129.98.64 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 27E051BF20A; Tue, 12 Jan 2021 18:51:04 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> <87ft378gjk.fsf@mail.linkov.net> Date: Tue, 12 Jan 2021 20:30:54 +0200 In-Reply-To: (Clemens's message of "Mon, 11 Jan 2021 21:07:57 +0100") Message-ID: <8735z6xx11.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> This gives the client full control over the visual appearance if that is >>> preferred. Maybe this approach could also make sense to be included in >>> Emacs? >> Do you see any possible backward-compatibility issues with changing this >> in >> Emacs? For example, when a package like Selectrum puts another face >> on the completion string, then it will be displayed instead of the default >> completion-annotations face. > > We already do this for annotations/affixations in Selectrum but only based > on the face of the annotation/affixation itself, the completion string > doesn't affect this. I hope this wouldn't have any visual downsides for old > code which assumes the faces get merged but I haven't encountered any cases > where code tried to apply custom faces to annotations besides the > marginalia package. Letting the client control it makes it easier to > configure the display as it's hard to predict what will come out of face > merging with the face the user has configured as `completion-annotations` > face. This new behaviour could also only be applied for affixation > functions to avoid any possibly bad effects of existing code. It seems the current logic already supports overriding faces for completion strings: 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): diff --git a/lisp/simple.el b/lisp/simple.el index 4896a282ec..ca308d0bb6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1969,7 +1969,7 @@ read-extended-command--affixation (format " (%s)" (car obsolete))) ((and binding (not (stringp binding))) (format " (%s)" (key-description binding)))))) - (if suffix (list command-name suffix) command-name))) + (if suffix (list command-name "" (propertize suffix 'face 'shadow)) command-name))) command-names))) From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Clemens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jan 2021 18:07: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 To: Juri Linkov Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.16105612101797 (code B ref 45780); Wed, 13 Jan 2021 18:07:02 +0000 Received: (at 45780) by debbugs.gnu.org; 13 Jan 2021 18:06:50 +0000 Received: from localhost ([127.0.0.1]:36530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzkXi-0000Su-Au for submit@debbugs.gnu.org; Wed, 13 Jan 2021 13:06:50 -0500 Received: from mout02.posteo.de ([185.67.36.66]:41601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzkXf-0000Sc-RX for 45780@debbugs.gnu.org; Wed, 13 Jan 2021 13:06:48 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 8F17C2400FF for <45780@debbugs.gnu.org>; Wed, 13 Jan 2021 19:06:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1610561201; bh=TSysYnFAdIOKWKp/bvUIi3PQQgP+ngxtGUuk8YUX4cs=; h=Subject:To:Cc:From:Date:From; b=mQ0PZ99edzUCxKbm5RdyBCA5jMM9Fvol+xOt/2USmnWlwKxyVcHuFGFM1RPb6e/sm P1jaPdMUzanpBmHqpqPO9MmZcrpmlZ0XIuOsG2g8y9T+LFpXepTEL/YADkHrrzX+Mt F5WgtBKo2pqAlsT9/XVelv//8hgCPkL8uejUhQzOrfv5/aafTF8IjGClKooeukRyzl zJGI0QpzG7PN3RQoRg3+G+Z1i69fuHRaaAqMt247tD57g7R7E2eHoJYclcPT8Nyw2a EhjTby4wrXV96vBox0gZCRFEd/4/BXve9dAjNo6SEmUx/9zVA39jvsu/BWhhR/Ohxs taD5VN1YExSkQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DGFkm6W3cz9rxR; Wed, 13 Jan 2021 19:06:40 +0100 (CET) References: <9b1409af-58b9-3a62-4162-343fd25293ca@posteo.net> <87ft378gjk.fsf@mail.linkov.net> <8735z6xx11.fsf@mail.linkov.net> From: Clemens Message-ID: <7763f3e7-475c-9adb-ce62-7801faf47a90@posteo.net> Date: Wed, 13 Jan 2021 19:06:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8735z6xx11.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations 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 To: Clemens Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161061716931090 (code B ref 45780); Thu, 14 Jan 2021 09:40:02 +0000 Received: (at 45780) by debbugs.gnu.org; 14 Jan 2021 09:39:29 +0000 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 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 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) From: Juri Linkov Organization: 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> Date: Thu, 14 Jan 2021 11:00:16 +0200 In-Reply-To: <7763f3e7-475c-9adb-ce62-7801faf47a90@posteo.net> (Clemens's message of "Wed, 13 Jan 2021 19:06:38 +0100") Message-ID: <875z3z50if.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> 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? From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Clemens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2021 17:22:01 +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 To: Juri Linkov Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161064487327990 (code B ref 45780); Thu, 14 Jan 2021 17:22:01 +0000 Received: (at 45780) by debbugs.gnu.org; 14 Jan 2021 17:21:13 +0000 Received: from localhost ([127.0.0.1]:39090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l06J7-0007HO-Fm for submit@debbugs.gnu.org; Thu, 14 Jan 2021 12:21:13 -0500 Received: from mout01.posteo.de ([185.67.36.65]:54421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l06J2-0007H7-6h for 45780@debbugs.gnu.org; Thu, 14 Jan 2021 12:21:12 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 989A9160062 for <45780@debbugs.gnu.org>; Thu, 14 Jan 2021 18:21:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1610644861; bh=awBA0syZAEtybf7jQBs5iEcGj1N61GJ8ecV1PFeIhgo=; h=Subject:To:Cc:From:Date:From; b=G8CCAgrARDEhihgeviLPAs8zoLY17DUqBrra70YjByv6oOZOltymdayqhgrBZOrkd 4+WqTtMyKgJTOgHQ9B8RJzoLGbsXz/Z+TFTALLpWsyFganI59TxDJLEchfWLJzBQmE qYM4DDQZyn8SzU9S36N1QU2d07kfbsN53mvwOJYadP0Cb+UlviYsOsMYoDkHPp4Afe IipjcW7PKsZDVxcdyabh+q7ngeBKg+8vkbmNbBflYAPjiLVsJkLATtSPDYLq/T2D0z lsp7AXG9zdsZbeEAJbWYZIQ75M2uCOnBaUJhyKY4oAQo5Ale8Hw+QEYxd1k5gHbgbU /Iajdi+GHko3w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DGrgc6tBQz6tmL; Thu, 14 Jan 2021 18:21:00 +0100 (CET) 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> <875z3z50if.fsf@mail.linkov.net> From: Clemens Message-ID: <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> Date: Thu, 14 Jan 2021 18:21:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <875z3z50if.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) > 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. I see, personally I think of all strings besides the completions themselves as annotations ;) Makes sense to do it only for the suffix then. > 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? I guess this could also be used, the version I posted earlier only checks for the face property and then also check the whole string: (if (text-property-not-all 0 (length str) 'face nil str) str (propertize str 'face face)) When only the face matters my proposed version might be better? From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2021 19:14: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 To: Clemens Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.16106516026671 (code B ref 45780); Thu, 14 Jan 2021 19:14:02 +0000 Received: (at 45780) by debbugs.gnu.org; 14 Jan 2021 19:13:22 +0000 Received: from localhost ([127.0.0.1]:39272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l083e-0001jX-1i for submit@debbugs.gnu.org; Thu, 14 Jan 2021 14:13:22 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:49485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l083b-0001j9-A3 for 45780@debbugs.gnu.org; Thu, 14 Jan 2021 14:13:20 -0500 X-Originating-IP: 91.129.98.64 Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id C51BBC000E; Thu, 14 Jan 2021 19:13:11 +0000 (UTC) From: Juri Linkov Organization: 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> <875z3z50if.fsf@mail.linkov.net> <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> Date: Thu, 14 Jan 2021 20:59:29 +0200 In-Reply-To: <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> (Clemens's message of "Thu, 14 Jan 2021 18:21:00 +0100") Message-ID: <87h7nj2vla.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> 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. > > I see, personally I think of all strings besides the completions themselves > as annotations ;) Makes sense to do it only for the suffix then. > >> 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? > > I guess this could also be used, the version I posted earlier only checks > for the face property and then also check the whole string: > > (if (text-property-not-all 0 (length str) 'face nil str) > str > (propertize str 'face face)) > > When only the face matters my proposed version might be better? I agree its purpose is quite different from the example above. Then maybe something like this should do what you want: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=completion--insert-strings-text-property-not-all.patch diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 315f2d369a..31d7be3441 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1785,14 +1800,7 @@ completion--insert-strings (when prefix (let ((beg (point)) (end (progn (insert prefix) (point)))) - (put-text-property beg end 'mouse-face nil) - ;; When both prefix and suffix are added - ;; by the caller via affixation-function, - ;; then allow the caller to decide - ;; what faces to put on prefix and suffix. - (unless prefix - (font-lock-prepend-text-property - beg end 'face 'completions-annotations)))) + (put-text-property beg end 'mouse-face nil))) (put-text-property (point) (progn (insert (car str)) (point)) 'mouse-face 'highlight) (let ((beg (point)) @@ -1800,7 +1808,12 @@ completion--insert-strings (put-text-property beg end 'mouse-face nil) ;; Put the predefined face only when suffix ;; is added via annotation-function. - (unless prefix + ;; Otherwise, when only suffix is added + ;; by the caller via annotation-function, + ;; then allow the caller to decide + ;; what faces to put on suffix. + (unless (or prefix (text-property-not-all + 0 (length suffix) 'face nil suffix)) (font-lock-prepend-text-property beg end 'face 'completions-annotations))))) (cond --=-=-=-- From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Clemens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2021 19:44:01 +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 To: Juri Linkov Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161065341117991 (code B ref 45780); Thu, 14 Jan 2021 19:44:01 +0000 Received: (at 45780) by debbugs.gnu.org; 14 Jan 2021 19:43:31 +0000 Received: from localhost ([127.0.0.1]:39330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l08Wp-0004g6-2e for submit@debbugs.gnu.org; Thu, 14 Jan 2021 14:43:31 -0500 Received: from mout02.posteo.de ([185.67.36.66]:60067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l08Wl-0004fr-Ku for 45780@debbugs.gnu.org; Thu, 14 Jan 2021 14:43:28 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4339D2400FD for <45780@debbugs.gnu.org>; Thu, 14 Jan 2021 20:43:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1610653401; bh=mVbWLIt2ksg6S38nmOG6m6ZKmNUidV5ah/a3jhkLcLs=; h=Subject:To:Cc:From:Date:From; b=cQkQ/CdtL9SX37ffoSOoPDHvaiKM6JlZ/9KzS9ugQolR+dummUOwpGKzP1pr5kZSB SeCkGrgbPEUpMm1vNRb/sdumEJmItH3pvwqjLfAmPdXPzeGz1iJ+kUhdU5ThsHnL19 Pc9YlA+aHmhopJJmaAMA/cco55Xx2+sm3TbPaCKPV1fGFKrVQWiEGAwH8mkfU7NNmU zqm1ZLgp5GkaLKRxi0ttqo1Xn+8kTMSMG4Xs9JAXBDpK2J9umwYqkrXC6t9gFEbIx+ 6TbNWUvfvoKmwEe5MwBcGLiqIRLV1YKhvY38nifse78sF8RahVsL0VY+a6clQtSxJX 1pLY2Pxn/bjMw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DGvqr3X9Wz6tmQ; Thu, 14 Jan 2021 20:43:20 +0100 (CET) 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> <875z3z50if.fsf@mail.linkov.net> <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> <87h7nj2vla.fsf@mail.linkov.net> From: Clemens Message-ID: Date: Thu, 14 Jan 2021 20:43:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87h7nj2vla.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) > I agree its purpose is quite different from the example above. > > Then maybe something like this should do what you want: Yes, that would be nice if you also think it would be okay to change it this way, thank you! From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jan 2021 18:38:01 +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 To: Clemens Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161159984321879 (code B ref 45780); Mon, 25 Jan 2021 18:38:01 +0000 Received: (at 45780) by debbugs.gnu.org; 25 Jan 2021 18:37:23 +0000 Received: from localhost ([127.0.0.1]:39897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l46jo-0005gl-6i for submit@debbugs.gnu.org; Mon, 25 Jan 2021 13:37:23 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:58423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l46jm-0005gX-4p for 45780@debbugs.gnu.org; Mon, 25 Jan 2021 13:37:19 -0500 X-Originating-IP: 91.129.98.64 Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 7E0A3E0002; Mon, 25 Jan 2021 18:37:09 +0000 (UTC) From: Juri Linkov Organization: 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> <875z3z50if.fsf@mail.linkov.net> <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> <87h7nj2vla.fsf@mail.linkov.net> Date: Mon, 25 Jan 2021 20:02:51 +0200 In-Reply-To: (Clemens's message of "Thu, 14 Jan 2021 20:43:19 +0100") Message-ID: <87czxsvpd8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> I agree its purpose is quite different from the example above. >> Then maybe something like this should do what you want: > > Yes, that would be nice if you also think it would be okay to change it > this way, thank you! To make sure that everything is right, here is a brief table for coming changes, where overriden-face is a face specified by the client: #+begin_quote | prefix | suffix | overriden-face | result face | |--------+--------+----------------+-------------------------+ | N | Y | N | completions-annotations on suffix | Y | N | N | no face | Y | Y | N | no face | N | Y | Y | overriden-face on suffix | Y | N | Y | overriden-face on prefix | Y | Y | Y | overriden-face on prefix and suffix #+end_quote Or maybe better to represent this as a test: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=completion--insert-strings-faces.patch diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 3ebca14a28..7349b191ca 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -1,4 +1,4 @@ -;;; completion-tests.el --- Tests for completion functions -*- lexical-binding: t; -*- +;;; minibuffer-tests.el --- Tests for completion functions -*- lexical-binding: t; -*- ;; Copyright (C) 2013-2021 Free Software Foundation, Inc. @@ -107,5 +107,23 @@ completion-table-test-quoting nil (length input)) (cons output (length output))))))) -(provide 'completion-tests) -;;; completion-tests.el ends here +(ert-deftest completion--insert-strings-faces () + (with-temp-buffer + (completion--insert-strings + '(("completion1" "suffix1"))) + (should (equal (get-text-property 12 'face) '(completions-annotations)))) + (with-temp-buffer + (completion--insert-strings + '(("completion1" #("suffix1" 0 7 (face shadow))))) + (should (equal (get-text-property 12 'face) 'shadow))) + (with-temp-buffer + (completion--insert-strings + '(("completion1" "prefix1" "suffix1"))) + (should (equal (get-text-property 19 'face) nil))) + (with-temp-buffer + (completion--insert-strings + '(("completion1" "prefix1" #("suffix1" 0 7 (face shadow))))) + (should (equal (get-text-property 19 'face) 'shadow)))) + +(provide 'minibuffer-tests) +;;; minibuffer-tests.el ends here --=-=-=-- From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Jan 2021 19:15:01 +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 To: Clemens Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.16120340558244 (code B ref 45780); Sat, 30 Jan 2021 19:15:01 +0000 Received: (at 45780) by debbugs.gnu.org; 30 Jan 2021 19:14:15 +0000 Received: from localhost ([127.0.0.1]:55823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5vhE-00028q-Az for submit@debbugs.gnu.org; Sat, 30 Jan 2021 14:14:14 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:26945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5vhB-00028X-9i; Sat, 30 Jan 2021 14:14:11 -0500 X-Originating-IP: 91.129.108.204 Received: from mail.gandi.net (m91-129-108-204.cust.tele2.ee [91.129.108.204]) (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id DE2DF240006; Sat, 30 Jan 2021 19:14:01 +0000 (UTC) From: Juri Linkov Organization: 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> <875z3z50if.fsf@mail.linkov.net> <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> <87h7nj2vla.fsf@mail.linkov.net> <87czxsvpd8.fsf@mail.linkov.net> Date: Sat, 30 Jan 2021 21:13:32 +0200 In-Reply-To: <87czxsvpd8.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 25 Jan 2021 20:02:51 +0200") Message-ID: <87eei2p7ab.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 45780 fixed close 45780 28.0.50 thanks >>> I agree its purpose is quite different from the example above. >>> Then maybe something like this should do what you want: >> >> Yes, that would be nice if you also think it would be okay to change it >> this way, thank you! Now the change is pushed to master in commit b32d4bf682. From unknown Sat Aug 16 21:20:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Resent-From: Clemens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jan 2021 09:37:01 +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 fixed To: Juri Linkov Cc: 45780@debbugs.gnu.org Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.16120857866272 (code B ref 45780); Sun, 31 Jan 2021 09:37:01 +0000 Received: (at 45780) by debbugs.gnu.org; 31 Jan 2021 09:36:26 +0000 Received: from localhost ([127.0.0.1]:56429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l699e-0001d6-Ek for submit@debbugs.gnu.org; Sun, 31 Jan 2021 04:36:26 -0500 Received: from mout01.posteo.de ([185.67.36.65]:33869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l699c-0001cs-EH for 45780@debbugs.gnu.org; Sun, 31 Jan 2021 04:36:25 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id B56D1160061 for <45780@debbugs.gnu.org>; Sun, 31 Jan 2021 10:36:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1612085778; bh=MpiPdCr47nPjND/UXBUmhInpvcRTiP9t6l9P7yLn6Rs=; h=Subject:To:Cc:From:Date:From; b=iRcGcIqVn/95PvpLvjRXtH00G1CEoeNyixIiXQfpqeqFPIeOGtzpKsdQ+c3zo4slD mg4S4yoV2Rufj+aFv/ZTlovml40cMpOzWyGCWi9nT+w15AKHWgp7ZqbyL5YrVZhGKa lG7rtJI7t59sxSOHzvc54jsZ3enpJJQZF2kDIk6njPEKM+TNurjzZ4XAUzl3vtVvi4 /wmF/Bg+HvhvI3AusbtS87biwRCXl09pjULG3XeixKNbmxrSnKatWBoW155DNN6iB4 uWovFXotgOI4DUMt+xmwaUj/5KeQkBPZyR1Q3t0ZS+FWb3P6AqSQMSJ34sbrk1YFnW 8G9lvXFREz4xA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DT5YZ2QFxz9rxP; Sun, 31 Jan 2021 10:36:18 +0100 (CET) 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> <875z3z50if.fsf@mail.linkov.net> <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> <87h7nj2vla.fsf@mail.linkov.net> <87czxsvpd8.fsf@mail.linkov.net> <87eei2p7ab.fsf@mail.linkov.net> From: Clemens Message-ID: <6d7f2cf0-0667-630f-18bf-18304f8a4fd1@posteo.net> Date: Sun, 31 Jan 2021 10:36:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87eei2p7ab.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Now the change is pushed to master in commit b32d4bf682. Nice! Thanks, for discussing and implementing it!