* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Classify lone symbol inside let varlist as variable.
* test/automated/elisp-mode-tests.el (completest-variables-in-let-bindings):
New test.
(< (point) beg)))))
(list t obarray
:predicate (lambda (sym) (get sym 'error-conditions))))
- ((and ?\(
- (guard (save-excursion
- (goto-char (1- beg))
- (up-list -1)
- (forward-symbol -1)
- (looking-at "\\_<let\\*?\\_>"))))
+ ((or `let `let*
+ (and ?\(
+ (guard (save-excursion
+ (goto-char (1- beg))
+ (up-list -1)
+ (forward-symbol -1)
+ (looking-at "\\_<let\\*?\\_>")))))
(list t obarray
:predicate #'boundp
:company-doc-buffer #'elisp--company-doc-buffer
(should (member "bar" comps))
(should (member "baz" comps)))))
+(ert-deftest completest-variables-in-let-bindings ()
+ (dolist (text '("(let (ba" "(let* ((ba"))
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert text)
+ (let ((comps (elisp--test-completions)))
+ (should (member "backup-inhibited" comps))
+ (should-not (member "backup-buffer" comps))))))
+
(provide 'elisp-mode-tests)
;;; elisp-mode-tests.el ends here