3

I'm new to emacs and am trying to figure out how to make auto-complete mode auto complete while my cursor is inside quotes.

For example, while writing Python (I'm using emacs-jedi) I'd love to be able to autocomplete dictionary lookups. It doesn't even need to introspect my dictionary, just offer the word if it has already been used in the buffer.

data = {"test_auto_complete": 1}
data['test_

Thoughts?

2 Answers 2

8

AC does not complete when you are in face specified by ac-disable-faces. It is '(font-lock-comment-face font-lock-string-face font-lock-doc-face) by default. Remove font-lock-string-face from it or simply remove all:

(setq ac-disable-faces nil)
Sign up to request clarification or add additional context in comments.

Comments

5

For string literals, use either dabbrev-expand or hippie-expand.

I keep them bound to M-/ and S-/ (ie. Meta / and Super /) YMMV

This won't go through the auto-complete interface, if you really want that, there will be a way, but is that really necessary?

Note: hippie-expand will expand/autocomplete from the filesystem, and other places (including everything dabbrev-expand does.)

dabbrev-expand will only expand from the open buffers and the abbrev dictionary.

Edit: using autocomplete with dabbrev

http://www.emacswiki.org/emacs/ac-dabbrev.el - this emacs lisp will make dabbrev a source for auto-complete

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.