branch: master
commit e35c0314109af0bcaf8ac6bd92491ec86cd4b96b
Author: Noam Postavsky <[email protected]>
Commit: Noam Postavsky <[email protected]>
* yasnippet.el (yas--guess-snippet-directories): Guess major mode first.
---
yasnippet.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index f2f7990..092ac55 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -2511,10 +2511,11 @@ where snippets of table might exist."
(tables (if table (list table)
(yas--get-snippet-tables))))
;; HACK! the snippet table created here is actually registered!
- ;;
- (unless (or table (gethash major-mode yas--tables))
- (push (yas--table-get-create major-mode)
- tables))
+ (unless table
+ ;; The major mode is probably the best guess, put it first.
+ (let ((major-mode-table (yas--table-get-create major-mode)))
+ (cl-callf2 delq major-mode-table tables)
+ (push major-mode-table tables)))
(mapcar #'(lambda (table)
(cons table