mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
parent
232b5644a9
commit
b90e18f1ff
1 changed files with 8 additions and 2 deletions
|
@ -40,6 +40,12 @@
|
|||
:type 'integer
|
||||
:group 'ein)
|
||||
|
||||
(defvar ein:ac-syntax-table
|
||||
(let ((table (make-syntax-table ein:dotty-syntax-table)))
|
||||
(modify-syntax-entry ?~ "w" table)
|
||||
table)
|
||||
"`ein:dotty-syntax-table' plus \"~\" considered as a word character.")
|
||||
|
||||
(defvar ein:ac-cache-matches nil)
|
||||
|
||||
(defvar ein:ac-direct-matches nil
|
||||
|
@ -66,7 +72,7 @@ compatibility with `ein:completer-finish-completing-default'."
|
|||
(setq ein:ac-direct-matches matches) ; let-binding won't work
|
||||
(setq ein:ac-cache-matches (append matches ein:ac-cache-matches))
|
||||
(run-with-idle-timer 1 nil #'ein:ac-clear-cache)
|
||||
(with-syntax-table ein:dotty-syntax-table
|
||||
(with-syntax-table ein:ac-syntax-table
|
||||
(auto-complete '(ac-source-ein-direct))))
|
||||
|
||||
(defun ein:ac-clear-cache ()
|
||||
|
@ -119,7 +125,7 @@ first candidate when the `ac-menu' pops up."
|
|||
"Monkey patch `auto-complete' internal function to enable
|
||||
dotty completion."
|
||||
(if (or ein:notebook (ein:eval-if-bound 'ein:@connect))
|
||||
(with-syntax-table ein:dotty-syntax-table
|
||||
(with-syntax-table ein:ac-syntax-table
|
||||
ad-do-it)
|
||||
ad-do-it))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue