branch: master
commit 497867cea5395ddfd2d482176bd789de9b1576b8
Author: Noam Postavsky <[email protected]>
Commit: Noam Postavsky <[email protected]>
Rename yas-backport-obsolete-alias
* yasnippet.el (yas-alias-to-yas/prefix-p): Rename from
yas-backport-obsolete-alias.
(yas/root-directory): Only define if yas-alias-to-yas/prefix-p is
non-nil. Mark obsolete.
---
yasnippet.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 0f3e290..f670a29 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -202,8 +202,6 @@ created with `yas-new-snippet'. "
(t
(error "[yas] invalid element %s in `yas-snippet-dirs'"
e)))))
-(defvaralias 'yas/root-directory 'yas-snippet-dirs)
-
(defcustom yas-new-snippet-default "\
# -*- mode: snippet -*-
# name: $1
@@ -386,8 +384,9 @@ the trigger key itself."
:type '(repeat function)
:group 'yasnippet)
-(defcustom yas-backport-obsolete-alias t
- "If non-nil backport function and variables from old version of yasnippet."
+(defcustom yas-alias-to-yas/prefix-p t
+ "If non-nil make aliases for the old style yas/ prefixed symbols.
+It must be set to nil before loading yasnippet to take effect."
:type 'boolean
:group 'yasnippet)
@@ -4603,7 +4602,7 @@ and return the directory. Return nil if not found."
They are mapped to \"yas/*\" variants.")
-(when yas-backport-obsolete-alias
+(when yas-alias-to-yas/prefix-p
(dolist (sym yas--backported-syms)
(let ((backported (intern (replace-regexp-in-string "\\`yas-" "yas/"
(symbol-name sym)))))
(when (boundp sym)
@@ -4611,7 +4610,9 @@ They are mapped to \"yas/*\" variants.")
(defvaralias backported sym))
(when (fboundp sym)
(make-obsolete backported sym "yasnippet 0.8")
- (defalias backported sym)))))
+ (defalias backported sym))))
+ (make-obsolete 'yas/root-directory 'yas-snippet-dirs "yasnippet 0.8")
+ (defvaralias 'yas/root-directory 'yas-snippet-dirs))
(defvar yas--exported-syms
(let (exported)