GNU bug report logs -
#45780
28.0.50; [PATCH] Face used for affixation function annotations
Previous Next
Reported by: Clemens <clemera <at> posteo.net>
Date: Mon, 11 Jan 2021 12:39:02 UTC
Severity: normal
Tags: fixed, patch
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #32 received at 45780 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>> 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:
[completion--insert-strings-faces.patch (text/x-diff, inline)]
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
This bug report was last modified 4 years and 113 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.