* yasnippet.el (yas--guess-snippet-directories): Guess major mode first.

This commit is contained in:
Noam Postavsky 2018-01-05 18:21:27 -05:00
parent 2e69471df2
commit e35c031410

View File

@ -2511,10 +2511,11 @@ where snippets of table might exist."
(tables (if table (list table) (tables (if table (list table)
(yas--get-snippet-tables)))) (yas--get-snippet-tables))))
;; HACK! the snippet table created here is actually registered! ;; HACK! the snippet table created here is actually registered!
;; (unless table
(unless (or table (gethash major-mode yas--tables)) ;; The major mode is probably the best guess, put it first.
(push (yas--table-get-create major-mode) (let ((major-mode-table (yas--table-get-create major-mode)))
tables)) (cl-callf2 delq major-mode-table tables)
(push major-mode-table tables)))
(mapcar #'(lambda (table) (mapcar #'(lambda (table)
(cons table (cons table