* fixed a big bug when compiling bundle

This commit is contained in:
capitaomorte 2009-08-08 23:28:12 +00:00
parent a877bf5cc8
commit 4cc4d0c578

View File

@ -604,8 +604,8 @@ This function implements the rules described in
templates templates
(remove-if-not #'(lambda (pair) (remove-if-not #'(lambda (pair)
(let* ((condition (yas/template-condition (cdr pair))) (let* ((condition (yas/template-condition (cdr pair)))
(result (and condition (result (or (null condition)
(yas/template-condition-predicate condition)))) (yas/template-condition-predicate condition))))
(cond ((eq requirement t) (cond ((eq requirement t)
result) result)
(t (t
@ -1086,7 +1086,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.\""
" (yas/global-mode 1)\n") " (yas/global-mode 1)\n")
(flet ((yas/define-snippets (flet ((yas/define-snippets
(mode snippets &optional parent directory) (mode snippets &optional parent-or-parents)
(with-current-buffer bundle-buffer (with-current-buffer bundle-buffer
(insert ";;; snippets for " (symbol-name mode) "\n") (insert ";;; snippets for " (symbol-name mode) "\n")
(insert "(yas/define-snippets '" (symbol-name mode) "\n") (insert "(yas/define-snippets '" (symbol-name mode) "\n")
@ -1110,8 +1110,8 @@ Here's the default value for all the parameters:
"nil") "nil")
")\n")) ")\n"))
(insert " )\n") (insert " )\n")
(insert (if parent (insert (if parent-or-parents
(concat "'" (symbol-name parent)) (format "'%s" parent-or-parents)
"nil") "nil")
;; (if directory ;; (if directory
;; (concat "\"" directory "\"") ;; (concat "\"" directory "\"")
@ -1119,7 +1119,7 @@ Here's the default value for all the parameters:
")\n\n")))) ")\n\n"))))
(dolist (dir dirs) (dolist (dir dirs)
(dolist (subdir (yas/subdirs dir)) (dolist (subdir (yas/subdirs dir))
(yas/load-directory-1 subdir nil)))) (yas/load-directory-1 subdir nil 'no-hierarchy-parents))))
(insert ")\n\n" code "\n") (insert ")\n\n" code "\n")
(insert "(provide '" (insert "(provide '"
@ -2749,6 +2749,15 @@ When multiple expressions are found, only the last one counts."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Debug functions. Use (or change) at will whenever needed. ;; Debug functions. Use (or change) at will whenever needed.
;; ;;
;; some useful debug code for looking up snippet tables
;;
;; (insert (pp
;; (let ((shit))
;; (maphash #'(lambda (k v)
;; (push k shit))
;; (yas/snippet-table-hash (gethash 'ruby-mode yas/snippet-tables)))
;; shit)))
;;
(defun yas/debug-some-vars () (defun yas/debug-some-vars ()
"Debug snippets, fields, mirrors and the `buffer-undo-list'." "Debug snippets, fields, mirrors and the `buffer-undo-list'."