From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74362: 31.0.50; Add completions for font names Date: Thu, 14 Nov 2024 17:48:54 -0500 Message-ID: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18119"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca To: 74362@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 14 23:50:31 2024 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 1tBifW-0004aD-Bk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Nov 2024 23:50:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBifC-0007Fo-Fm; Thu, 14 Nov 2024 17:50:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBifA-0007E4-RN for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 17:50:08 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBif6-0001h3-7P for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 17:50:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=kDeD+/QxTT80vFhn836Ou8ZpnOo8LRi72mpgZiR4Dzs=; b=Z9FwxSu/4chghVw9tT2BItns4MqJFjxnTjgOxmvEMoPNdYnBu9KwyD7PZWFEly+O8fgPoHyAVbyAB0aty2JdIjFtp7ctm11h7ihuMGExGlpXASgrCqIShclfCQzTvDEm5w/sEUWIU2i46l/bFRWrNf3jLKbhOvHkzJmMU9hvZ4FOOfvrVqgrE9FHtdNFWvA9CrPleZrsjAiU/S5pjCj4MAyBaNBGW3T10203BDyaodNgyibJmeU65U9Hfzg3pq9zg+jbiJF2Bd1NcSt42yCwRWs7ytF9tq/p8PTIQCAtxPsBcSUhCue/n68Nu4KCuXx5ABq4+xyPhUozHHUtdVDecw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBif4-0000CF-2v; Thu, 14 Nov 2024 17:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2024 22:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74362 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.1731624545675 (code B ref -1); Thu, 14 Nov 2024 22:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2024 22:49:05 +0000 Original-Received: from localhost ([127.0.0.1]:47663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBie8-0000Ap-S2 for submit@debbugs.gnu.org; Thu, 14 Nov 2024 17:49:05 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBie6-0000Af-BL for submit@debbugs.gnu.org; Thu, 14 Nov 2024 17:49:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBie5-00077r-Aj for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 17:49:01 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBie3-0001LI-4T for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 17:49:00 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E221C100180 for ; Thu, 14 Nov 2024 17:48:55 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731624535; bh=LYs2GwjhZg2qm7lbbxgzdVTN0VdPCWKukBhTrcP7v5M=; h=From:To:Subject:Date:From; b=b41x12lME95+g0wupyswmNxX5Pd16+JyzFzNG4SniFx9tn1AU0a8WZHXWMbYIolwv UkcuO93mxbTQasGxHDmnWF2LxC4GPGLkcHeC0RNWQbPeSgHTF+13vOQmzl2dg2Q8Zu yH+s+qRS0KTPveEbJKHYe8uoyMWnX6dIR6KGEH24txBIQAB1cvNtVrhJgd4eOX9wuy T34QIe2w364lu3NG0aMbnbFPcByYxkoKt2ISTfKlT/EMTf5D6cGGpOfHYxRusoVh14 7PDIjE4elaE13bgU5n4Kd4YRC+rXE2wcxdAH3QSUllMV/jwiDIW1hIsxYFAig46Jbv 6L3KfnHtgNaOQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0EBB5100043 for ; Thu, 14 Nov 2024 17:48:55 -0500 (EST) Original-Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EC6041202F2 for ; Thu, 14 Nov 2024 17:48:54 -0500 (EST) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295373 Archived-At: Package: Emacs Version: 31.0.50 In the UI of `customize-face`, the font family name is the main one that provides no help to fill it. The simple patch below provides completion (I had to put the completion function in `cus-edit.el` because of a circularity between `cus-face.el` and `minibuffer.el` so we can't call `completion-table-dynamic` while loading `cus-face.el`). Comments/objections? Stefan diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 8eba4270bcb..763dfc31fb8 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3425,6 +3425,12 @@ custom-visibility ;;; The `custom-face-edit' Widget. +(defalias 'custom-face--font-completion + (completion-table-dynamic + (lambda (_string) + (nconc (mapcar #'car face-font-family-alternatives) + (font-family-list))))) + (define-widget 'custom-face-edit 'checklist "Widget for editing face attributes. The following properties have special meanings for this widget: diff --git a/lisp/cus-face.el b/lisp/cus-face.el index d0a1a66e29f..9a0ab4b47c7 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -48,6 +48,7 @@ custom-declare-face (defconst custom-face-attributes `((:family (string :tag "Font Family" + :completions custom-face--font-completion :help-echo "Font family or fontset alias name.")) (:foundry