* Some leftover past work in snippet loading

This commit is contained in:
capitaomorte 2010-10-30 09:02:02 +00:00
parent 04c1a6e23a
commit df72dd28d7

View File

@ -1639,6 +1639,7 @@ TEMPLATES is a list of `yas/template'."
(cons mode-sym parents) (cons mode-sym parents)
(yas/compute-major-mode-and-parents (concat directory (yas/compute-major-mode-and-parents (concat directory
"/dummy")))) "/dummy"))))
(default-directory directory)
(yas/ignore-filenames-as-triggers (yas/ignore-filenames-as-triggers
(or yas/ignore-filenames-as-triggers (or yas/ignore-filenames-as-triggers
(file-exists-p (concat directory "/" (file-exists-p (concat directory "/"
@ -1807,7 +1808,7 @@ Here's the default value for all the parameters:
" \"Initialize YASnippet and load snippets in the bundle.\"") " \"Initialize YASnippet and load snippets in the bundle.\"")
(flet ((yas/define-snippets (flet ((yas/define-snippets
(mode snippets &optional parent-or-parents) (mode snippets &optional parent-or-parents)
(insert ";;; snippets for " (symbol-name mode) "\n") (insert ";;; snippets for " (symbol-name mode) ", subdir " (file-name-nondirectory (replace-regexp-in-string "/$" "" default-directory)) "\n")
(let ((literal-snippets (list))) (let ((literal-snippets (list)))
(dolist (snippet snippets) (dolist (snippet snippets)
(let ((key (first snippet)) (let ((key (first snippet))
@ -1835,9 +1836,13 @@ Here's the default value for all the parameters:
(dolist (subdir (yas/subdirs dir)) (dolist (subdir (yas/subdirs dir))
(let ((file (concat subdir "/.yas-setup.el"))) (let ((file (concat subdir "/.yas-setup.el")))
(when (file-readable-p file) (when (file-readable-p file)
(insert ";; Supporting elisp for subdir " (file-name-nondirectory subdir) "\n\n") (insert "\n;; Supporting elisp for subdir " (file-name-nondirectory subdir) "\n\n")
(goto-char (+ (point) (with-temp-buffer
(second (insert-file-contents file)))))) (insert-file-contents file)
(replace-regexp "^;;.*$" "" nil (point-min) (point-max))
(replace-regexp "^[\s\t]*\n\\([\s\t]*\n\\)+" "\n" nil (point-min) (point-max))
(kill-region (point-min) (point-max)))
(yank)))
(yas/load-directory-1 subdir nil)))) (yas/load-directory-1 subdir nil))))
(insert (pp-to-string `(yas/global-mode 1))) (insert (pp-to-string `(yas/global-mode 1)))