mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
; (elisp-scope-if-let): Fix case where bindings entry is a symbol
* lisp/emacs-lisp/elisp-scope.el (elisp-scope-if-let): Fix handling of a plain symbol as one the bindings in an 'if-let*' form, as in (if-let* (foo) 'bar). * test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el: Test it.
This commit is contained in:
parent
240bf0679c
commit
e7df895c2e
2 changed files with 12 additions and 6 deletions
|
|
@ -2270,14 +2270,18 @@ property, or if the current buffer is trusted (see `trusted-content-p')."
|
|||
(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))
|
||||
(sym (if (consp binding)
|
||||
(when (cdr binding) (car binding))
|
||||
binding))
|
||||
(form (when (consp binding)
|
||||
(if (cdr binding) (cadr binding) (car binding))))
|
||||
(bare (elisp-scope-sym-bare 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)))
|
||||
(when form (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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue