branch: master
commit ce11fd66900eb9f871af03dc945c85a8ac980821
Author: Noam Postavsky <[email protected]>
Commit: Noam Postavsky <[email protected]>
* yasnippet.el (yas-reload-all): Mention if no snippets were found.
---
yasnippet.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 8b71083..52001ed 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1936,12 +1936,19 @@ prefix argument."
(yas-direct-keymaps-reload)
(run-hooks 'yas-after-reload-hook)
- (yas--message (if errors 2 3)
- (if no-jit "Snippets loaded %s."
- "Prepared just-in-time loading of snippets %s.")
- (if errors
- "with some errors. Check *Messages*"
- "successfully")))))
+ (let ((no-snippets
+ (cl-every (lambda (table) (= (hash-table-count table) 0))
+ (list yas--scheduled-jit-loads
+ yas--parents yas--tables))))
+ (yas--message (if (or no-snippets errors) 2 3)
+ (if no-jit "Snippets loaded %s."
+ "Prepared just-in-time loading of snippets %s.")
+ (cond (errors
+ "with some errors. Check *Messages*")
+ (no-snippets
+ "(but no snippets found)")
+ (t
+ "successfully")))))))
(defvar yas-after-reload-hook nil
"Hooks run after `yas-reload-all'.")