From: Eshel Yaron Date: Mon, 20 Jan 2025 07:54:05 +0000 (+0100) Subject: scope.el: Recognize a few more widgets X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=733d07667bc10e689dde77ddc389c6b22f7035c2;p=emacs.git scope.el: Recognize a few more widgets --- diff --git a/lisp/emacs-lisp/scope.el b/lisp/emacs-lisp/scope.el index 4d165d65e09..e1e958966e3 100644 --- a/lisp/emacs-lisp/scope.el +++ b/lisp/emacs-lisp/scope.el @@ -678,7 +678,9 @@ Optional argument LOCAL is a local context to extend." (when-let* ((fun (car args)) (beg (scope-sym-pos fun)) (bare (scope-sym-bare fun))) - (funcall scope-callback 'function beg (length (symbol-name bare)) nil)))) + (funcall scope-callback 'function beg (length (symbol-name bare)) nil))) + ((memq kw '(:args)) + (mapc #'scope-widget-type-1 (car args)))) ;; TODO: (restricted-sexp :match-alternatives CRITERIA) (scope-widget-type-arguments head (cdr args))) @@ -691,7 +693,8 @@ Optional argument LOCAL is a local context to extend." (defun scope-widget-type-arguments-1 (head args) (cl-case head - ((list cons group vector choice radio set repeat) (mapc #'scope-widget-type-1 args)) + ((list cons group vector choice radio set repeat checklist) + (mapc #'scope-widget-type-1 args)) ((function-item) (when-let* ((fun (car args)) (beg (scope-sym-pos fun)) @@ -880,7 +883,16 @@ a (possibly empty) list of safe macros.") (prnt (cadr prnt-form)) (beg (scope-sym-pos prnt)) (bare (scope-sym-bare prnt))) - (funcall scope-callback 'widget-type beg (length (symbol-name bare)) nil))) + (funcall scope-callback 'widget-type beg (length (symbol-name bare)) nil)) + (when-let* ((props (cdddr forms)) + (symbols-with-pos-enabled t)) + (when-let ((val-form (plist-get props :type))) + (scope-widget-type local val-form)) + (when-let ((val-form (plist-get props :args)) + ((memq (scope-sym-bare (car-safe val-form)) '(quote \`))) + (val (cadr val-form)) + ((consp val))) + (mapc #'scope-widget-type-1 val)))) ((define-error) (when-let* ((name-form (car forms)) ((memq (scope-sym-bare (car-safe name-form)) '(quote \`)))