Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (32 sloc) 1.184 kb
(require 'auto-complete)
(require 'yasnippet)
(defun ac-yasnippet-candidate-1 (table)
(let ((hashtab (yas/snippet-table-hash table))
(parent (yas/snippet-table-parent table))
candidates)
(maphash (lambda (key value)
(push key candidates))
hashtab)
(setq candidates (all-completions ac-prefix (nreverse candidates)))
(if parent
(setq candidates
(append candidates (ac-yasnippet-candidate-1 parent))))
candidates))
(defun ac-yasnippet-candidate ()
(let ((table (yas/snippet-table major-mode)))
(if table
(ac-yasnippet-candidate-1 table))))
(defface ac-yasnippet-candidate-face
'((t (:background "sandybrown" :foreground "black")))
"Face for yasnippet candidate.")
(defface ac-yasnippet-selection-face
'((t (:background "coral3" :foreground "white")))
"Face for the yasnippet selected candidate.")
(defvar ac-source-yasnippet
'((candidates . ac-yasnippet-candidate)
(action . yas/expand)
(limit . 3)
(candidate-face . ac-yasnippet-candidate-face)
(selection-face . ac-yasnippet-selection-face))
"Source for Yasnippet.")
(provide 'auto-complete-yasnippet)
Jump to Line
Something went wrong with that request. Please try again.