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: Mon, 25 Jan 2021 20:02:51 +0200 Organization: LINKOV.NET Message-ID: <87czxsvpd8.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> <875z3z50if.fsf@mail.linkov.net> <4779a90d-a475-0490-7de2-de072efe64f5@posteo.net> <87h7nj2vla.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22096"; 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 Mon Jan 25 19:38:11 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 1l46kd-0005ff-A1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Jan 2021 19:38:11 +0100 Original-Received: from localhost ([::1]:34764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l46kc-0000gt-9c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Jan 2021 13:38:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l46kU-0000gA-6Y for bug-gnu-emacs@gnu.org; Mon, 25 Jan 2021 13:38:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l46kT-0003XS-UD for bug-gnu-emacs@gnu.org; Mon, 25 Jan 2021 13:38:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l46kT-0005he-OA for bug-gnu-emacs@gnu.org; Mon, 25 Jan 2021 13:38:01 -0500 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 45780-submit@debbugs.gnu.org id=B45780.161159984321879 (code B ref 45780); Mon, 25 Jan 2021 18:38:01 +0000 Original-Received: (at 45780) by debbugs.gnu.org; 25 Jan 2021 18:37:23 +0000 Original-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 Original-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 Original-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) In-Reply-To: (Clemens's message of "Thu, 14 Jan 2021 20:43:19 +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:198578 Archived-At: --=-=-= 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 --=-=-=--