Add yas-backport-obsolete-alias option

* yasnippet.el (yas-backport-obsolete-alias): New option.
This commit is contained in:
USAMI Kenta 2016-05-15 01:28:42 +09:00 committed by Noam Postavsky
parent 0d79e6988e
commit bbfa1f0c9a

View File

@ -386,6 +386,11 @@ the trigger key itself."
:type '(repeat function) :type '(repeat function)
:group 'yasnippet) :group 'yasnippet)
(defcustom yas-backport-obsolete-alias t
"If non-nil backport function and variables from old version of yasnippet."
:type 'boolean
:group 'yasnippet)
;; Only two faces, and one of them shouldn't even be used... ;; Only two faces, and one of them shouldn't even be used...
;; ;;
(defface yas-field-highlight-face (defface yas-field-highlight-face
@ -4598,6 +4603,7 @@ and return the directory. Return nil if not found."
They are mapped to \"yas/*\" variants.") They are mapped to \"yas/*\" variants.")
(when yas-backport-obsolete-alias
(dolist (sym yas--backported-syms) (dolist (sym yas--backported-syms)
(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)
@ -4605,7 +4611,7 @@ They are mapped to \"yas/*\" variants.")
(defvaralias backported sym)) (defvaralias backported sym))
(when (fboundp sym) (when (fboundp sym)
(make-obsolete backported sym "yasnippet 0.8") (make-obsolete backported sym "yasnippet 0.8")
(defalias backported sym)))) (defalias backported sym)))))
(defvar yas--exported-syms (defvar yas--exported-syms
(let (exported) (let (exported)