1

In Emacs version 25.1.1 (and probably other versions), tab completion not work for function names unless they are enclosed in parentheses or quoted. For instance, after running emacs -Q, setting tab-always-indent to 'complete and attempting to complete "seq-" after (require 'seq), no completions are offered. However, "(seq-" completes as one would expect.

Is there a way to complete function names outside of quotes?

Edit: this issue also occurs with normal functions and not just generic ones as pointed out in the comments.

Edit: If helm is used for completion, one approach is to use the following code:

(add-hook 'emacs-lisp-mode-hook (lambda ()
                                  (setq-local completion-at-point-functions '(helm-lisp-completion-at-point))))
  • 1
    Assuming you're in emacs-lisp-mode you should take a look at elisp-completion-at-point that explicitly checks for "function position" with (eq (char-before beg) ?\(). A (seq- TAB (or a 'seq-) will therefore complete all seq functions as expected. – mutbuerger Jan 5 '17 at 9:38
  • In 26.0.50.2, I start with emacs -Q, then do M-x emacs-lisp-mode, and (require 'seq) (setq tab-always-indent 'complete) and then a TAB does show completions. Can you try in emacs -Q? Do you get completions for other libraries? What do you mean by "generic"? – unhammer Jan 5 '17 at 11:50
  • Works for me in 25.1 as well. – npostavs Jan 5 '17 at 14:37
  • @matbuerger That's interesting. But it only works when there is a paren before or after "seq-". – Qudit Jan 5 '17 at 17:12
  • @ unhammer I did use -Q. Generic means a Common Lisp style generic function as defined with cl-defgeneric. – Qudit Jan 5 '17 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.