unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: "Stefan Kangas" <stefankangas@gmail.com>,
	"João Távora" <joaotavora@gmail.com>,
	"Stefan Monnier" <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: cus-test fails from completion-category-overrides eglot adds
Date: Wed, 26 Oct 2022 08:35:54 -0300	[thread overview]
Message-ID: <66460331-6bef-e38f-fad2-3f69456e487a@gmail.com> (raw)

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

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

 > 26 okt. 2022 kl. 08.22 skrev Stefan Kangas <stefankangas@gmail.com>:
 >
 >> I think you have to say "make check-expensive".
 >
 > The impatient can also run `make -C test test-custom-opts`.
 >
 > I pushed a simple expedient (e54c395982) – not very elegant but it
 > does the job for now.

Hmm, I think that change won't make all the choices available when
executing: M-x customize-option RET completion-category-overrides
Am I right?

If that's so, does the attached patch do what's desired here?


[-- Attachment #2: 0001-Make-completion-category-overrides-choices-dynamic.patch --]
[-- Type: text/x-patch, Size: 1572 bytes --]

From b179ecbb0bc5823077b11c8308ad9293dedc470f Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Wed, 26 Oct 2022 07:29:51 -0300
Subject: [PATCH] Make completion-category-overrides choices dynamic

See https://lists.gnu.org/archive/html/emacs-devel/2022-10/msg01969.html

* lisp/minibuffer.el (completion--update-styles-options): New internal
function.

(completion--styles-type): Use it.
---
 lisp/minibuffer.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a9f72d600d..4898dfdb98 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -972,10 +972,18 @@ completion-styles-alist
 follow the calling convention of `completion-all-completions'),
 and DOC describes the way this style of completion works.")
 
+(defun completion--update-styles-options (widget)
+  "Function to keep updated the options in `completion-category-overrides'."
+  (let ((lst (mapcar (lambda (x)
+                       (list 'const (car x)))
+		     completion-styles-alist)))
+    (widget-put widget :args (mapcar #'widget-convert lst))
+    widget))
+
 (defconst completion--styles-type
   `(repeat :tag "insert a new menu to add more styles"
-           (choice ,@(mapcar (lambda (x) (list 'const (car x)))
-                             completion-styles-alist))))
+           (choice :convert-widget completion--update-styles-options)))
+
 (defconst completion--cycling-threshold-type
   '(choice (const :tag "No cycling" nil)
            (const :tag "Always cycle" t)
-- 
2.34.1


             reply	other threads:[~2022-10-26 11:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 11:35 Mauro Aranda [this message]
2022-10-26 12:18 ` cus-test fails from completion-category-overrides eglot adds Stefan Monnier
2022-10-26 14:35   ` Mauro Aranda
2022-10-26 12:51 ` Mattias Engdegård
  -- strict thread matches above, loose matches on Subject: below --
2022-10-25 19:47 Mattias Engdegård
2022-10-25 21:19 ` João Távora
2022-10-25 22:48   ` Stefan Monnier
2022-10-26  6:22   ` Stefan Kangas
2022-10-26  9:05     ` Mattias Engdegård
2022-10-26 11:45       ` Stefan Monnier
2022-10-26  7:44   ` Michael Albinus
2022-10-26  9:39     ` João Távora

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=66460331-6bef-e38f-fad2-3f69456e487a@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=mattias.engdegard@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefankangas@gmail.com \
    /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).