Merge pull request #442 from npostavs/auto-export

populate yas--exported-syms based on sym prefix
This commit is contained in:
João Távora 2013-12-23 02:44:24 -08:00
commit 0567c931f4

View File

@ -4442,7 +4442,7 @@ and return the directory. Return nil if not found."
;;; Backward compatibility to yasnippet <= 0.7 ;;; Backward compatibility to yasnippet <= 0.7
(defvar yas--exported-syms '(;; `defcustom's (defvar yas--backported-syms '(;; `defcustom's
;; ;;
yas-snippet-dirs yas-snippet-dirs
yas-prompt-functions yas-prompt-functions
@ -4531,7 +4531,6 @@ and return the directory. Return nil if not found."
yas-unimplemented yas-unimplemented
yas-define-condition-cache yas-define-condition-cache
yas-hippie-try-expand yas-hippie-try-expand
yas-active-keys
;; debug definitions ;; debug definitions
;; yas-debug-snippet-vars ;; yas-debug-snippet-vars
@ -4548,16 +4547,11 @@ and return the directory. Return nil if not found."
;; yas-call-with-snippet-dirs ;; yas-call-with-snippet-dirs
;; yas-with-snippet-dirs ;; yas-with-snippet-dirs
) )
"Exported yasnippet symbols. "Backported yasnippet symbols.
i.e. ones that I will try to keep in future yasnippet versions They are mapped to \"yas/*\" variants.")
and ones that other elisp libraries can more or less safely rely
upon.")
(defvar yas--dont-backport '(yas-active-keys) (dolist (sym yas--backported-syms)
"Exported symbols that don't map back to \"yas/*\" variants.")
(dolist (sym (set-difference yas--exported-syms yas--dont-backport))
(let ((backported (intern (replace-regexp-in-string "^yas-" "yas/" (symbol-name sym))))) (let ((backported (intern (replace-regexp-in-string "^yas-" "yas/" (symbol-name sym)))))
(when (boundp sym) (when (boundp sym)
(make-obsolete-variable backported sym "yasnippet 0.8") (make-obsolete-variable backported sym "yasnippet 0.8")
@ -4566,6 +4560,22 @@ upon.")
(make-obsolete backported sym "yasnippet 0.8") (make-obsolete backported sym "yasnippet 0.8")
(defalias backported sym)))) (defalias backported sym))))
(defvar yas--exported-syms
(let (exported)
(mapatoms (lambda (atom)
(if (and (or (and (boundp atom)
(not (get atom 'byte-obsolete-variable)))
(and (fboundp atom)
(not (get atom 'byte-obsolete-info))))
(string-match-p "^yas-[^-]" (symbol-name atom)))
(push atom exported))))
exported)
"Exported yasnippet symbols.
i.e. the ones with \"yas-\" single dash prefix. I will try to
keep them in future yasnippet versions and other elisp libraries
can more or less safely rely upon them.")
(provide 'yasnippet) (provide 'yasnippet)