mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
; elisp-scope.el: Fix handling of 'if-let' and friends
* lisp/emacs-lisp/elisp-scope.el (elisp-scope-if-let): New function, used to analyze 'if-let*' forms.
This commit is contained in:
parent
f18e658533
commit
94d314d756
1 changed files with 18 additions and 0 deletions
|
|
@ -2255,6 +2255,24 @@ property, or if the current buffer is trusted (see `trusted-content-p')."
|
|||
(elisp-scope-1 file '(symbol . feature))
|
||||
(elisp-scope-1 form 'code))
|
||||
|
||||
(elisp-scope-define-macro-analyzer if-let* (&optional varlist then &rest else)
|
||||
(elisp-scope-if-let varlist then else elisp-scope-output-spec))
|
||||
|
||||
(defun elisp-scope-if-let (bindings then else outspec)
|
||||
(if (consp bindings)
|
||||
(let* ((binding (car bindings))
|
||||
(sym (when (cdr binding) (car binding)))
|
||||
(form (if (cdr binding) (cadr binding) (car binding)))
|
||||
(bare (bare-symbol sym))
|
||||
(len (length (symbol-name bare)))
|
||||
(beg (elisp-scope-sym-pos sym)))
|
||||
(when beg (elisp-scope-binding bare beg len))
|
||||
(elisp-scope-1 form)
|
||||
(let ((elisp-scope-local-bindings (elisp-scope-local-new bare beg elisp-scope-local-bindings)))
|
||||
(elisp-scope-if-let (cdr bindings) then else outspec)))
|
||||
(elisp-scope-1 then outspec)
|
||||
(elisp-scope-n else outspec)))
|
||||
|
||||
(elisp-scope-define-macro-analyzer define-globalized-minor-mode (global mode turn-on &rest body)
|
||||
(elisp-scope-report-s mode 'function)
|
||||
(elisp-scope-report-s turn-on 'function)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue