Skip to content

Instantly share code, notes, and snippets.

@shishi
Created May 3, 2012 20:57
Show Gist options
  • Save shishi/2589410 to your computer and use it in GitHub Desktop.
Save shishi/2589410 to your computer and use it in GitHub Desktop.
fix cooprate with yasnippet
(defun ac-yasnippet-candidates ()
(with-no-warnings
(if (>= (string-to-number yas/version) 0.7)
(apply 'append (mapcar 'ac-yasnippet-candidate-1 (yas/get-snippet-tables)))
(if (fboundp 'yas/get-snippet-tables)
;; >0.6.0
(apply 'append (mapcar 'ac-yasnippet-candidate-1 (yas/get-snippet-tables major-mode)))
(let ((table
(if (fboundp 'yas/snippet-table)
;; <0.6.0
(yas/snippet-table major-mode)
;; 0.6.0
(yas/current-snippet-table))))
(if table
(ac-yasnippet-candidate-1 table)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment