commit cbaf7edbb467c7d6eedf44c055ecfc73b3bb3189 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Thu Sep 19 19:36:46 2024 +0300 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) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 9bf6f9217c8..63bd685af91 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -784,13 +784,18 @@ functions are annotated with \"\" 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 "\\_")))) + (or + (looking-at + "\\_<\\(let\\*?\\|bind\\*\\)\\_>") + (and (not (eq parent ?\()) + (looking-at + "\\_")))))) (list t (elisp--completion-local-symbols) :predicate #'elisp--shorthand-aware-boundp :company-kind (lambda (_) 'variable)