unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Clemens <clemera@posteo.net>
Cc: 45780@debbugs.gnu.org
Subject: bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations
Date: Mon, 25 Jan 2021 20:02:51 +0200	[thread overview]
Message-ID: <87czxsvpd8.fsf@mail.linkov.net> (raw)
In-Reply-To: <e95840ad-5914-b5e2-8960-fc9b32983d43@posteo.net> (Clemens's message of "Thu, 14 Jan 2021 20:43:19 +0100")

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: completion--insert-strings-faces.patch --]
[-- Type: text/x-diff, Size: 1477 bytes --]

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

  reply	other threads:[~2021-01-25 18:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 12:38 bug#45780: 28.0.50; [PATCH] Face used for affixation function annotations Clemens
2021-01-11 18:38 ` Juri Linkov
2021-01-11 20:07   ` Clemens
2021-01-12 18:30     ` Juri Linkov
2021-01-13 18:06       ` Clemens
2021-01-14  9:00         ` Juri Linkov
2021-01-14 17:21           ` Clemens
2021-01-14 18:59             ` Juri Linkov
2021-01-14 19:43               ` Clemens
2021-01-25 18:02                 ` Juri Linkov [this message]
2021-01-30 19:13                   ` Juri Linkov
2021-01-31  9:36                     ` Clemens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czxsvpd8.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=45780@debbugs.gnu.org \
    --cc=clemera@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).