1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 20:32:00 -08:00

Fix M-TAB completion of variables in 'cond'

* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Add
special support for 'cond, 'cond*', and 'bind*'.  (Bug#73330)
This commit is contained in:
Eli Zaretskii 2024-09-19 19:36:46 +03:00
parent 8816b4f342
commit cbaf7edbb4

View file

@ -784,13 +784,18 @@ functions are annotated with \"<f>\" via the
(list t (elisp--completion-local-symbols)
:predicate (lambda (sym)
(get sym 'error-conditions))))
((and (or ?\( 'let 'let*)
((and (or ?\( 'let 'let* 'cond 'cond* 'bind*)
(guard (save-excursion
(goto-char (1- beg))
(when (eq parent ?\()
(up-list -1))
(forward-symbol -1)
(looking-at "\\_<let\\*?\\_>"))))
(or
(looking-at
"\\_<\\(let\\*?\\|bind\\*\\)\\_>")
(and (not (eq parent ?\())
(looking-at
"\\_<cond\\*?\\_>"))))))
(list t (elisp--completion-local-symbols)
:predicate #'elisp--shorthand-aware-boundp
:company-kind (lambda (_) 'variable)