From: Eshel Yaron Date: Mon, 3 Jun 2024 09:10:23 +0000 (+0200) Subject: Improve 'customize-read-group' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=88abe661a1c3bcea34785e24da415f7908a5da4c;p=emacs.git Improve 'customize-read-group' --- diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index c448ebefd34..ea59650fa87 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1173,14 +1173,20 @@ for the MODE to customize." (customize-group (custom-group-of-mode mode))) (defun customize-read-group () - (let ((completion-ignore-case t)) - (completing-read (format-prompt "Customize group" "emacs") + (let* ((sym (symbol-at-point)) + (def (or (and sym + (or (and (get sym 'custom-loads) + (not (get sym 'custom-autoload))) + (get sym 'custom-group)) + (symbol-name sym)) + "emacs"))) + (completing-read (format-prompt "Customize group" def) obarray (lambda (symbol) (or (and (get symbol 'custom-loads) (not (get symbol 'custom-autoload))) (get symbol 'custom-group))) - t))) + t nil nil def))) ;;;###autoload (defun customize-group (&optional group other-window)