Skip to content

Instantly share code, notes, and snippets.

@youpy
Last active December 17, 2015 11:49
Show Gist options
  • Save youpy/5605265 to your computer and use it in GitHub Desktop.
Save youpy/5605265 to your computer and use it in GitHub Desktop.
Expand abbreviations from the content of active tab on Google Chrome
;; dabbrev-expand
;; chrome のタブから補完
;; require clome-cli (https://github.com/prasmussen/chrome-cli)
(defadvice dabbrev-expand (around dabbrev-expand-chrome)
"Expand abbreviations from the content of active tab on Google Chrome"
(setq buf (get-buffer-create "*chrome-active-tab-content*"))
(with-current-buffer buf
(erase-buffer)
(call-process "chrome-cli" nil buf nil "execute" "document.body.innerText"))
ad-do-it)
(ad-activate-regexp "dabbrev-expand-chrome")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment