GNU bug report logs - #74865
[PATCH] Use `completion-table-with-metadata'

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sat, 14 Dec 2024 12:58:02 UTC

Severity: normal

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 74865 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 74865 <at> debbugs.gnu.org
Subject: Re: bug#74865: [PATCH] Use `completion-table-with-metadata'
Date: Mon, 03 Feb 2025 09:50:46 +0200
This change removed affixation-function from another if-branch in 'read-face-name'
for the case when 'multiple' is t that uses completing-read-multiple:

> diff --git a/lisp/faces.el b/lisp/faces.el
> index f8ec0f1a187..05df685c679 100644
> --- a/lisp/faces.el
> +++ b/lisp/faces.el
> @@ -1147,17 +1147,6 @@ read-face-name
>      (let ((prompt (if default
>                        (format-prompt prompt default)
>                      (format "%s: " prompt)))
> -          (completion-extra-properties
> -           `(:affixation-function
> -             ,(lambda (faces)
> -                (mapcar
> -                 (lambda (face)
> -                   (list face
> -                         (concat (propertize read-face-name-sample-text
> -                                             'face face)
> -                                 "\t")
> -                         ""))
> -                 faces))))
>            aliasfaces nonaliasfaces faces)
>        ;; Build up the completion tables.
>        (mapatoms (lambda (s)
> @@ -1180,7 +1169,18 @@ read-face-name
>              (nreverse faces))
>          (let ((face (completing-read
>                       prompt
> -                     (completion-table-in-turn nonaliasfaces aliasfaces)
> +                     (completion-table-with-metadata
> +                      (completion-table-in-turn nonaliasfaces aliasfaces)
> +                      `((affixation-function
> +                        . ,(lambda (faces)
> +                             (mapcar
> +                              (lambda (face)
> +                                (list face
> +                                      (concat (propertize read-face-name-sample-text
> +                                                          'face face)
> +                                              "\t")
> +                                      ""))
> +                              faces)))))
>                       nil t nil 'face-name-history defaults)))
>            (when (facep face) (if (stringp face)
>                                   (intern face)




This bug report was last modified 163 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.