aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov2015-05-03 23:57:38 +0300
committerDmitry Gutov2015-05-03 23:57:38 +0300
commitac5586a1037bae49738607d19fd008cd93f49ae2 (patch)
treefc8ef96d6faafdbf79749f46bd7f2fc06455ffd5 /lisp
parent2703629711f29f6a46e2766c10df5df5863d2ab9 (diff)
downloademacs-ac5586a1037bae49738607d19fd008cd93f49ae2.tar.gz
emacs-ac5586a1037bae49738607d19fd008cd93f49ae2.zip
elisp-completion-at-point: Prioritize being quoted over funpos
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Only consider function position when not inside quoted form (bug#20425). * test/automated/elisp-mode-tests.el: New file.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/elisp-mode.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2bb661a59c8..7c9a2d7c422 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -475,11 +475,12 @@ It can be quoted, or be inside a quoted form."
475 (point))) 475 (point)))
476 (scan-error pos)))) 476 (scan-error pos))))
477 ;; t if in function position. 477 ;; t if in function position.
478 (funpos (eq (char-before beg) ?\())) 478 (funpos (eq (char-before beg) ?\())
479 (quoted (elisp--form-quoted-p beg)))
479 (when (and end (or (not (nth 8 (syntax-ppss))) 480 (when (and end (or (not (nth 8 (syntax-ppss)))
480 (eq (char-before beg) ?`))) 481 (eq (char-before beg) ?`)))
481 (let ((table-etc 482 (let ((table-etc
482 (if (not funpos) 483 (if (or (not funpos) quoted)
483 ;; FIXME: We could look at the first element of the list and 484 ;; FIXME: We could look at the first element of the list and
484 ;; use it to provide a more specific completion table in some 485 ;; use it to provide a more specific completion table in some
485 ;; cases. E.g. filter out keywords that are not understood by 486 ;; cases. E.g. filter out keywords that are not understood by
@@ -491,7 +492,7 @@ It can be quoted, or be inside a quoted form."
491 :company-doc-buffer #'elisp--company-doc-buffer 492 :company-doc-buffer #'elisp--company-doc-buffer
492 :company-docsig #'elisp--company-doc-string 493 :company-docsig #'elisp--company-doc-string
493 :company-location #'elisp--company-location)) 494 :company-location #'elisp--company-location))
494 ((elisp--form-quoted-p beg) 495 (quoted
495 (list nil obarray 496 (list nil obarray
496 ;; Don't include all symbols (bug#16646). 497 ;; Don't include all symbols (bug#16646).
497 :predicate (lambda (sym) 498 :predicate (lambda (sym)