Comments (11)
Please check the following:
- Is AC mode is enabled ?
- Is ac-auto-start non-nil ?
- M-: (auto-complete '(ac-source-ropemacs))
from auto-complete.
Thanks for your update :)
Answers:
- AC mode is ON
- ac-auto-start is 2
- nil
My configurations is below.
;; Auto Complete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/site-lisp/auto-complete/dict")
(ac-config-default)
;; for python-mode
(ac-ropemacs-initialize)
(add-hook 'python-mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-ropemacs)))
;; for c/c++ mode
(add-hook 'c-mode-common-hook
'(lambda()
(add-to-list 'ac-sources 'ac-source-semantic)))
(define-key ac-completing-map "\C-n" 'ac-next)
(define-key ac-completing-map "\C-p" 'ac-previous)
(setq ac-auto-start 2)
(setq ac-dwim t)
(global-set-key "\M-/" 'ac-start)
(define-key ac-completing-map "\M-/" 'ac-stop)
(ac-set-trigger-key "TAB")
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
from auto-complete.
Can you get completions by M-: (rope-completions) at the position ?
from auto-complete.
Yes. I can get them. And M-/ runs the command rope-code-assist if AC mode is enabled.
from auto-complete.
Please try again after evaluating the following code:
(setq ac-source-ropemacs
'((init
. (lambda ()
(setq ac-ropemacs-completions-cache
(mapcar
(lambda (completion)
(concat ac-prefix completion))
(rope-completions)))))
(candidates . ac-ropemacs-completions-cache)))
from auto-complete.
You may get errors or ac-ropemacs-completions-cache is forever nil.
from auto-complete.
Yes, ac-ropemacs-completions-cache is always nil, so still not work. What should I do?
from auto-complete.
Hmm... I have to look into more deeply. Sorry for inconvenience.
from auto-complete.
Okay, Thanks for your great work! I like AC. Please let me know if you need help.
from auto-complete.
I use the configuration on http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/, but cannot work well yet. Please refer to the latest comment.
(add-hook 'python-mode-hook
(lambda ()
(auto-complete-mode 1)
(set (make-local-variable 'ac-sources)
(append ac-sources '(ac-source-rope)))
; (append ac-sources '(ac-source-rope) '(ac-source-yasnippet)))
(set (make-local-variable 'ac-find-function) 'ac-python-find)
(set (make-local-variable 'ac-candidate-function) 'ac-python-candidate)
(set (make-local-variable 'ac-auto-start) nil)))
(set (make-local-variable 'ac-sources) (append ac-sources '(ac-source-yasnippet)))
(setq ac-auto-start nil)
(ac-set-trigger-key "TAB")
from auto-complete.
I found the ultimate solution. Hope it works for you.
(ac-ropemacs-initialize)
(defvar dss-ropemacs-completions-cache nil)
(defun dss/rope-candidates (prefix)
(with-no-warnings
(setq dss-ropemacs-completions-cache
(mapcar
(lambda (completion)
(concat ac-prefix completion))
(ignore-errors
(rope-completions)))))
dss-ropemacs-completions-cache)
(ac-define-source dss-rope
'((candidates . (dss/rope-candidates ac-prefix))
(requires . 0)
(cache . t)
(symbol . "f")))
(ac-define-source dss-rope-dot
'((candidates . (dss/rope-candidates ac-prefix))
(prefix . c-dot)
(requires . 0)
(cache . t)
(symbol . "f")))
(add-hook 'python-mode-hook
(lambda ()
(setq ac-sources (append '(ac-source-yasnippet ac-source-dss-rope ac-source-dss-rope-dot) ac-sources))))
from auto-complete.
Related Issues (20)
- Auto-Complete Not Showing on Melpa and Missing File Header HOT 17
- Most recent auto-complete semantic source doesn't work HOT 2
- Weird completion behaviour when editing a line with existing characters to the right of the cursor
- Display problem with autocomplete in emacs (python) HOT 4
- how can i use tab instead of tab+<CR>
- Add page up/down commands HOT 3
- Is there any way to add word databases which should also be looked for a match ? HOT 1
- Why people are turning away from this package? HOT 16
- (Solved)No such file or directory, auto-complete
- Memberships after transferring ownership HOT 2
- Error running timer ‘ac-update-greedy’ / Error running timer ‘ac-show-menu’ HOT 2
- Looking for a new maintainer HOT 42
- Error running timer, ‘ac-show-menu’ & ‘ac-update-greedy’: (beginning-of-buffer) HOT 2
- Disable reviewer requirement? HOT 2
- Mind changing the organization's logo? HOT 7
- auto-complete does not respect "completion-styles" HOT 2
- Move CI to GitHub Actions HOT 1
- Warnings with Emacs 28.2 HOT 3
- Crash with emacs 29.1: "Error: Symbol’s value as variable is void: macro-declaration-function" HOT 4
- Doesn't work with latest Emacs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-complete.