mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Classify lone symbol inside let varlist as variable
* 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.
This commit is contained in:
parent
14c1d2106c
commit
fe4e258b17
2 changed files with 16 additions and 6 deletions
|
|
@ -544,12 +544,13 @@ It can be quoted, or be inside a quoted form."
|
|||
(< (point) beg)))))
|
||||
(list t obarray
|
||||
:predicate (lambda (sym) (get sym 'error-conditions))))
|
||||
((and ?\(
|
||||
((or `let `let*
|
||||
(and ?\(
|
||||
(guard (save-excursion
|
||||
(goto-char (1- beg))
|
||||
(up-list -1)
|
||||
(forward-symbol -1)
|
||||
(looking-at "\\_<let\\*?\\_>"))))
|
||||
(looking-at "\\_<let\\*?\\_>")))))
|
||||
(list t obarray
|
||||
:predicate #'boundp
|
||||
:company-doc-buffer #'elisp--company-doc-buffer
|
||||
|
|
|
|||
|
|
@ -84,5 +84,14 @@
|
|||
(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue