emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master e35c031 25/51: * yasnippet.el (yas--guess-snippet-director


From: Noam Postavsky
Subject: [elpa] master e35c031 25/51: * yasnippet.el (yas--guess-snippet-directories): Guess major mode first.
Date: Sun, 13 May 2018 13:11:43 -0400 (EDT)

branch: master
commit e35c0314109af0bcaf8ac6bd92491ec86cd4b96b
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    * 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]