(unless yas/snippet-dirs
(setq yas/snippet-dirs top-level-dir))
(dolist (dir (yas/subdirs top-level-dir))
- (let ((major-mode-and-parents (yas/compute-major-mode-and-parents
- (concat dir "/dummy"))))
- (yas/load-directory-1 dir
- (car major-mode-and-parents)
- (cdr major-mode-and-parents))))
+ (let* ((major-mode-and-parents (yas/compute-major-mode-and-parents
+ (concat dir "/dummy")))
+ (mode-sym (car major-mode-and-parents))
+ (parents (cdr major-mode-and-parents)))
+ (puthash mode-sym (remove-duplicates
+ (append parents
+ (gethash mode-sym yas/parents)))
+ yas/parents)
+ (yas/schedule-jit mode-sym
+ `(yas/load-directory-1 ,dir
+ ',mode-sym))))
(when (interactive-p)
- (message "[yas] Loaded snippets from %s." top-level-dir)))
+ (yas/message 3 "Loaded snippets from %s." top-level-dir)))
(defun yas/load-snippet-dirs ()
"Reload the directories listed in `yas/snippet-dirs' or
(define-key keymap (vector (gensym))
'(menu-item "----")))
(t
- (message "[yas] Don't know anything about menu entry %s" (first e))))))
- (yas/message 3 "don't know anything about menu entry %s" (first e))))))
++ (yas/message 3 "Don't know anything about menu entry %s" (first e))))))
(defun yas/define (mode key template &optional name condition group)
"Define a snippet. Expanding KEY into TEMPLATE.
;; again from `yas/take-care-of-redo'....
(setf (yas/snippet-fields snippet) nil)))
- (message "[yas] Snippet %s exited." (yas/snippet-id snippet)))
- (yas/message 3 "snippet %s exited." (yas/snippet-id snippet)))
++ (yas/message 3 "Snippet %s exited." (yas/snippet-id snippet)))
(defun yas/safely-run-hooks (hook-var)
(condition-case error
(widen)
(condition-case err
(indent-according-to-mode)
- (error (message "[yas] warning: `yas/indent-according-to-mode' having problems running %s" indent-line-function)
- (error (yas/message 3 "warning: yas/indent-according-to-mode habing problems running %s" indent-line-function)
++ (error (yas/message 3 "Warning: `yas/indent-according-to-mode' having problems running %s" indent-line-function)
nil)))
(mapc #'(lambda (marker)
(set-marker marker (point)))
(apply (car fn-and-args)
(cdr fn-and-args)))
yas/post-command-runonce-actions)
- (error (message "[yas] Problem running `yas/post-command-runonce-actions'!")))
- (error (yas/message 3 "problem running `yas/post-command-runonce-actions'!")))
++ (error (yas/message 3 "Problem running `yas/post-command-runonce-actions'!")))
(setq yas/post-command-runonce-actions nil))
(cond (yas/protection-violation
(goto-char yas/protection-violation)