Skip to content

Instantly share code, notes, and snippets.

@baongoc124
Created October 29, 2016 06:17
Show Gist options
  • Select an option

  • Save baongoc124/01ba9d65f9fadda3345687f65fe8d057 to your computer and use it in GitHub Desktop.

Select an option

Save baongoc124/01ba9d65f9fadda3345687f65fe8d057 to your computer and use it in GitHub Desktop.
Webcomplete implementation for Emacs with Chrome/Chromium on Linux.
(defvar ac-source-chrome-cache nil)
(defvar ac-source-chrome-complete
'((candidates . (ac-chrome-candidate))
(symbol . "w")))
(defun clear-chrome-cache ()
(setq ac-source-chrome-cache nil))
(add-hook 'focus-in-hook 'clear-chrome-cache)
(defun ac-chrome-candidate ()
(or ac-source-chrome-cache
(setq ac-source-chrome-cache (or (split-string (shell-command-to-string "chromecomplete.py"))
'("")))))
(setq-default ac-sources (push 'ac-source-chrome-complete ac-sources))
@baongoc124
Copy link
Author

baongoc124 commented Oct 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment