]> code.delx.au - gnu-emacs-elpa/commitdiff
Rename all non-external symbols to `yas--`.
authorJoão Távora <joaotavora@gmail.com>
Thu, 19 Jul 2012 01:39:12 +0000 (02:39 +0100)
committerJoão Távora <joaotavora@gmail.com>
Thu, 19 Jul 2012 01:39:12 +0000 (02:39 +0100)
Maitain list of external symbols in `yas--exported-syms`

yasnippet-debug.el
yasnippet-tests.el
yasnippet.el

index ce6376079f6daa46ff5aec5eae910486084d4d81..7e3be0ece22bd4c0d4d6c721fb90b424e849c22d 100644 (file)
     (princ (format "\nPost command hook: %s\n" post-command-hook))
     (princ (format "\nPre  command hook: %s\n" pre-command-hook))
 
-    (princ (format "%s live snippets in total\n" (length (yas-snippets-at-point (quote all-snippets)))))
+    (princ (format "%s live snippets in total\n" (length (yas--snippets-at-point (quote all-snippets)))))
     (princ (format "%s overlays in buffer:\n\n" (length (overlays-in (point-min) (point-max)))))
-    (princ (format "%s live snippets at point:\n\n" (length (yas-snippets-at-point))))
+    (princ (format "%s live snippets at point:\n\n" (length (yas--snippets-at-point))))
 
 
-    (dolist (snippet (yas-snippets-at-point))
+    (dolist (snippet (yas--snippets-at-point))
       (princ (format "\tsid: %d control overlay from %d to %d\n"
-                     (yas-snippet-id snippet)
-                     (overlay-start (yas-snippet-control-overlay snippet))
-                     (overlay-end (yas-snippet-control-overlay snippet))))
+                     (yas--snippet-id snippet)
+                     (overlay-start (yas--snippet-control-overlay snippet))
+                     (overlay-end (yas--snippet-control-overlay snippet))))
       (princ (format "\tactive field: %d from %s to %s covering \"%s\"\n"
-                     (yas-field-number (yas-snippet-active-field snippet))
-                     (marker-position (yas-field-start (yas-snippet-active-field snippet)))
-                     (marker-position (yas-field-end (yas-snippet-active-field snippet)))
-                     (buffer-substring-no-properties (yas-field-start (yas-snippet-active-field snippet)) (yas-field-end (yas-snippet-active-field snippet)))))
-      (when (yas-snippet-exit snippet)
+                     (yas--field-number (yas--snippet-active-field snippet))
+                     (marker-position (yas--field-start (yas--snippet-active-field snippet)))
+                     (marker-position (yas--field-end (yas--snippet-active-field snippet)))
+                     (buffer-substring-no-properties (yas--field-start (yas--snippet-active-field snippet)) (yas--field-end (yas--snippet-active-field snippet)))))
+      (when (yas--snippet-exit snippet)
         (princ (format "\tsnippet-exit: at %s next: %s\n"
-                       (yas-exit-marker (yas-snippet-exit snippet))
-                       (yas-exit-next (yas-snippet-exit snippet)))))
-      (dolist (field (yas-snippet-fields snippet))
+                       (yas--exit-marker (yas--snippet-exit snippet))
+                       (yas--exit-next (yas--snippet-exit snippet)))))
+      (dolist (field (yas--snippet-fields snippet))
         (princ (format "\tfield: %d from %s to %s covering \"%s\" next: %s%s\n"
-                       (yas-field-number field)
-                       (marker-position (yas-field-start field))
-                       (marker-position (yas-field-end field))
-                       (buffer-substring-no-properties (yas-field-start field) (yas-field-end field))
-                       (yas-debug-format-fom-concise (yas-field-next field))
-                       (if (yas-field-parent-field field) "(has a parent)" "")))
-        (dolist (mirror (yas-field-mirrors field))
+                       (yas--field-number field)
+                       (marker-position (yas--field-start field))
+                       (marker-position (yas--field-end field))
+                       (buffer-substring-no-properties (yas--field-start field) (yas--field-end field))
+                       (yas--debug-format-fom-concise (yas--field-next field))
+                       (if (yas--field-parent-field field) "(has a parent)" "")))
+        (dolist (mirror (yas--field-mirrors field))
           (princ (format "\t\tmirror: from %s to %s covering \"%s\" next: %s\n"
-                         (marker-position (yas-mirror-start mirror))
-                         (marker-position (yas-mirror-end mirror))
-                         (buffer-substring-no-properties (yas-mirror-start mirror) (yas-mirror-end mirror))
-                         (yas-debug-format-fom-concise (yas-mirror-next mirror)))))))
+                         (marker-position (yas--mirror-start mirror))
+                         (marker-position (yas--mirror-end mirror))
+                         (buffer-substring-no-properties (yas--mirror-start mirror) (yas--mirror-end mirror))
+                         (yas--debug-format-fom-concise (yas--mirror-next mirror)))))))
 
     (princ (format "\nUndo is %s and point-max is %s.\n"
                    (if (eq buffer-undo-list t)
         (dolist (undo-elem first-ten)
           (princ (format "%2s:  %s\n" (position undo-elem first-ten) (truncate-string-to-width (format "%s" undo-elem) 70))))))))
 
-(defun yas-debug-format-fom-concise (fom)
+(defun yas--debug-format-fom-concise (fom)
   (when fom
-    (cond ((yas-field-p fom)
+    (cond ((yas--field-p fom)
            (format "field %d from %d to %d"
-                   (yas-field-number fom)
-                   (marker-position (yas-field-start fom))
-                   (marker-position (yas-field-end fom))))
-          ((yas-mirror-p fom)
+                   (yas--field-number fom)
+                   (marker-position (yas--field-start fom))
+                   (marker-position (yas--field-end fom))))
+          ((yas--mirror-p fom)
            (format "mirror from %d to %d"
-                   (marker-position (yas-mirror-start fom))
-                   (marker-position (yas-mirror-end fom))))
+                   (marker-position (yas--mirror-start fom))
+                   (marker-position (yas--mirror-end fom))))
           (t
            (format "snippet exit at %d"
-                   (marker-position (yas-fom-start fom)))))))
+                   (marker-position (yas--fom-start fom)))))))
 
 
 (defun yas-exterminate-package ()
   (yas-global-mode -1)
   (yas-minor-mode -1)
   (mapatoms #'(lambda (atom)
-                (when (string-match "yas-" (symbol-name atom))
-                  (unintern atom)))))
+                (when (string-match "yas[-/]" (symbol-name atom))
+                  (unintern atom obarray)))))
 
 (defun yas-debug-test (&optional quiet)
   (interactive "P")
                           yas-snippet-dirs
                           "~/Source/yasnippet/snippets/"))
   (set-buffer (switch-to-buffer "*YAS TEST*"))
-  (mapc #'yas-commit-snippet (yas-snippets-at-point 'all-snippets))
+  (mapc #'yas--commit-snippet (yas--snippets-at-point 'all-snippets))
   (erase-buffer)
   (setq buffer-undo-list nil)
   (setq undo-in-progress nil)
index 75173a3b467208a7737d7046ca8932ffa6bed75a..9ac687f7dd2b2eadf0dcaf683e366c76b90b97aa 100644 (file)
@@ -114,7 +114,7 @@ TODO: correct this bug!"
 ;;;
 (defmacro with-some-interesting-snippet-dirs (&rest body)
   `(yas-saving-variables
-    (with-snippet-dirs
+    (yas-with-snippet-dirs
      '((".emacs.d/snippets"
         ("c-mode"
          (".yas-parents" . "cc-mode")
@@ -132,38 +132,38 @@ TODO: correct this bug!"
   "Test basic loading and expansion of snippets"
   (with-some-interesting-snippet-dirs
    (yas-reload-all)
-   (yas-basic-jit-loading-1)))
+   (yas--basic-jit-loading-1)))
 
 (ert-deftest basic-jit-loading-with-compiled-snippets ()
   "Test basic loading and expansion of snippets"
   (with-some-interesting-snippet-dirs
    (yas-reload-all)
    (yas-recompile-all)
-   (flet ((yas-load-directory-2
+   (flet ((yas--load-directory-2
            (&rest dummies)
-           (ert-fail "yas-load-directory-2 shouldn't be called when snippets have been compiled")))
+           (ert-fail "yas--load-directory-2 shouldn't be called when snippets have been compiled")))
      (yas-reload-all)
-     (yas-basic-jit-loading-1))))
+     (yas--basic-jit-loading-1))))
 
-(defun yas-basic-jit-loading-1 (&optional compile)
+(defun yas--basic-jit-loading-1 (&optional compile)
   (with-temp-buffer
-    (should (= 4 (hash-table-count yas-scheduled-jit-loads)))
-    (should (= 0 (hash-table-count yas-tables)))
+    (should (= 4 (hash-table-count yas--scheduled-jit-loads)))
+    (should (= 0 (hash-table-count yas--tables)))
     (lisp-interaction-mode)
     (yas-minor-mode 1)
-    (should (= 2 (hash-table-count yas-scheduled-jit-loads)))
-    (should (= 2 (hash-table-count yas-tables)))
-    (should (= 1 (hash-table-count (yas-table-uuidhash (gethash 'lisp-interaction-mode yas-tables)))))
-    (should (= 2 (hash-table-count (yas-table-uuidhash (gethash 'emacs-lisp-mode yas-tables)))))
+    (should (= 2 (hash-table-count yas--scheduled-jit-loads)))
+    (should (= 2 (hash-table-count yas--tables)))
+    (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'lisp-interaction-mode yas--tables)))))
+    (should (= 2 (hash-table-count (yas--table-uuidhash (gethash 'emacs-lisp-mode yas--tables)))))
     (yas-should-expand '(("sc" . "brother from another mother")
                          ("dolist" . "(dolist)")
                          ("ert-deftest" . "(ert-deftest name () )")))
     (c-mode)
     (yas-minor-mode 1)
-    (should (= 0 (hash-table-count yas-scheduled-jit-loads)))
-    (should (= 4 (hash-table-count yas-tables)))
-    (should (= 1 (hash-table-count (yas-table-uuidhash (gethash 'c-mode yas-tables)))))
-    (should (= 1 (hash-table-count (yas-table-uuidhash (gethash 'cc-mode yas-tables)))))
+    (should (= 0 (hash-table-count yas--scheduled-jit-loads)))
+    (should (= 4 (hash-table-count yas--tables)))
+    (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'c-mode yas--tables)))))
+    (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'cc-mode yas--tables)))))
     (yas-should-expand '(("printf" . "printf();")
                          ("def" . "# define")))
     (yas-should-not-expand '("sc" "dolist" "ert-deftest"))))
@@ -238,7 +238,7 @@ TODO: correct this bug!"
         (when (>= emacs-major-version 23)
           (delete-directory default-directory 'recursive))))))
 
-(defmacro with-snippet-dirs (dirs &rest body)
+(defmacro yas-with-snippet-dirs (dirs &rest body)
   `(yas-call-with-snippet-dirs ,dirs
                                #'(lambda ()
                                    ,@body)))
index 19973fccb1198ad4375826633801b61d1a528560..52187b03fc5abfdfc7bde9e4ed69c8036e519fb1 100644 (file)
   "Yet Another Snippet extension"
   :group 'editing)
 
-(defvar yas-load-file-name load-file-name
+(defvar yas--load-file-name load-file-name
   "Store the filename that yasnippet.el was originally loaded from.")
 
 (defcustom yas-snippet-dirs (remove nil
                                     (list "~/.emacs.d/snippets"
-                                          (when yas-load-file-name
-                                            (concat (file-name-directory yas-load-file-name) "snippets"))))
+                                          (when yas--load-file-name
+                                            (concat (file-name-directory yas--load-file-name) "snippets"))))
   "Directory or list of snippet dirs for each major mode.
 
 The directory where user-created snippets are to be stored. Can
@@ -249,8 +249,8 @@ representation using `read-kbd-macro'."
              (set-default symbol key)
              ;; On very first loading of this defcustom,
              ;; `yas-trigger-key' is *not* loaded.
-             (if (fboundp 'yas-trigger-key-reload)
-                 (yas-trigger-key-reload old)))))
+             (if (fboundp 'yas--trigger-key-reload)
+                 (yas--trigger-key-reload old)))))
 
 (defcustom yas-next-field-key '("TAB" "<tab>")
   "The key to navigate to next field when a snippet is active.
@@ -264,8 +264,8 @@ Can also be a list of strings."
   :group 'yasnippet
   :set #'(lambda (symbol val)
            (set-default symbol val)
-           (if (fboundp 'yas-init-yas-in-snippet-keymap)
-               (yas-init-yas-in-snippet-keymap))))
+           (if (fboundp 'yas--init-yas-in-snippet-keymap)
+               (yas--init-yas-in-snippet-keymap))))
 
 
 (defcustom yas-prev-field-key '("<backtab>" "<S-tab>")
@@ -280,8 +280,8 @@ Can also be a list of strings."
   :group 'yasnippet
   :set #'(lambda (symbol val)
            (set-default symbol val)
-           (if (fboundp 'yas-init-yas-in-snippet-keymap)
-               (yas-init-yas-in-snippet-keymap))))
+           (if (fboundp 'yas--init-yas-in-snippet-keymap)
+               (yas--init-yas-in-snippet-keymap))))
 
 (defcustom yas-skip-and-clear-key '("C-d" "<delete>" "<deletechar>")
   "The key to clear the currently active field.
@@ -295,8 +295,8 @@ Can also be a list of strings."
   :group 'yasnippet
   :set #'(lambda (symbol val)
            (set-default symbol val)
-           (if (fboundp 'yas-init-yas-in-snippet-keymap)
-               (yas-init-yas-in-snippet-keymap))))
+           (if (fboundp 'yas--init-yas-in-snippet-keymap)
+               (yas--init-yas-in-snippet-keymap))))
 
 (defcustom yas-triggers-in-field nil
   "If non-nil, `yas-next-field-key' can trigger stacked expansions.
@@ -313,7 +313,7 @@ field"
     and call the next command bound to `yas-trigger-key'.
 
 - nil or the symbol `return-nil' mean do nothing. (and
-  `yas-expand-returns' nil)
+  `yas-expand' returns nil)
 
 - A lisp form (apply COMMAND . ARGS) means interactively call
   COMMAND, if ARGS is non-nil, call COMMAND non-interactively
@@ -407,7 +407,7 @@ the trigger key itself."
   "The face used to highlight the currently active field of a snippet"
   :group 'yasnippet)
 
-(defface yas-field-debug-face
+(defface yas--field-debug-face
   '()
   "The face used for debugging some overlays normally hidden"
   :group 'yasnippet)
@@ -415,7 +415,7 @@ the trigger key itself."
 \f
 ;;; User can also customize the next defvars
 
-(defun yas-define-some-keys (keys keymap definition)
+(defun yas--define-some-keys (keys keymap definition)
   "Bind KEYS to DEFINITION in KEYMAP, read with `read-kbd-macro'."
   (let ((keys (or (and (listp keys) keys)
                   (list keys))))
@@ -425,7 +425,7 @@ the trigger key itself."
 (defvar yas-keymap
   (let ((map (make-sparse-keymap)))
     (mapc #'(lambda (binding)
-              (yas-define-some-keys (car binding) map (cdr binding)))
+              (yas--define-some-keys (car binding) map (cdr binding)))
           `((,yas-next-field-key     . yas-next-field-or-maybe-expand)
             (,yas-prev-field-key     . yas-prev-field)
             ("C-g"                   . yas-abort-snippet)
@@ -527,45 +527,45 @@ snippet itself contains a condition that returns the symbol
 \f
 ;;; Internal variables
 
-(defvar yas-version "0.8.0 (beta)")
+(defvar yas--version "0.8.0 (beta)")
 
-(defvar yas-menu-table (make-hash-table)
+(defvar yas--menu-table (make-hash-table)
   "A hash table of MAJOR-MODE symbols to menu keymaps.")
 
-(defvar yas-known-modes
+(defvar yas--known-modes
   '(ruby-mode rst-mode markdown-mode)
   "A list of mode which is well known but not part of emacs.")
 
-(defvar yas-escaped-characters
+(defvar yas--escaped-characters
   '(?\\ ?` ?\" ?' ?$ ?} ?{ ?\( ?\))
   "List of characters which *might* need to be escaped.")
 
-(defconst yas-field-regexp
+(defconst yas--field-regexp
   "${\\([0-9]+:\\)?\\([^}]*\\)}"
   "A regexp to *almost* recognize a field.")
 
-(defconst yas-multi-dollar-lisp-expression-regexp
+(defconst yas--multi-dollar-lisp-expression-regexp
   "$+[ \t\n]*\\(([^)]*)\\)"
   "A regexp to *almost* recognize a \"$(...)\" expression.")
 
-(defconst yas-backquote-lisp-expression-regexp
+(defconst yas--backquote-lisp-expression-regexp
   "`\\([^`]*\\)`"
   "A regexp to recognize a \"`lisp-expression`\" expression." )
 
-(defconst yas-transform-mirror-regexp
+(defconst yas--transform-mirror-regexp
   "${\\(?:\\([0-9]+\\):\\)?$\\([ \t\n]*([^}]*\\)"
   "A regexp to *almost* recognize a mirror with a transform.")
 
-(defconst yas-simple-mirror-regexp
+(defconst yas--simple-mirror-regexp
   "$\\([0-9]+\\)"
   "A regexp to recognize a simple mirror.")
 
-(defvar yas-snippet-id-seed 0
+(defvar yas--snippet-id-seed 0
   "Contains the next id for a snippet.")
 
-(defun yas-snippet-next-id ()
-  (let ((id yas-snippet-id-seed))
-    (incf yas-snippet-id-seed)
+(defun yas--snippet-next-id ()
+  (let ((id yas--snippet-id-seed))
+    (incf yas--snippet-id-seed)
     id))
 
 \f
@@ -574,14 +574,14 @@ snippet itself contains a condition that returns the symbol
 ;; XXX: `last-buffer-undo-list' is somehow needed in Carbon Emacs for MacOSX
 (defvar last-buffer-undo-list nil)
 
-(defvar yas-minor-mode-menu nil
+(defvar yas--minor-mode-menu nil
   "Holds the YASnippet menu")
 
-(defun yas-init-minor-keymap ()
+(defun yas--init-minor-keymap ()
   (let ((map (make-sparse-keymap)))
-    (easy-menu-define yas-minor-mode-menu
+    (easy-menu-define yas--minor-mode-menu
       map
-      "Menu used when YAS-minor-mode is active."
+      "Menu used when `yas-minor-mode' is active."
       '("YASnippet"
         "----"
         ["Expand trigger" yas-expand
@@ -651,11 +651,11 @@ snippet itself contains a condition that returns the symbol
                                                  'yas-ido-prompt)]
          ["Completing read" (setq yas-prompt-functions
                                   (cons 'yas-completing-prompt
-                                        (remove 'yas-completing-prompt-prompt
+                                        (remove 'yas-completing-prompt
                                                 yas-prompt-functions)))
           :help "Use a normal minibuffer prompt"
           :active t :style radio   :selected (eq (car yas-prompt-functions)
-                                                 'yas-completing-prompt-prompt)]
+                                                 'yas-completing-prompt)]
          )
         ("Misc"
          ["Wrap region in exit marker"
@@ -693,10 +693,10 @@ snippet itself contains a condition that returns the symbol
     (define-key map "\C-c&\C-v" 'yas-visit-snippet-file)
     map))
 
-(defvar yas-minor-mode-map (yas-init-minor-keymap)
+(defvar yas-minor-mode-map (yas--init-minor-keymap)
   "The keymap used when `yas-minor-mode' is active.")
 
-(defun yas-trigger-key-reload (&optional unbind-key)
+(defun yas--trigger-key-reload (&optional unbind-key)
   "Rebind `yas-expand' to the new value of `yas-trigger-key'.
 
 With optional UNBIND-KEY, try to unbind that key from
@@ -710,10 +710,10 @@ With optional UNBIND-KEY, try to unbind that key from
               (not (string= yas-trigger-key "")))
     (define-key yas-minor-mode-map (read-kbd-macro yas-trigger-key) 'yas-expand)))
 
-(defvar yas-tables (make-hash-table)
-  "A hash table of mode symbols to `yas-table' objects.")
+(defvar yas--tables (make-hash-table)
+  "A hash table of mode symbols to `yas--table' objects.")
 
-(defvar yas-parents (make-hash-table)
+(defvar yas--parents (make-hash-table)
   "A hash table of mode symbols do lists of direct parent mode symbols.
 
 This list is populated when reading the \".yas-parents\" files
@@ -724,14 +724,14 @@ There might be additionalal parenting information stored in the
 `derived-mode-parent' property of some mode symbols, but that is
 not recorded here.")
 
-(defvar yas-direct-keymaps (list)
+(defvar yas--direct-keymaps (list)
   "Keymap alist supporting direct snippet keybindings.
 
 This variable is is placed in `emulation-mode-map-alists'.
 
 Its elements looks like (TABLE-NAME . KEYMAP). They're
 instantiated on `yas-reload-all' but KEYMAP is added to only when
-loading snippets. `yas-/direct-TABLE-NAME' is then a variable set
+loading snippets. `yas--direct-TABLE-NAME' is then a variable set
 buffer-locally when entering `yas-minor-mode'. KEYMAP binds all
 defined direct keybindings to the command
 `yas-expand-from-keymap' which then which snippet to expand.")
@@ -739,14 +739,14 @@ defined direct keybindings to the command
 (defun yas-direct-keymaps-reload ()
   "Force reload the direct keybinding for active snippet tables."
   (interactive)
-  (setq yas-direct-keymaps nil)
+  (setq yas--direct-keymaps nil)
   (maphash #'(lambda (name table)
-               (push (cons (intern (format "yas-/direct-%s" name))
-                           (yas-table-direct-keymap table))
-                     yas-direct-keymaps))
-           yas-tables))
+               (push (cons (intern (format "yas--direct-%s" name))
+                           (yas--table-direct-keymap table))
+                     yas--direct-keymaps))
+           yas--tables))
 
-(defun yas-modes-to-activate ()
+(defun yas--modes-to-activate ()
   "Compute list of mode symbols that are active for `yas-expand'
 and friends."
   (let ((modes-to-activate (list major-mode))
@@ -758,7 +758,7 @@ and friends."
     (remove-duplicates
      (append modes-to-activate
              (mapcan #'(lambda (mode)
-                         (yas-all-parents mode))
+                         (yas--all-parents mode))
                      modes-to-activate)))))
 
 (defvar yas-minor-mode-hook nil
@@ -786,32 +786,32 @@ Key bindings:
   (cond (yas-minor-mode
          ;; Reload the trigger key
          ;;
-         (yas-trigger-key-reload)
+         (yas--trigger-key-reload)
          ;; Install the direct keymaps in `emulation-mode-map-alists'
          ;; (we use `add-hook' even though it's not technically a hook,
          ;; but it works). Then define variables named after modes to
-         ;; index `yas-direct-keymaps'.
+         ;; index `yas--direct-keymaps'.
          ;;
          ;; Also install the post-command-hook.
          ;;
-         (add-hook 'emulation-mode-map-alists 'yas-direct-keymaps)
-         (add-hook 'post-command-hook 'yas-post-command-handler nil t)
-         ;; Set the `yas-/direct-%s' vars for direct keymap expansion
+         (add-hook 'emulation-mode-map-alists 'yas--direct-keymaps)
+         (add-hook 'post-command-hook 'yas--post-command-handler nil t)
+         ;; Set the `yas--direct-%s' vars for direct keymap expansion
          ;;
-         (dolist (mode (yas-modes-to-activate))
-           (let ((name (intern (format "yas-/direct-%s" mode))))
+         (dolist (mode (yas--modes-to-activate))
+           (let ((name (intern (format "yas--direct-%s" mode))))
              (set-default name nil)
              (set (make-local-variable name) t)))
          ;; Perform JIT loads
          ;;
-         (yas-load-pending-jits))
+         (yas--load-pending-jits))
         (t
          ;; Uninstall the direct keymaps and the post-command hook
          ;;
-         (remove-hook 'post-command-hook 'yas-post-command-handler t)
-         (remove-hook 'emulation-mode-map-alists 'yas-direct-keymaps))))
+         (remove-hook 'post-command-hook 'yas--post-command-handler t)
+         (remove-hook 'emulation-mode-map-alists 'yas--direct-keymaps))))
 
-(defvar yas-dont-activate '(minibufferp)
+(defvar yas--dont-activate '(minibufferp)
   "If non-nil don't let `yas-minor-mode-on' active yas for this buffer.
 
 If a function, then its result is used.
@@ -822,18 +822,18 @@ activate yas for this buffer.
 `yas-minor-mode-on' is usually called by `yas-global-mode' so
 this effectively lets you define exceptions to the \"global\"
 behaviour. Can also be a function of zero arguments.")
-(make-variable-buffer-local 'yas-dont-activate)
+(make-variable-buffer-local 'yas--dont-activate)
 
 (defun yas-minor-mode-on ()
   "Turn on YASnippet minor mode.
 
-Do this unless `yas-dont-activate' is truish "
+Do this unless `yas--dont-activate' is truish "
   (interactive)
-  (unless (cond ((functionp yas-dont-activate)
-                 (funcall yas-dont-activate))
-                ((consp yas-dont-activate)
-                 (some #'funcall yas-dont-activate))
-                (yas-dont-activate))
+  (unless (cond ((functionp yas--dont-activate)
+                 (funcall yas--dont-activate))
+                ((consp yas--dont-activate)
+                 (some #'funcall yas--dont-activate))
+                (yas--dont-activate))
     ;; Load all snippets definitions unless we still don't have a
     ;; root-directory or some snippets have already been loaded.
     ;;
@@ -844,7 +844,7 @@ Do this unless `yas-dont-activate' is truish "
   :group 'yasnippet
   :require 'yasnippet)
 
-(defadvice yas-global-mode (before yas-reload-with-jit (arg) activate)
+(defadvice yas-global-mode (before yas--reload-with-jit (arg) activate)
   (cond ((and arg
               (numberp arg)
               (> arg 1))
@@ -857,7 +857,7 @@ Do this unless `yas-dont-activate' is truish "
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Major mode stuff
 ;;
-(defvar yas-font-lock-keywords
+(defvar yas--font-lock-keywords
   (append '(("^#.*$" . font-lock-comment-face))
           lisp-font-lock-keywords
           lisp-font-lock-keywords-1
@@ -874,7 +874,7 @@ Do this unless `yas-dont-activate' is truish "
             ("}"
              (0 font-lock-keyword-face)))))
 
-(defun yas-init-major-keymap ()
+(defun yas--init-major-keymap ()
   (let ((map (make-sparse-keymap)))
     (easy-menu-define nil
       map
@@ -890,13 +890,13 @@ Do this unless `yas-dont-activate' is truish "
     map))
 
 (defvar snippet-mode-map
-  (yas-init-major-keymap)
+  (yas--init-major-keymap)
   "The keymap used when `snippet-mode' is active")
 
 
 (define-derived-mode snippet-mode text-mode "Snippet"
   "A mode for editing yasnippets"
-  (setq font-lock-defaults '(yas-font-lock-keywords))
+  (setq font-lock-defaults '(yas--font-lock-keywords))
   (set (make-local-variable 'require-final-newline) nil)
   (set (make-local-variable 'comment-start) "#")
   (set (make-local-variable 'comment-start-skip) "#+[\t ]*"))
@@ -905,7 +905,7 @@ Do this unless `yas-dont-activate' is truish "
 \f
 ;;; Internal structs for template management
 
-(defstruct (yas-template (:constructor yas-make-blank-template))
+(defstruct (yas--template (:constructor yas--make-blank-template))
   "A template for a snippet."
   key
   content
@@ -921,46 +921,46 @@ Do this unless `yas-dont-activate' is truish "
   table
   )
 
-(defun yas-populate-template (template &rest args)
+(defun yas--populate-template (template &rest args)
   "Helper function to populate a template with properties"
   (let (p v)
     (while args
       (aset template
             (position (intern (substring (symbol-name (car args)) 1))
-                      (mapcar #'car (get 'yas-template 'cl-struct-slots)))
+                      (mapcar #'car (get 'yas--template 'cl-struct-slots)))
             (second args))
       (setq args (cddr args)))
     template))
 
-(defstruct (yas-table (:constructor yas-make-snippet-table (name)))
+(defstruct (yas--table (:constructor yas--make-snippet-table (name)))
   "A table to store snippets for a particular mode.
 
 Has the following fields:
 
-`yas-table-name'
+`yas--table-name'
 
   A symbol name normally corresponding to a major mode, but can
   also be a pseudo major-mode to be referenced in
   `yas-extra-modes', for example.
 
-`yas-table-hash'
+`yas--table-hash'
 
   A hash table (KEY . NAMEHASH), known as the \"keyhash\". KEY is
   a string or a vector, where the former is the snippet's trigger
   and the latter means it's a direct keybinding. NAMEHASH is yet
   another hash of (NAME . TEMPLATE) where NAME is the snippet's
-  name and TEMPLATE is a `yas-template' object.
+  name and TEMPLATE is a `yas--template' object.
 
-`yas-table-direct-keymap'
+`yas--table-direct-keymap'
 
   A keymap for the snippets in this table that have direct
   keybindings. This is kept in sync with the keyhash, i.e., all
   the elements of the keyhash that are vectors appear here as
   bindings to `yas-expand-from-keymap'.
 
-`yas-table-uuidhash'
+`yas--table-uuidhash'
 
-  A hash table mapping snippets uuid's to the same `yas-template'
+  A hash table mapping snippets uuid's to the same `yas--template'
   objects. A snippet uuid defaults to the snippet's name.
 "
   name
@@ -969,21 +969,21 @@ Has the following fields:
   (parents nil)
   (direct-keymap (make-sparse-keymap)))
 
-(defun yas-get-template-by-uuid (mode uuid)
+(defun yas--get-template-by-uuid (mode uuid)
   "Find the snippet template in MODE by its UUID."
-  (let* ((table (gethash mode yas-tables mode)))
+  (let* ((table (gethash mode yas--tables mode)))
     (when table
-      (gethash uuid (yas-table-uuidhash table)))))
+      (gethash uuid (yas--table-uuidhash table)))))
 
 ;; Apropos storing/updating in TABLE, this works in two steps:
 ;;
-;; 1. `yas-remove-template-by-uuid' removes any
+;; 1. `yas--remove-template-by-uuid' removes any
 ;;    keyhash-namehash-template mappings from TABLE, grabing the
 ;;    snippet by its uuid. Also removes mappings from TABLE's
-;;    `yas-table-direct-keymap' (FIXME: and should probably take care
+;;    `yas--table-direct-keymap' (FIXME: and should probably take care
 ;;    of potentially stale menu bindings right?.)
 ;;
-;; 2. `yas-add-template' adds this all over again.
+;; 2. `yas--add-template' adds this all over again.
 ;;
 ;;    Create a new or add to an existing keyhash-namehash mapping.
 ;;
@@ -1003,77 +1003,78 @@ Has the following fields:
 ;;  D:   # name: Baz
 ;;       # key: baz
 ;;
-;;  keyhash       namehashes(3)      yas-template structs(4)
+;;  keyhash       namehashes(3)      yas--template structs(4)
 ;;  -----------------------------------------------------
 ;;                                            __________
 ;;                                           /          \
-;;  "foo"      --->  "The Foo" --->  [yas-template A]   |
-;;                   "Mrs Foo" --->  [yas-template B]   |
+;;  "foo"      --->  "The Foo" --->  [yas--template A]   |
+;;                   "Mrs Foo" --->  [yas--template B]   |
 ;;                                                      |
 ;;  [C-c M-l]  --->  "The Foo" -------------------------/
-;;                   "The Bar" --->  [yas-template C]
+;;                   "The Bar" --->  [yas--template C]
 ;;
-;;  "baz"      --->  "Baz"     --->  [yas-template D]
+;;  "baz"      --->  "Baz"     --->  [yas--template D]
 ;;
 ;; Additionally, since uuid defaults to the name, we have a
-;; `yas-table-uuidhash' for TABLE
+;; `yas--table-uuidhash' for TABLE
 ;;
-;; uuidhash       yas-template structs
+;; uuidhash       yas--template structs
 ;; -------------------------------
-;; "The Foo" ---> [yas-template A]
-;; "Mrs Foo" ---> [yas-template B]
-;; "The Bar" ---> [yas-template C]
-;; "Baz"     ---> [yas-template D]
+;; "The Foo" ---> [yas--template A]
+;; "Mrs Foo" ---> [yas--template B]
+;; "The Bar" ---> [yas--template C]
+;; "Baz"     ---> [yas--template D]
 ;;
 ;; FIXME: the more I look at this data-structure the more I think I'm
-;; stupid. There has to be an easier way (but beware lots of code depends on this).
+;; stupid. There has to be an easier way (but beware lots of code
+;; depends on this).
 ;;
-(defun yas-remove-template-by-uuid (table uuid)
+(defun yas--remove-template-by-uuid (table uuid)
   "Remove from TABLE a template identified by UUID."
-  (let ((template (gethash uuid (yas-table-uuidhash table))))
+  (let ((template (gethash uuid (yas--table-uuidhash table))))
     (when template
-      (let* ((name                (yas-template-name template))
+      (let* ((name                (yas--template-name template))
              (empty-keys          nil))
         ;; Remove the name from each of the targeted namehashes
         ;;
         (maphash #'(lambda (k v)
                      (let ((template (gethash name v)))
                        (when (and template
-                                  (eq uuid (yas-template-uuid template)))
+                                  (eq uuid (yas--template-uuid template)))
                          (remhash name v)
                          (when (zerop (hash-table-count v))
                            (push k empty-keys)))))
-                 (yas-table-hash table))
+                 (yas--table-hash table))
         ;; Remove the namehash themselves if they've become empty
         ;;
         (dolist (key empty-keys)
           (when (vectorp key)
-            (define-key (yas-table-direct-keymap table) key nil))
-          (remhash key (yas-table-hash table)))
+            (define-key (yas--table-direct-keymap table) key nil))
+          (remhash key (yas--table-hash table)))
 
         ;; Finally, remove the uuid from the uuidhash
         ;;
-        (remhash uuid (yas-table-uuidhash table))))))
+        (remhash uuid (yas--table-uuidhash table))))))
 
-(defun yas-add-template (table template)
+(defun yas--add-template (table template)
   "Store in TABLE the snippet template TEMPLATE.
 
 KEY can be a string (trigger key) of a vector (direct
 keybinding)."
-  (let ((name (yas-template-name template))
-        (key (yas-template-key template))
-        (keybinding (yas-template-keybinding template))
-        (menu-binding-pair (yas-snippet-menu-binding-pair-get-create template)))
+  (let ((name (yas--template-name template))
+        (key (yas--template-key template))
+        (keybinding (yas--template-keybinding template))
+        (menu-binding-pair (yas--snippet-menu-binding-pair-get-create template)))
     (dolist (k (remove nil (list key keybinding)))
       (puthash name
                template
                (or (gethash k
-                            (yas-table-hash table))
+                            (yas--table-hash table))
                    (puthash k
                             (make-hash-table :test 'equal)
-                            (yas-table-hash table))))
+                            (yas--table-hash table))))
       (when (vectorp k)
-        (define-key (yas-table-direct-keymap table) k 'yas-expand-from-keymap)))
+        (define-key (yas--table-direct-keymap table) k 'yas-expand-from-keymap)))
 
     ;; Update trigger & keybinding in the menu-binding pair
     ;;
@@ -1082,28 +1083,28 @@ keybinding)."
             (or (and keybinding (key-description keybinding))
                 (and key (concat key yas-trigger-symbol)))))
 
-    (puthash (yas-template-uuid template) template (yas-table-uuidhash table))))
+    (puthash (yas--template-uuid template) template (yas--table-uuidhash table))))
 
-(defun yas-update-template (table template)
+(defun yas--update-template (table template)
   "Add or update TEMPLATE in TABLE.
 
 Also takes care of adding and updating to the associated menu."
   ;; Remove from table by uuid
   ;;
-  (yas-remove-template-by-uuid table (yas-template-uuid template))
+  (yas--remove-template-by-uuid table (yas--template-uuid template))
   ;; Add to table again
   ;;
-  (yas-add-template table template)
+  (yas--add-template table template)
   ;; Take care of the menu
   ;;
-  (let ((keymap (yas-menu-keymap-get-create table))
-        (group (yas-template-group template)))
+  (let ((keymap (yas--menu-keymap-get-create table))
+        (group (yas--template-group template)))
     (when (and yas-use-menu
                keymap
-               (not (cdr (yas-template-menu-binding-pair template))))
+               (not (cdr (yas--template-menu-binding-pair template))))
       ;; Remove from menu keymap
       ;;
-      (yas-delete-from-keymap keymap (yas-template-uuid template))
+      (yas--delete-from-keymap keymap (yas--template-uuid template))
 
       ;; Add necessary subgroups as necessary.
       ;;
@@ -1118,63 +1119,63 @@ Also takes care of adding and updating to the associated menu."
 
       ;; Add this entry to the keymap
       ;;
-      (let ((menu-binding-pair (yas-snippet-menu-binding-pair-get-create template)))
-        (define-key keymap (vector (make-symbol (yas-template-uuid template))) (car menu-binding-pair))))))
+      (let ((menu-binding-pair (yas--snippet-menu-binding-pair-get-create template)))
+        (define-key keymap (vector (make-symbol (yas--template-uuid template))) (car menu-binding-pair))))))
 
-(defun yas-namehash-templates-alist (namehash)
+(defun yas--namehash-templates-alist (namehash)
   (let (alist)
     (maphash #'(lambda (k v)
                  (push (cons k v) alist))
              namehash)
     alist))
 
-(defun yas-fetch (table key)
+(defun yas--fetch (table key)
   "Fetch templates in TABLE by KEY.
 
 Return a list of cons (NAME . TEMPLATE) where NAME is a
-string and TEMPLATE is a `yas-template' structure."
-  (let* ((keyhash (yas-table-hash table))
+string and TEMPLATE is a `yas--template' structure."
+  (let* ((keyhash (yas--table-hash table))
          (namehash (and keyhash (gethash key keyhash))))
     (when namehash
-      (yas-filter-templates-by-condition (yas-namehash-templates-alist namehash)))))
+      (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash)))))
 
 \f
 ;;; Filtering/condition logic
 
-(defun yas-eval-condition (condition)
+(defun yas--eval-condition (condition)
   (condition-case err
       (save-excursion
         (save-restriction
           (save-match-data
             (eval condition))))
     (error (progn
-             (yas-message 1 "Error in condition evaluation: %s" (error-message-string err))
+             (yas--message 1 "Error in condition evaluation: %s" (error-message-string err))
              nil))))
 
 
-(defun yas-filter-templates-by-condition (templates)
+(defun yas--filter-templates-by-condition (templates)
   "Filter the templates using the applicable condition.
 
 TEMPLATES is a list of cons (NAME . TEMPLATE) where NAME is a
-string and TEMPLATE is a `yas-template' structure.
+string and TEMPLATE is a `yas--template' structure.
 
 This function implements the rules described in
 `yas-buffer-local-condition'.  See that variables documentation."
-  (let ((requirement (yas-require-template-specific-condition-p)))
+  (let ((requirement (yas--require-template-specific-condition-p)))
     (if (eq requirement 'always)
         templates
       (remove-if-not #'(lambda (pair)
-                         (yas-template-can-expand-p
-                          (yas-template-condition (cdr pair)) requirement))
+                         (yas--template-can-expand-p
+                          (yas--template-condition (cdr pair)) requirement))
                      templates))))
 
-(defun yas-require-template-specific-condition-p ()
+(defun yas--require-template-specific-condition-p ()
   "Decides if this buffer requests/requires snippet-specific
 conditions to filter out potential expansions."
   (if (eq 'always yas-buffer-local-condition)
       'always
     (let ((local-condition (or (and (consp yas-buffer-local-condition)
-                                    (yas-eval-condition yas-buffer-local-condition))
+                                    (yas--eval-condition yas-buffer-local-condition))
                                yas-buffer-local-condition)))
       (when local-condition
         (if (eq local-condition t)
@@ -1184,32 +1185,32 @@ conditions to filter out potential expansions."
                (symbolp (cdr local-condition))
                (cdr local-condition)))))))
 
-(defun yas-template-can-expand-p (condition requirement)
+(defun yas--template-can-expand-p (condition requirement)
   "Evaluates CONDITION and REQUIREMENT and returns a boolean"
   (let* ((result (or (null condition)
-                     (yas-eval-condition condition))))
+                     (yas--eval-condition condition))))
     (cond ((eq requirement t)
            result)
           (t
            (eq requirement result)))))
 
-(defun yas-all-parents (mode)
+(defun yas--all-parents (mode)
   "Returns a list of all parent modes of MODE"
-  (let ((parents (gethash mode yas-parents)))
+  (let ((parents (gethash mode yas--parents)))
     (append parents
-            (mapcan #'yas-all-parents parents))))
+            (mapcan #'yas--all-parents parents))))
 
-(defun yas-table-templates (table)
+(defun yas--table-templates (table)
   (when table
     (let ((acc (list)))
       (maphash #'(lambda (key namehash)
                    (maphash #'(lambda (name template)
                                 (push (cons name template) acc))
                             namehash))
-               (yas-table-hash table))
-      (yas-filter-templates-by-condition acc))))
+               (yas--table-hash table))
+      (yas--filter-templates-by-condition acc))))
 
-(defun yas-current-key ()
+(defun yas--current-key ()
   "Get the key under current position. A key is used to find
 the template of a snippet in the current snippet-table."
   (let ((start (point))
@@ -1226,8 +1227,8 @@ the template of a snippet in the current snippet-table."
         (setq start (point)))
       (setq templates
             (mapcan #'(lambda (table)
-                        (yas-fetch table (buffer-substring-no-properties start end)))
-                    (yas-get-snippet-tables)))
+                        (yas--fetch table (buffer-substring-no-properties start end)))
+                    (yas--get-snippet-tables)))
       (if templates
           (setq done t)
         (setq start end)))
@@ -1236,30 +1237,30 @@ the template of a snippet in the current snippet-table."
           end)))
 
 
-(defun yas-table-all-keys (table)
+(defun yas--table-all-keys (table)
   (when table
     (let ((acc))
       (maphash #'(lambda (key namehash)
-                   (when (yas-filter-templates-by-condition (yas-namehash-templates-alist namehash))
+                   (when (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash))
                      (push key acc)))
-               (yas-table-hash table))
+               (yas--table-hash table))
       acc)))
 
 \f
 ;;; Internal functions:
 
-(defun yas-real-mode? (mode)
+(defun yas--real-mode? (mode)
   "Try to find out if MODE is a real mode. The MODE bound to
 a function (like `c-mode') is considered real mode. Other well
 known mode like `ruby-mode' which is not part of Emacs might
 not bound to a function until it is loaded. So yasnippet keeps
 a list of modes like this to help the judgement."
   (or (fboundp mode)
-      (find mode yas-known-modes)))
+      (find mode yas--known-modes)))
 
-(defun yas-eval-lisp (form)
+(defun yas--eval-lisp (form)
   "Evaluate FORM and convert the result to string."
-  (let ((retval (catch 'yas-exception
+  (let ((retval (catch 'yas--exception
                   (condition-case err
                       (save-excursion
                         (save-restriction
@@ -1269,23 +1270,23 @@ a list of modes like this to help the judgement."
                               (when result
                                 (format "%s" result))))))
                     (error (if yas-good-grace
-                               (yas-format "elisp error! %s" (error-message-string err))
-                             (error (yas-format "elisp error: %s"
+                               (yas--format "elisp error! %s" (error-message-string err))
+                             (error (yas--format "elisp error: %s"
                                             (error-message-string err)))))))))
     (when (and (consp retval)
-               (eq 'yas-exception (car retval)))
+               (eq 'yas--exception (car retval)))
       (error (cdr retval)))
     retval))
 
-(defun yas-eval-lisp-no-saves (form)
+(defun yas--eval-lisp-no-saves (form)
   (condition-case err
       (eval form)
     (error (if yas-good-grace
-               (yas-format "elisp error! %s" (error-message-string err))
-             (error (yas-format "elisp error: %s"
+               (yas--format "elisp error! %s" (error-message-string err))
+             (error (yas--format "elisp error: %s"
                             (error-message-string err)))))))
 
-(defun yas-read-lisp (string &optional nil-on-error)
+(defun yas--read-lisp (string &optional nil-on-error)
   "Read STRING as a elisp expression and return it.
 
 In case STRING in an invalid expression and NIL-ON-ERROR is nil,
@@ -1295,7 +1296,7 @@ return an expression that when evaluated will issue an error."
     (error (and (not nil-on-error)
                 `(error (error-message-string ,err))))))
 
-(defun yas-read-keybinding (keybinding)
+(defun yas--read-keybinding (keybinding)
   "Read KEYBINDING as a snippet keybinding, return a vector."
   (when (and keybinding
              (not (string-match "keybinding" keybinding)))
@@ -1305,7 +1306,7 @@ return an expression that when evaluated will issue an error."
                        (read-kbd-macro keybinding 'need-vector))))
           res)
       (error
-       (yas-message 3 "warning: keybinding \"%s\" invalid since %s."
+       (yas--message 3 "warning: keybinding \"%s\" invalid since %s."
                 keybinding (error-message-string err))
        nil))))
 
@@ -1320,47 +1321,47 @@ ensure your use `make-local-variable' when you set it.")
   (if (listp yas-extra-modes) yas-extra-modes (list yas-extra-modes)))
 (defvaralias 'yas/mode-symbol 'yas-extra-modes)
 
-(defun yas-table-get-create (mode)
+(defun yas--table-get-create (mode)
   "Get or create the snippet table corresponding to MODE."
   (let ((table (gethash mode
-                        yas-tables)))
+                        yas--tables)))
     (unless table
-      (setq table (yas-make-snippet-table (symbol-name mode)))
-      (puthash mode table yas-tables)
-      (push (cons (intern (format "yas-/direct-%s" mode))
-                  (yas-table-direct-keymap table))
-            yas-direct-keymaps))
+      (setq table (yas--make-snippet-table (symbol-name mode)))
+      (puthash mode table yas--tables)
+      (push (cons (intern (format "yas--direct-%s" mode))
+                  (yas--table-direct-keymap table))
+            yas--direct-keymaps))
     table))
 
-(defun yas-get-snippet-tables ()
+(defun yas--get-snippet-tables ()
   "Get snippet tables for current buffer.
 
-Return a list of `yas-table' objects. The list of modes to
-consider is returned by `yas-modes-to-activate'"
+Return a list of `yas--table' objects. The list of modes to
+consider is returned by `yas--modes-to-activate'"
   (remove nil
           (mapcar #'(lambda (mode-name)
-                      (gethash mode-name yas-tables))
-                  (yas-modes-to-activate))))
+                      (gethash mode-name yas--tables))
+                  (yas--modes-to-activate))))
 
-(defun yas-menu-keymap-get-create (table)
+(defun yas--menu-keymap-get-create (table)
   "Get or create the main menu keymap correspondong to MODE.
 
 This may very well create a plethora of menu keymaps and arrange
-them in all `yas-menu-table'"
-  (let* ((mode (intern (yas-table-name table)))
-         (menu-keymap (or (gethash mode yas-menu-table)
-                          (puthash mode (make-sparse-keymap) yas-menu-table)))
-        (parents (yas-table-parents table)))
-    (mapc #'yas-menu-keymap-get-create parents)
-    (define-key yas-minor-mode-menu (vector mode)
+them in all `yas--menu-table'"
+  (let* ((mode (intern (yas--table-name table)))
+         (menu-keymap (or (gethash mode yas--menu-table)
+                          (puthash mode (make-sparse-keymap) yas--menu-table)))
+        (parents (yas--table-parents table)))
+    (mapc #'yas--menu-keymap-get-create parents)
+    (define-key yas--minor-mode-menu (vector mode)
         `(menu-item ,(symbol-name mode) ,menu-keymap
-                    :visible (yas-show-menu-p ',mode)))
+                    :visible (yas--show-menu-p ',mode)))
     menu-keymap))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Template-related and snippet loading functions
 
-(defun yas-parse-template (&optional file)
+(defun yas--parse-template (&optional file)
   "Parse the template in the current buffer.
 
 Optional FILE is the absolute file name of the file being
@@ -1398,7 +1399,7 @@ Here's a list of currently recognized directives:
          bound
          condition
          (group (and file
-                     (yas-calculate-group file)))
+                     (yas--calculate-group file)))
          expand-env
          binding
          uuid)
@@ -1420,11 +1421,11 @@ Here's a list of currently recognized directives:
                  (when (string= "name" (match-string-no-properties 1))
                    (setq name (match-string-no-properties 2)))
                  (when (string= "condition" (match-string-no-properties 1))
-                   (setq condition (yas-read-lisp (match-string-no-properties 2))))
+                   (setq condition (yas--read-lisp (match-string-no-properties 2))))
                  (when (string= "group" (match-string-no-properties 1))
                    (setq group (match-string-no-properties 2)))
                  (when (string= "expand-env" (match-string-no-properties 1))
-                   (setq expand-env (yas-read-lisp (match-string-no-properties 2)
+                   (setq expand-env (yas--read-lisp (match-string-no-properties 2)
                                                    'nil-on-error)))
                  (when (string= "binding" (match-string-no-properties 1))
                    (setq binding (match-string-no-properties 2)))))
@@ -1433,12 +1434,12 @@ Here's a list of currently recognized directives:
     (unless (or key binding)
       (setq key (and file (file-name-nondirectory file))))
     (when (eq type 'command)
-      (setq template (yas-read-lisp (concat "(progn" template ")"))))
+      (setq template (yas--read-lisp (concat "(progn" template ")"))))
     (when group
       (setq group (split-string group "\\.")))
     (list key template name condition group expand-env file binding uuid)))
 
-(defun yas-calculate-group (file)
+(defun yas--calculate-group (file)
   "Calculate the group for snippet file path FILE."
   (let* ((dominating-dir (locate-dominating-file file
                                                  ".yas-make-groups"))
@@ -1455,7 +1456,7 @@ Here's a list of currently recognized directives:
                                                (directory-file-name extra-dir)))))
     group))
 
-(defun yas-subdirs (directory &optional filep)
+(defun yas--subdirs (directory &optional filep)
   "Return subdirs or files of DIRECTORY according to FILEP."
   (remove-if (lambda (file)
                (or (string-match "^\\."
@@ -1469,72 +1470,72 @@ Here's a list of currently recognized directives:
                      (not (file-directory-p file)))))
              (directory-files directory t)))
 
-(defun yas-make-menu-binding (template)
-  (let ((mode (intern (yas-table-name (yas-template-table template)))))
-    `(lambda () (interactive) (yas-expand-or-visit-from-menu ',mode ,(yas-template-uuid template)))))
+(defun yas--make-menu-binding (template)
+  (let ((mode (intern (yas--table-name (yas--template-table template)))))
+    `(lambda () (interactive) (yas--expand-or-visit-from-menu ',mode ,(yas--template-uuid template)))))
 
-(defun yas-expand-or-visit-from-menu (mode uuid)
-  (let* ((table (yas-table-get-create mode))
-         (yas-current-template (and table
-                                    (gethash uuid (yas-table-uuidhash table)))))
-    (when yas-current-template
+(defun yas--expand-or-visit-from-menu (mode uuid)
+  (let* ((table (yas--table-get-create mode))
+         (yas--current-template (and table
+                                    (gethash uuid (yas--table-uuidhash table)))))
+    (when yas--current-template
       (if yas-visit-from-menu
-          (yas-visit-snippet-file-1 yas-current-template)
+          (yas--visit-snippet-file-1 yas--current-template)
         (let ((where (if (region-active-p)
                          (cons (region-beginning) (region-end))
                        (cons (point) (point)))))
-          (yas-expand-snippet (yas-template-content yas-current-template)
+          (yas-expand-snippet (yas--template-content yas--current-template)
                               (car where)
                               (cdr where)
-                              (yas-template-expand-env yas-current-template)))))))
+                              (yas--template-expand-env yas--current-template)))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Popping up for keys and templates
 ;;
-(defvar yas-x-pretty-prompt-templates nil
+(defvar yas--x-pretty-prompt-templates nil
   "If non-nil, attempt to prompt for templates like TextMate.")
 
 
-(defun yas-prompt-for-template (templates &optional prompt)
+(defun yas--prompt-for-template (templates &optional prompt)
   "Interactively choose a template from the list TEMPLATES.
 
-TEMPLATES is a list of `yas-template'."
+TEMPLATES is a list of `yas--template'."
   (when templates
     (setq templates
           (sort templates #'(lambda (t1 t2)
-                              (< (length (yas-template-name t1))
-                                 (length (yas-template-name t2))))))
-    (if yas-x-pretty-prompt-templates
-        (yas-x-pretty-prompt-templates "Choose a snippet" templates)
+                              (< (length (yas--template-name t1))
+                                 (length (yas--template-name t2))))))
+    (if yas--x-pretty-prompt-templates
+        (yas--x-pretty-prompt-templates "Choose a snippet" templates)
       (some #'(lambda (fn)
                 (funcall fn (or prompt "Choose a snippet: ")
                          templates
-                         #'yas-template-name))
+                         #'yas--template-name))
             yas-prompt-functions))))
 
-(defun yas-prompt-for-keys (keys &optional prompt)
+(defun yas--prompt-for-keys (keys &optional prompt)
   "Interactively choose a template key from the list KEYS."
   (when keys
     (some #'(lambda (fn)
               (funcall fn (or prompt "Choose a snippet key: ") keys))
           yas-prompt-functions)))
 
-(defun yas-prompt-for-table (tables &optional prompt)
+(defun yas--prompt-for-table (tables &optional prompt)
   (when tables
     (some #'(lambda (fn)
               (funcall fn (or prompt "Choose a snippet table: ")
                        tables
-                       #'yas-table-name))
+                       #'yas--table-name))
           yas-prompt-functions)))
 
 (defun yas-x-prompt (prompt choices &optional display-fn)
   "Display choices in a x-window prompt."
   ;; FIXME: HACK: if we notice that one of the objects in choices is
-  ;; actually a `yas-template', defer to `yas-x-prompt-pretty-templates'
+  ;; actually a `yas--template', defer to `yas--x-prompt-pretty-templates'
   ;;
   ;; This would be better implemented by passing CHOICES as a
   ;; strucutred tree rather than a list. Modifications would go as far
-  ;; up as `yas-all-templates' I think.
+  ;; up as `yas--all-templates' I think.
   ;;
   (when (and window-system choices)
     (let ((chosen
@@ -1557,26 +1558,26 @@ TEMPLATES is a list of `yas-template'."
       (or chosen
           (keyboard-quit)))))
 
-(defun yas-x-pretty-prompt-templates (prompt templates)
+(defun yas--x-pretty-prompt-templates (prompt templates)
   "Display TEMPLATES, grouping neatly by table name."
   (let ((organized (make-hash-table :test #'equal))
         menu
         more-than-one-table
         prefix)
     (dolist (tl templates)
-      (puthash (yas-template-table tl)
+      (puthash (yas--template-table tl)
                (cons tl
-                     (gethash (yas-template-table tl) organized))
+                     (gethash (yas--template-table tl) organized))
                organized))
     (setq more-than-one-table (> (hash-table-count organized) 1))
     (setq prefix (if more-than-one-table
                      "   " ""))
     (if more-than-one-table
         (maphash #'(lambda (table templates)
-                     (push (yas-table-name table) menu)
+                     (push (yas--table-name table) menu)
                      (dolist (tl templates)
-                       (push (cons (concat prefix (yas-template-name tl)) tl) menu))) organized)
-      (setq menu (mapcar #'(lambda (tl) (cons (concat prefix (yas-template-name tl)) tl)) templates)))
+                       (push (cons (concat prefix (yas--template-name tl)) tl) menu))) organized)
+      (setq menu (mapcar #'(lambda (tl) (cons (concat prefix (yas--template-name tl)) tl)) templates)))
 
     (setq menu (nreverse menu))
     (or (x-popup-menu (if (fboundp 'posn-at-point)
@@ -1644,7 +1645,7 @@ TEMPLATES is a list of `yas-template'."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Loading snippets from files
 ;;
-(defun yas-load-yas-setup-file (file)
+(defun yas--load-yas-setup-file (file)
   (load file 'noerror))
 
 (defun yas-load-directory (top-level-dir &optional use-jit)
@@ -1656,54 +1657,54 @@ Optional USE-JIT use jit-loading of snippets."
   (interactive "DSelect the root directory: ")
   (unless yas-snippet-dirs
     (setq yas-snippet-dirs top-level-dir))
-  (dolist (dir (yas-subdirs top-level-dir))
-    (let* ((major-mode-and-parents (yas-compute-major-mode-and-parents
+  (dolist (dir (yas--subdirs top-level-dir))
+    (let* ((major-mode-and-parents (yas--compute-major-mode-and-parents
                                     (concat dir "/dummy")))
            (mode-sym (car major-mode-and-parents))
            (parents (cdr major-mode-and-parents)))
-      (yas-define-parents mode-sym parents)
-      (let ((form `(yas-load-directory-1 ,dir
+      (yas--define-parents mode-sym parents)
+      (let ((form `(yas--load-directory-1 ,dir
                                          ',mode-sym
                                          ',parents)))
         (if use-jit
-            (yas-schedule-jit mode-sym form)
+            (yas--schedule-jit mode-sym form)
             (eval form)))))
   (when (interactive-p)
-    (yas-message 3 "Loaded snippets from %s." top-level-dir)))
+    (yas--message 3 "Loaded snippets from %s." top-level-dir)))
 
-(defun yas-load-directory-1 (directory mode-sym parents &optional no-compiled-snippets)
+(defun yas--load-directory-1 (directory mode-sym parents &optional no-compiled-snippets)
   "Recursively load snippet templates from DIRECTORY."
   (unless (file-exists-p (concat directory "/" ".yas-skip"))
     (if (and (not no-compiled-snippets)
-             (progn (yas-message 2 "Loading compiled snippets from %s" directory) t)
+             (progn (yas--message 2 "Loading compiled snippets from %s" directory) t)
              (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3)))
-      (yas-message 2 "Loading snippet files from %s" directory)
-      (yas-load-directory-2 directory mode-sym))))
+      (yas--message 2 "Loading snippet files from %s" directory)
+      (yas--load-directory-2 directory mode-sym))))
 
-(defun yas-load-directory-2 (directory mode-sym)
+(defun yas--load-directory-2 (directory mode-sym)
   ;; Load .yas-setup.el files wherever we find them
   ;;
-  (yas-load-yas-setup-file (expand-file-name ".yas-setup" directory))
+  (yas--load-yas-setup-file (expand-file-name ".yas-setup" directory))
   (let* ((default-directory directory)
          (snippet-defs nil))
     ;; load the snippet files
     ;;
     (with-temp-buffer
-      (dolist (file (yas-subdirs directory 'no-subdirs-just-files))
+      (dolist (file (yas--subdirs directory 'no-subdirs-just-files))
         (when (file-readable-p file)
           (insert-file-contents file nil nil nil t)
-          (push (yas-parse-template file)
+          (push (yas--parse-template file)
                 snippet-defs))))
     (when snippet-defs
       (yas-define-snippets mode-sym
                            snippet-defs))
     ;; now recurse to a lower level
     ;;
-    (dolist (subdir (yas-subdirs directory))
-      (yas-load-directory-2 subdir
+    (dolist (subdir (yas--subdirs directory))
+      (yas--load-directory-2 subdir
                             mode-sym))))
 
-(defun yas-load-snippet-dirs (&optional nojit)
+(defun yas--load-snippet-dirs (&optional nojit)
   "Reload the directories listed in `yas-snippet-dirs' or
    prompt the user to select one."
   (let (errors)
@@ -1712,10 +1713,10 @@ Optional USE-JIT use jit-loading of snippets."
           (cond ((file-directory-p directory)
                  (yas-load-directory directory (not nojit))
                  (if nojit
-                     (yas-message 3 "Loaded %s" directory)
-                   (yas-message 3 "Prepared just-in-time loading for %s" directory)))
+                     (yas--message 3 "Loaded %s" directory)
+                   (yas--message 3 "Prepared just-in-time loading for %s" directory)))
                 (t
-                 (push (yas-message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors))))
+                 (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors))))
       (call-interactively 'yas-load-directory))
     errors))
 
@@ -1730,7 +1731,7 @@ loading."
     (let ((errors)
           (snippet-editing-buffers
            (remove-if-not #'(lambda (buffer)
-                              (with-current-buffer buffer yas-editing-template))
+                              (with-current-buffer buffer yas--editing-template))
                           (buffer-list))))
       ;; Warn if there are buffers visiting snippets, since reloading will break
       ;; any on-line editing of those buffers.
@@ -1739,56 +1740,56 @@ loading."
           (if interactive
               (if (y-or-n-p "Some buffers editing live snippets, close them and proceed with reload?")
                   (mapc #'kill-buffer snippet-editing-buffers)
-                (yas-message 1 "Aborted reload...")
+                (yas--message 1 "Aborted reload...")
                 (throw 'abort nil))
             ;; in a non-interactive use, at least set
-            ;; `yas-editing-template' to nil, make it guess it next time around
-            (mapc #'(lambda (buffer) (setq yas-editing-template nil)) (buffer-list))))
+            ;; `yas--editing-template' to nil, make it guess it next time around
+            (mapc #'(lambda (buffer) (setq yas--editing-template nil)) (buffer-list))))
 
       ;; Empty all snippet tables, parenting info and all menu tables
       ;;
-      (setq yas-tables (make-hash-table))
-      (setq yas-parents (make-hash-table))
-      (setq yas-menu-table (make-hash-table))
+      (setq yas--tables (make-hash-table))
+      (setq yas--parents (make-hash-table))
+      (setq yas--menu-table (make-hash-table))
 
-      ;; Cancel all pending 'yas-scheduled-jit-loads'
+      ;; Cancel all pending 'yas--scheduled-jit-loads'
       ;;
-      (setq yas-scheduled-jit-loads (make-hash-table))
+      (setq yas--scheduled-jit-loads (make-hash-table))
 
       ;; Init the `yas-minor-mode-map', taking care not to break the
       ;; menu....
       ;;
       (setf (cdr yas-minor-mode-map)
-            (cdr (yas-init-minor-keymap)))
+            (cdr (yas--init-minor-keymap)))
 
       ;; Reload the directories listed in `yas-snippet-dirs' or prompt
       ;; the user to select one.
       ;;
-      (setq errors (yas-load-snippet-dirs interactive))
+      (setq errors (yas--load-snippet-dirs interactive))
       ;; Reload the direct keybindings
       ;;
       (yas-direct-keymaps-reload)
       ;; Reload the trigger-key (shoudn't be needed, but see issue #237)
       ;;
-      (yas-trigger-key-reload)
+      (yas--trigger-key-reload)
 
-      (yas-message 3 "Reloaded everything%s...%s."
+      (yas--message 3 "Reloaded everything%s...%s."
                    (if interactive "" " (snippets will load just-in-time)")
                    (if errors " (some errors, check *Messages*)" "")))))
 
-(defun yas-load-pending-jits ()
+(defun yas--load-pending-jits ()
   (when yas-minor-mode
-    (dolist (mode (yas-modes-to-activate))
-      (let ((forms (gethash mode yas-scheduled-jit-loads)))
+    (dolist (mode (yas--modes-to-activate))
+      (let ((forms (gethash mode yas--scheduled-jit-loads)))
         (dolist (form forms)
-          (yas-message  3 "Loading for `%s', just-in-time: %s!" mode form)
+          (yas--message  3 "Loading for `%s', just-in-time: %s!" mode form)
           (eval form))
-        (remhash mode yas-scheduled-jit-loads)))))
+        (remhash mode yas--scheduled-jit-loads)))))
 
 ;; (when (<= emacs-major-version 22)
-;;   (add-hook 'after-change-major-mode-hook 'yas-load-pending-jits))
+;;   (add-hook 'after-change-major-mode-hook 'yas--load-pending-jits))
 
-(defun yas-quote-string (string)
+(defun yas--quote-string (string)
   "Escape and quote STRING.
 foo\"bar\\! -> \"foo\\\"bar\\\\!\""
   (concat "\""
@@ -1800,7 +1801,7 @@ foo\"bar\\! -> \"foo\\\"bar\\\\!\""
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Snippet compilation function
 
-(defun yas-initialize ()
+(defun yas--initialize ()
   "For backward compatibility, enable `yas-minor-mode' globally"
   (yas-global-mode 1))
 
@@ -1810,7 +1811,7 @@ foo\"bar\\! -> \"foo\\\"bar\\\\!\""
 This works by stubbing a few functions, then calling
 `yas-load-directory'."
   (interactive "DTop level snippet directory?")
-  (flet ((yas-load-yas-setup-file
+  (flet ((yas--load-yas-setup-file
           (file)
           (let ((elfile (concat file ".el")))
             (when (file-exists-p elfile)
@@ -1845,12 +1846,12 @@ This works by stubbing a few functions, then calling
                       literal-snippets)))
             (insert (pp-to-string `(yas-define-snippets ',mode ',literal-snippets)))
             (insert "\n\n")))
-         (yas-load-directory-1
+         (yas--load-directory-1
           (dir mode parents &rest ignore)
           (let ((output-file (concat (file-name-as-directory dir) ".yas-compiled-snippets.el")))
             (with-temp-file output-file
               (insert (format ";;; Compiled snippets and support files for `%s'\n" mode))
-              (yas-load-directory-2 dir mode)
+              (yas--load-directory-2 dir mode)
               (insert (format ";;; Do not edit! File generated at %s\n" (current-time-string)))))))
     (yas-load-directory top-level-dir nil)))
 
@@ -1863,14 +1864,14 @@ This works by stubbing a few functions, then calling
 ;;; JIT loading
 ;;;
 
-(defvar yas-scheduled-jit-loads (make-hash-table)
+(defvar yas--scheduled-jit-loads (make-hash-table)
   "Alist of mode-symbols to forms to be evaled when `yas-minor-mode' kicks in.")
 
-(defun yas-schedule-jit (mode form)
+(defun yas--schedule-jit (mode form)
   (puthash mode
            (cons form
-                 (gethash mode yas-scheduled-jit-loads))
-           yas-scheduled-jit-loads))
+                 (gethash mode yas--scheduled-jit-loads))
+           yas--scheduled-jit-loads))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1880,15 +1881,15 @@ This works by stubbing a few functions, then calling
 (defun yas-about ()
   (interactive)
   (message (concat "yasnippet (version "
-                   yas-version
+                   yas--version
                    ") -- pluskid <pluskid@gmail.com>/joaotavora <joaotavora@gmail.com>")))
 
-(defun yas-define-parents (mode parents)
+(defun yas--define-parents (mode parents)
   "Add PARENTS to the list of MODE's parents"
   (puthash mode-sym (remove-duplicates
                      (append parents
-                             (gethash mode-sym yas-parents)))
-           yas-parents))
+                             (gethash mode-sym yas--parents)))
+           yas--parents))
 
 (defun yas-define-snippets (mode snippets)
   "Define SNIPPETS for MODE.
@@ -1904,8 +1905,8 @@ TEMPLATE might be a lisp form or a string, depending on whether
 this is a snippet or a snippet-command.
 
 CONDITION, EXPAND-ENV and KEYBINDING are lisp forms, they have
-been `yas-read-lisp'-ed and will eventually be
-`yas-eval-lisp'-ed.
+been `yas--read-lisp'-ed and will eventually be
+`yas--eval-lisp'-ed.
 
 The remaining elements are strings.
 
@@ -1915,9 +1916,9 @@ defining snippets.
 UUID is the snippets \"unique-id\". Loading a second snippet file
 with the same uuid replaced the previous snippet.
 
-You can use `yas-parse-template' to return such lists based on
+You can use `yas--parse-template' to return such lists based on
 the current buffers contents."
-  (let ((snippet-table (yas-table-get-create mode))
+  (let ((snippet-table (yas--table-get-create mode))
         (template nil))
     (dolist (snippet snippets)
       (setq template (yas-define-snippets-1 snippet
@@ -1927,7 +1928,7 @@ the current buffers contents."
 (defun yas-define-snippets-1 (snippet snippet-table)
   "Helper for `yas-define-snippets'."
   ;; X) Calculate some more defaults on the values returned by
-  ;; `yas-parse-template'.
+  ;; `yas--parse-template'.
   ;;
   (let* ((file (seventh snippet))
          (key (car snippet))
@@ -1936,14 +1937,14 @@ the current buffers contents."
                         (file-name-directory file))))
          (condition (fourth snippet))
          (group (fifth snippet))
-         (keybinding (yas-read-keybinding (eighth snippet)))
+         (keybinding (yas--read-keybinding (eighth snippet)))
          (uuid (or (ninth snippet)
                   name))
-         (template (or (gethash uuid (yas-table-uuidhash snippet-table))
-                       (yas-make-blank-template))))
+         (template (or (gethash uuid (yas--table-uuidhash snippet-table))
+                       (yas--make-blank-template))))
     ;; X) populate the template object
     ;;
-    (yas-populate-template template
+    (yas--populate-template template
                            :table       snippet-table
                            :key         key
                            :content     (second snippet)
@@ -1958,39 +1959,39 @@ the current buffers contents."
     ;;    also will take care of adding the key indicators in the
     ;;    templates menu entry, if any
     ;;
-    (yas-update-template snippet-table template)
+    (yas--update-template snippet-table template)
     ;; X) Return the template
     ;;
     ;;
     template))
 
-(defun yas-snippet-menu-binding-pair-get-create (template &optional type)
+(defun yas--snippet-menu-binding-pair-get-create (template &optional type)
   "Get TEMPLATE's menu binding or assign it a new one.
 
 TYPE may be `:stay', signalling this menu binding should be
 static in the menu."
-  (or (yas-template-menu-binding-pair template)
-      (let ((key (yas-template-key template))
-            (keybinding (yas-template-keybinding template)))
-        (setf (yas-template-menu-binding-pair template)
-              (cons `(menu-item ,(or (yas-template-name template)
-                                     (yas-template-uuid template))
-                                ,(yas-make-menu-binding template)
+  (or (yas--template-menu-binding-pair template)
+      (let ((key (yas--template-key template))
+            (keybinding (yas--template-keybinding template)))
+        (setf (yas--template-menu-binding-pair template)
+              (cons `(menu-item ,(or (yas--template-name template)
+                                     (yas--template-uuid template))
+                                ,(yas--make-menu-binding template)
                                 :keys ,nil)
                     type)))))
 
-(defun yas-show-menu-p (mode)
+(defun yas--show-menu-p (mode)
   (cond ((eq yas-use-menu 'abbreviate)
          (find mode
                (mapcar #'(lambda (table)
-                           (intern (yas-table-name table)))
-                       (yas-get-snippet-tables))))
+                           (intern (yas--table-name table)))
+                       (yas--get-snippet-tables))))
         ((eq yas-use-menu 'real-modes)
-         (yas-real-mode? mode))
+         (yas--real-mode? mode))
         (t
          t)))
 
-(defun yas-delete-from-keymap (keymap uuid)
+(defun yas--delete-from-keymap (keymap uuid)
   "Recursively delete items with UUID from KEYMAP and its submenus."
 
   ;; XXX: This used to skip any submenus named \"parent mode\"
@@ -2002,7 +2003,7 @@ static in the menu."
   (mapc #'(lambda (item)
             (when (and (listp (cdr item))
                        (keymapp (third (cdr item))))
-              (yas-delete-from-keymap (third (cdr item)) uuid)))
+              (yas--delete-from-keymap (third (cdr item)) uuid)))
         (rest keymap))
   ;; Set the uuid entry to nil
   ;;
@@ -2033,38 +2034,38 @@ MENU is a list, its elements can be:
 OMIT-ITEMS is a list of snippet uuid's that will always be
 ommited from MODE's menu, even if they're manually loaded.
 "
-  (let* ((table (yas-table-get-create mode))
-         (hash (yas-table-uuidhash table)))
-    (yas-define-menu-1 table
-                       (yas-menu-keymap-get-create table)
+  (let* ((table (yas--table-get-create mode))
+         (hash (yas--table-uuidhash table)))
+    (yas--define-menu-1 table
+                       (yas--menu-keymap-get-create table)
                        menu
                        hash)
     (dolist (uuid omit-items)
       (let ((template (or (gethash uuid hash)
-                          (yas-populate-template (puthash uuid
-                                                          (yas-make-blank-template)
+                          (yas--populate-template (puthash uuid
+                                                          (yas--make-blank-template)
                                                           hash)
                                                  :table table
                                                  :uuid uuid))))
-        (setf (yas-template-menu-binding-pair template) (cons nil :none))))))
+        (setf (yas--template-menu-binding-pair template) (cons nil :none))))))
 
-(defun yas-define-menu-1 (table keymap menu uuidhash &optional group-list)
+(defun yas--define-menu-1 (table keymap menu uuidhash &optional group-list)
   (dolist (e (reverse menu))
     (cond ((eq (first e) 'yas-item)
            (let ((template (or (gethash (second e) uuidhash)
-                               (yas-populate-template (puthash (second e)
-                                                               (yas-make-blank-template)
+                               (yas--populate-template (puthash (second e)
+                                                               (yas--make-blank-template)
                                                                uuidhash)
                                                       :table table
                                                       :perm-group group-list
                                                       :uuid (second e)))))
              (define-key keymap (vector (gensym))
-               (car (yas-snippet-menu-binding-pair-get-create template :stay)))))
+               (car (yas--snippet-menu-binding-pair-get-create template :stay)))))
           ((eq (first e) 'yas-submenu)
            (let ((subkeymap (make-sparse-keymap)))
              (define-key keymap (vector (gensym))
                `(menu-item ,(second e) ,subkeymap))
-             (yas-define-menu-1 table
+             (yas--define-menu-1 table
                                 subkeymap
                                 (third e)
                                 uuidhash
@@ -2073,9 +2074,9 @@ ommited from MODE's menu, even if they're manually loaded.
            (define-key keymap (vector (gensym))
              '(menu-item "----")))
           (t
-           (yas-message 3 "Don't know anything about menu entry %s" (first e))))))
+           (yas--message 3 "Don't know anything about menu entry %s" (first e))))))
 
-(defun yas-define (mode key template &optional name condition group)
+(defun yas--define (mode key template &optional name condition group)
   "Define a snippet.  Expanding KEY into TEMPLATE.
 
 NAME is a description to this template.  Also update the menu if
@@ -2085,7 +2086,7 @@ will only be expanded when the condition evaluated to non-nil."
   (yas-define-snippets mode
                        (list (list key template name condition group))))
 
-(defun yas-hippie-try-expand (first-time?)
+(defun yas--hippie-try-expand (first-time?)
   "Integrate with hippie expand.  Just put this function in
 `hippie-expand-try-functions-list'."
   (when yas-minor-mode
@@ -2101,7 +2102,7 @@ will only be expanded when the condition evaluated to non-nil."
 ;;;
 ;;;
 ;;;
-(defvar yas-condition-cache-timestamp nil)
+(defvar yas--condition-cache-timestamp nil)
 (defmacro yas-define-condition-cache (func doc &rest body)
   "Define a function FUNC with doc DOC and body BODY, BODY is
 executed at most once every snippet expansion attempt, to check
@@ -2116,13 +2117,13 @@ snippet-expansion routine like `yas-expand', computes actual
 value for the first time then always returns a cached value.")
                       (setq body (cons doc body))
                       nil)
-     (let ((timestamp-and-value (get ',func 'yas-condition-cache)))
-       (if (equal (car timestamp-and-value) yas-condition-cache-timestamp)
+     (let ((timestamp-and-value (get ',func 'yas--condition-cache)))
+       (if (equal (car timestamp-and-value) yas--condition-cache-timestamp)
            (cdr timestamp-and-value)
          (let ((new-value (progn
                             ,@body
                             )))
-           (put ',func 'yas-condition-cache (cons yas-condition-cache-timestamp new-value))
+           (put ',func 'yas--condition-cache (cons yas--condition-cache-timestamp new-value))
            new-value)))))
 
 (defalias 'yas-expand 'yas-expand-from-trigger-key)
@@ -2133,59 +2134,59 @@ If no snippet expansion is possible, fall back to the behaviour
 defined in `yas-fallback-behavior'.
 
 Optional argument FIELD is for non-interactive use and is an
-object satisfying `yas-field-p' to restrict the expansion to."
+object satisfying `yas--field-p' to restrict the expansion to."
   (interactive)
-  (setq yas-condition-cache-timestamp (current-time))
+  (setq yas--condition-cache-timestamp (current-time))
   (let (templates-and-pos)
     (unless (and yas-expand-only-for-last-commands
                  (not (member last-command yas-expand-only-for-last-commands)))
       (setq templates-and-pos (if field
                                   (save-restriction
-                                    (narrow-to-region (yas-field-start field)
-                                                      (yas-field-end field))
-                                    (yas-current-key))
-                                (yas-current-key))))
+                                    (narrow-to-region (yas--field-start field)
+                                                      (yas--field-end field))
+                                    (yas--current-key))
+                                (yas--current-key))))
     (if (and templates-and-pos
              (first templates-and-pos))
-        (yas-expand-or-prompt-for-template (first templates-and-pos)
+        (yas--expand-or-prompt-for-template (first templates-and-pos)
                                            (second templates-and-pos)
                                            (third templates-and-pos))
-      (yas-fallback 'trigger-key))))
+      (yas--fallback 'trigger-key))))
 
 (defun yas-expand-from-keymap ()
-  "Directly expand some snippets, searching `yas-direct-keymaps'.
+  "Directly expand some snippets, searching `yas--direct-keymaps'.
 
 If expansion fails, execute the previous binding for this key"
   (interactive)
-  (setq yas-condition-cache-timestamp (current-time))
-  (let* ((yas-prefix current-prefix-arg)
+  (setq yas--condition-cache-timestamp (current-time))
+  (let* ((yas--prefix current-prefix-arg)
          (vec (subseq (this-command-keys-vector) (if current-prefix-arg
                                                      universal-argument-num-events
                                                    0)))
          (templates (mapcan #'(lambda (table)
-                                (yas-fetch table vec))
-                            (yas-get-snippet-tables))))
+                                (yas--fetch table vec))
+                            (yas--get-snippet-tables))))
     (if templates
-        (yas-expand-or-prompt-for-template templates)
+        (yas--expand-or-prompt-for-template templates)
       (let ((yas-fallback-behavior 'call-other-command))
-        (yas-fallback)))))
+        (yas--fallback)))))
 
-(defun yas-expand-or-prompt-for-template (templates &optional start end)
+(defun yas--expand-or-prompt-for-template (templates &optional start end)
   "Expand one of TEMPLATES from START to END.
 
 Prompt the user if TEMPLATES has more than one element, else
 expand immediately. Common gateway for
 `yas-expand-from-trigger-key' and `yas-expand-from-keymap'."
-  (let ((yas-current-template (or (and (rest templates) ;; more than one
-                                       (yas-prompt-for-template (mapcar #'cdr templates)))
+  (let ((yas--current-template (or (and (rest templates) ;; more than one
+                                       (yas--prompt-for-template (mapcar #'cdr templates)))
                                   (cdar templates))))
-    (when yas-current-template
-      (yas-expand-snippet (yas-template-content yas-current-template)
+    (when yas--current-template
+      (yas-expand-snippet (yas--template-content yas--current-template)
                           start
                           end
-                          (yas-template-expand-env yas-current-template)))))
+                          (yas--template-expand-env yas--current-template)))))
 
-(defun yas-fallback (&optional from-trigger-key-p)
+(defun yas--fallback (&optional from-trigger-key-p)
   "Fallback after expansion has failed.
 
 Common gateway for `yas-expand-from-trigger-key' and
@@ -2195,7 +2196,7 @@ Common gateway for `yas-expand-from-trigger-key' and
          nil)
         ((eq yas-fallback-behavior 'call-other-command)
          (let* ((yas-minor-mode nil)
-                (yas-direct-keymaps nil)
+                (yas--direct-keymaps nil)
                 (keys-1 (this-command-keys-vector))
                 (keys-2 (and yas-trigger-key
                              from-trigger-key-p
@@ -2231,49 +2232,49 @@ Common gateway for `yas-expand-from-trigger-key' and
 \f
 ;;; Utils for snippet development:
 
-(defun yas-all-templates (tables)
+(defun yas--all-templates (tables)
   "Return all snippet tables applicable for the current buffer.
 
 Honours `yas-choose-tables-first', `yas-choose-keys-first' and
 `yas-buffer-local-condition'"
   (when yas-choose-tables-first
-    (setq tables (list (yas-prompt-for-table tables))))
+    (setq tables (list (yas--prompt-for-table tables))))
   (mapcar #'cdr
           (if yas-choose-keys-first
-              (let ((key (yas-prompt-for-keys
-                          (mapcan #'yas-table-all-keys tables))))
+              (let ((key (yas--prompt-for-keys
+                          (mapcan #'yas--table-all-keys tables))))
                 (when key
                   (mapcan #'(lambda (table)
-                              (yas-fetch table key))
+                              (yas--fetch table key))
                           tables)))
-            (remove-duplicates (mapcan #'yas-table-templates tables)
+            (remove-duplicates (mapcan #'yas--table-templates tables)
                                :test #'equal))))
 
 (defun yas-insert-snippet (&optional no-condition)
   "Choose a snippet to expand, pop-up a list of choices according
-to `yas-prompt-function'.
+to `yas--prompt-function'.
 
 With prefix argument NO-CONDITION, bypass filtering of snippets
 by condition."
   (interactive "P")
-  (setq yas-condition-cache-timestamp (current-time))
+  (setq yas--condition-cache-timestamp (current-time))
   (let* ((yas-buffer-local-condition (or (and no-condition
                                               'always)
                                          yas-buffer-local-condition))
-         (templates (yas-all-templates (yas-get-snippet-tables)))
-         (yas-current-template (and templates
+         (templates (yas--all-templates (yas--get-snippet-tables)))
+         (yas--current-template (and templates
                                     (or (and (rest templates) ;; more than one template for same key
-                                             (yas-prompt-for-template templates))
+                                             (yas--prompt-for-template templates))
                                         (car templates))))
          (where (if (region-active-p)
                     (cons (region-beginning) (region-end))
                   (cons (point) (point)))))
-    (if yas-current-template
-        (yas-expand-snippet (yas-template-content yas-current-template)
+    (if yas--current-template
+        (yas-expand-snippet (yas--template-content yas--current-template)
                             (car where)
                             (cdr where)
-                            (yas-template-expand-env yas-current-template))
-      (yas-message 3 "No snippets can be inserted here!"))))
+                            (yas--template-expand-env yas--current-template))
+      (yas--message 3 "No snippets can be inserted here!"))))
 
 (defun yas-visit-snippet-file ()
   "Choose a snippet to edit, selection like `yas-insert-snippet'.
@@ -2282,60 +2283,60 @@ Only success if selected snippet was loaded from a file.  Put the
 visited file in `snippet-mode'."
   (interactive)
   (let* ((yas-buffer-local-condition 'always)
-         (templates (yas-all-templates (yas-get-snippet-tables)))
+         (templates (yas--all-templates (yas--get-snippet-tables)))
          (yas-prompt-functions '(yas-ido-prompt yas-completing-prompt))
          (template (and templates
-                        (or (yas-prompt-for-template templates
+                        (or (yas--prompt-for-template templates
                                                      "Choose a snippet template to edit: ")
                             (car templates)))))
 
     (if template
-        (yas-visit-snippet-file-1 template)
+        (yas--visit-snippet-file-1 template)
       (message "No snippets tables active!"))))
 
-(defun yas-visit-snippet-file-1 (template)
-  (let ((file (yas-template-file template)))
+(defun yas--visit-snippet-file-1 (template)
+  (let ((file (yas--template-file template)))
     (cond ((and file (file-readable-p file))
            (find-file-other-window file)
            (snippet-mode)
-           (set (make-local-variable 'yas-editing-template) template))
+           (set (make-local-variable 'yas--editing-template) template))
           (file
            (message "Original file %s no longer exists!" file))
           (t
-           (switch-to-buffer (format "*%s*"(yas-template-name template)))
+           (switch-to-buffer (format "*%s*"(yas--template-name template)))
            (let ((type 'snippet))
-             (when (listp (yas-template-content template))
+             (when (listp (yas--template-content template))
                (insert (format "# type: command\n"))
                (setq type 'command))
-             (insert (format "# key: %s\n" (yas-template-key template)))
-             (insert (format "# name: %s\n" (yas-template-name template)))
-             (when (yas-template-keybinding template)
-               (insert (format "# binding: %s\n" (yas-template-keybinding template))))
-             (when (yas-template-expand-env template)
-               (insert (format "# expand-env: %s\n" (yas-template-expand-env template))))
-             (when (yas-template-condition template)
-               (insert (format "# condition: %s\n" (yas-template-condition template))))
+             (insert (format "# key: %s\n" (yas--template-key template)))
+             (insert (format "# name: %s\n" (yas--template-name template)))
+             (when (yas--template-keybinding template)
+               (insert (format "# binding: %s\n" (yas--template-keybinding template))))
+             (when (yas--template-expand-env template)
+               (insert (format "# expand-env: %s\n" (yas--template-expand-env template))))
+             (when (yas--template-condition template)
+               (insert (format "# condition: %s\n" (yas--template-condition template))))
              (insert "# --\n")
              (insert (if (eq type 'command)
-                         (pp-to-string (yas-template-content template))
-                       (yas-template-content template))))
+                         (pp-to-string (yas--template-content template))
+                       (yas--template-content template))))
            (snippet-mode)
-           (set (make-local-variable 'yas-editing-template) template)))))
+           (set (make-local-variable 'yas--editing-template) template)))))
 
-(defun yas-guess-snippet-directories-1 (table)
+(defun yas--guess-snippet-directories-1 (table)
   "Guesses possible snippet subdirectories for TABLE."
-  (cons (yas-table-name table)
+  (cons (yas--table-name table)
         (mapcan #'(lambda (parent)
-                    (yas-guess-snippet-directories-1
+                    (yas--guess-snippet-directories-1
                      parent))
-                (yas-table-parents table))))
+                (yas--table-parents table))))
 
-(defun yas-guess-snippet-directories (&optional table)
+(defun yas--guess-snippet-directories (&optional table)
   "Try to guess suitable directories based on the current active
 tables (or optional TABLE).
 
 Returns a list of elemts (TABLE . DIRS) where TABLE is a
-`yas-table' object and DIRS is a list of all possible directories
+`yas--table' object and DIRS is a list of all possible directories
 where snippets of table might exist."
   (let ((main-dir (replace-regexp-in-string
                    "/+$" ""
@@ -2343,35 +2344,35 @@ where snippets of table might exist."
                                   (setq yas-snippet-dirs '("~/.emacs.d/snippets")))))))
         (tables (or (and table
                          (list table))
-                    (yas-get-snippet-tables))))
+                    (yas--get-snippet-tables))))
     ;; HACK! the snippet table created here is actually registered!
     ;;
-    (unless (or table (gethash major-mode yas-tables))
-      (push (yas-table-get-create major-mode)
+    (unless (or table (gethash major-mode yas--tables))
+      (push (yas--table-get-create major-mode)
             tables))
 
     (mapcar #'(lambda (table)
                 (cons table
                       (mapcar #'(lambda (subdir)
                                   (concat main-dir "/" subdir))
-                              (yas-guess-snippet-directories-1 table))))
+                              (yas--guess-snippet-directories-1 table))))
             tables)))
 
-(defun yas-make-directory-maybe (table-and-dirs &optional main-table-string)
+(defun yas--make-directory-maybe (table-and-dirs &optional main-table-string)
   "Returns a dir inside  TABLE-AND-DIRS, prompts for creation if none exists."
   (or (some #'(lambda (dir) (when (file-directory-p dir) dir)) (cdr table-and-dirs))
       (let ((candidate (first (cdr table-and-dirs))))
         (unless (file-writable-p (file-name-directory candidate))
-          (error (yas-format "%s is not writable." candidate)))
+          (error (yas--format "%s is not writable." candidate)))
         (if (y-or-n-p (format "Guessed directory (%s) for%s%s table \"%s\" does not exist! Create? "
                               candidate
-                              (if (gethash (intern (yas-table-name (car table-and-dirs)))
-                                           yas-tables)
+                              (if (gethash (intern (yas--table-name (car table-and-dirs)))
+                                           yas--tables)
                                   ""
                                 " brand new")
                               (or main-table-string
                                   "")
-                              (yas-table-name (car table-and-dirs))))
+                              (yas--table-name (car table-and-dirs))))
             (progn
               (make-directory candidate 'also-make-parents)
               ;; create the .yas-parents file here...
@@ -2383,15 +2384,15 @@ where snippets of table might exist."
 Expands a snippet-writing snippet, unless the optional prefix arg
 NO-TEMPLATE is non-nil."
   (interactive "P")
-  (let ((guessed-directories (yas-guess-snippet-directories)))
+  (let ((guessed-directories (yas--guess-snippet-directories)))
 
     (switch-to-buffer "*new snippet*")
     (erase-buffer)
     (kill-all-local-variables)
     (snippet-mode)
     (yas-minor-mode 1)
-    (set (make-local-variable 'yas-guessed-modes) (mapcar #'(lambda (d)
-                                                              (intern (yas-table-name (car d))))
+    (set (make-local-variable 'yas--guessed-modes) (mapcar #'(lambda (d)
+                                                              (intern (yas--table-name (car d))))
                                                           guessed-directories))
     (unless no-template (yas-expand-snippet "\
 # -*- mode: snippet -*-
@@ -2403,7 +2404,7 @@ NO-TEMPLATE is non-nil."
 # --
 $0"))))
 
-(defun yas-compute-major-mode-and-parents (file)
+(defun yas--compute-major-mode-and-parents (file)
   "Given FILE, find the nearest snippet directory for a given
 mode, then return a list (MODE-SYM PARENTS), the mode's symbol and a list
 representing one or more of the mode's parents.
@@ -2432,13 +2433,13 @@ neither do the elements of PARENTS."
     (when major-mode-sym
       (cons major-mode-sym parents))))
 
-(defvar yas-editing-template nil
-  "Supporting variable for `yas-load-snippet-buffer' and `yas-visit-snippet'")
+(defvar yas--editing-template nil
+  "Supporting variable for `yas-load-snippet-buffer' and `yas--visit-snippet'")
 
-(defvar yas-current-template nil
+(defvar yas--current-template nil
   "Holds the current template being expanded into a snippet.")
 
-(defvar yas-guessed-modes nil
+(defvar yas--guessed-modes nil
   "List of guessed modes supporting `yas-load-snippet-buffer'.")
 
 (defun yas-load-snippet-buffer (&optional kill)
@@ -2447,37 +2448,37 @@ neither do the elements of PARENTS."
 With optional prefix argument KILL quit the window and buffer."
   (interactive "P")
   (cond
-   ;;  We have `yas-editing-template', this buffer's
+   ;;  We have `yas--editing-template', this buffer's
    ;;  content comes from a template which is already loaded and
    ;;  neatly positioned,...
    ;;
-   (yas-editing-template
-    (yas-define-snippets-1 (yas-parse-template (yas-template-file yas-editing-template))
-                           (yas-template-table yas-editing-template)))
-   ;; Try to use `yas-guessed-modes'. If we don't have that use the
-   ;; value from `yas-compute-major-mode-and-parents'
+   (yas--editing-template
+    (yas-define-snippets-1 (yas--parse-template (yas--template-file yas--editing-template))
+                           (yas--template-table yas--editing-template)))
+   ;; Try to use `yas--guessed-modes'. If we don't have that use the
+   ;; value from `yas--compute-major-mode-and-parents'
    ;;
    (t
-    (unless yas-guessed-modes
-      (set (make-local-variable 'yas-guessed-modes) (or (yas-compute-major-mode-and-parents buffer-file-name))))
+    (unless yas--guessed-modes
+      (set (make-local-variable 'yas--guessed-modes) (or (yas--compute-major-mode-and-parents buffer-file-name))))
     (let* ((prompt (if (and (featurep 'ido)
                             ido-mode)
                        'ido-completing-read 'completing-read))
-           (table (yas-table-get-create
+           (table (yas--table-get-create
                    (intern
                     (funcall prompt (format "Choose or enter a table (yas guesses %s): "
-                                            (if yas-guessed-modes
-                                                (first yas-guessed-modes)
+                                            (if yas--guessed-modes
+                                                (first yas--guessed-modes)
                                               "nothing"))
-                             (mapcar #'symbol-name yas-guessed-modes)
+                             (mapcar #'symbol-name yas--guessed-modes)
                              nil
                              nil
                              nil
                              nil
-                             (if (first yas-guessed-modes)
-                                 (symbol-name (first yas-guessed-modes))))))))
-      (set (make-local-variable 'yas-editing-template)
-           (yas-define-snippets-1 (yas-parse-template buffer-file-name)
+                             (if (first yas--guessed-modes)
+                                 (symbol-name (first yas--guessed-modes))))))))
+      (set (make-local-variable 'yas--editing-template)
+           (yas-define-snippets-1 (yas--parse-template buffer-file-name)
                                   table)))))
   ;; Now, offer to save this iff:
   ;;
@@ -2485,73 +2486,73 @@ With optional prefix argument KILL quit the window and buffer."
   ;; match this template's file (i.e. this is a library snippet, not
   ;; a user snippet) OR
   ;;
-  ;; 2) yas-editing-template comes from a file that we cannot write to...
+  ;; 2) yas--editing-template comes from a file that we cannot write to...
   ;;
-  (when (or (not (yas-template-file yas-editing-template))
-            (not (file-writable-p (yas-template-file yas-editing-template)))
+  (when (or (not (yas--template-file yas--editing-template))
+            (not (file-writable-p (yas--template-file yas--editing-template)))
             (and (listp yas-snippet-dirs)
                  (second yas-snippet-dirs)
                  (not (string-match (expand-file-name (first yas-snippet-dirs))
-                                    (yas-template-file yas-editing-template)))))
+                                    (yas--template-file yas--editing-template)))))
 
-    (when (y-or-n-p (yas-format "Looks like a library or new snippet. Save to new file? "))
-      (let* ((option (first (yas-guess-snippet-directories (yas-template-table yas-editing-template))))
+    (when (y-or-n-p (yas--format "Looks like a library or new snippet. Save to new file? "))
+      (let* ((option (first (yas--guess-snippet-directories (yas--template-table yas--editing-template))))
              (chosen (and option
-                          (yas-make-directory-maybe option))))
+                          (yas--make-directory-maybe option))))
         (when chosen
-          (let ((default-file-name (or (and (yas-template-file yas-editing-template)
-                                            (file-name-nondirectory (yas-template-file yas-editing-template)))
-                                       (yas-template-name yas-editing-template))))
+          (let ((default-file-name (or (and (yas--template-file yas--editing-template)
+                                            (file-name-nondirectory (yas--template-file yas--editing-template)))
+                                       (yas--template-name yas--editing-template))))
             (write-file (concat chosen "/"
                                 (read-from-minibuffer (format "File name to create in %s? " chosen)
                                                       default-file-name)))
-            (setf (yas-template-file yas-editing-template) buffer-file-name))))))
+            (setf (yas--template-file yas--editing-template) buffer-file-name))))))
   (when kill
     (quit-window kill))
-  (yas-message 3 "Snippet \"%s\" loaded for %s."
-           (yas-template-name yas-editing-template)
-           (yas-table-name (yas-template-table yas-editing-template))))
+  (yas--message 3 "Snippet \"%s\" loaded for %s."
+           (yas--template-name yas--editing-template)
+           (yas--table-name (yas--template-table yas--editing-template))))
 
 
 (defun yas-tryout-snippet (&optional debug)
   "Test current buffers's snippet template in other buffer."
   (interactive "P")
-  (let* ((major-mode-and-parent (yas-compute-major-mode-and-parents buffer-file-name))
-         (parsed (yas-parse-template))
+  (let* ((major-mode-and-parent (yas--compute-major-mode-and-parents buffer-file-name))
+         (parsed (yas--parse-template))
          (test-mode (or (and (car major-mode-and-parent)
                              (fboundp (car major-mode-and-parent))
                              (car major-mode-and-parent))
-                        (first yas-guessed-modes)
-                        (intern (read-from-minibuffer (yas-format "Please input a mode: ")))))
-         (yas-current-template
+                        (first yas--guessed-modes)
+                        (intern (read-from-minibuffer (yas--format "Please input a mode: ")))))
+         (yas--current-template
           (and parsed
                (fboundp test-mode)
-               (yas-populate-template (yas-make-blank-template)
+               (yas--populate-template (yas--make-blank-template)
                                       :table       nil ;; no tables for ephemeral snippets
                                       :key         (first parsed)
                                       :content     (second parsed)
                                       :name        (third parsed)
                                       :expand-env  (sixth parsed)))))
-    (cond (yas-current-template
-           (let ((buffer-name (format "*testing snippet: %s*" (yas-template-name yas-current-template))))
+    (cond (yas--current-template
+           (let ((buffer-name (format "*testing snippet: %s*" (yas--template-name yas--current-template))))
              (kill-buffer (get-buffer-create buffer-name))
              (switch-to-buffer (get-buffer-create buffer-name))
              (setq buffer-undo-list nil)
              (condition-case nil (funcall test-mode) (error nil))
              (setq buffer-read-only nil)
-             (yas-expand-snippet (yas-template-content yas-current-template)
+             (yas-expand-snippet (yas--template-content yas--current-template)
                                  (point-min)
                                  (point-max)
-                                 (yas-template-expand-env yas-current-template))
+                                 (yas--template-expand-env yas--current-template))
              (when (and debug
                         (require 'yasnippet-debug nil t))
                (add-hook 'post-command-hook 'yas-debug-snippet-vars nil t))))
           (t
-           (yas-message 3 "Cannot test snippet for unknown major mode")))))
+           (yas--message 3 "Cannot test snippet for unknown major mode")))))
 
-(defun yas-template-fine-group (template)
-  (car (last (or (yas-template-group template)
-                 (yas-template-perm-group template)))))
+(defun yas--template-fine-group (template)
+  (car (last (or (yas--template-group template)
+                 (yas--template-perm-group template)))))
 
 (defun yas-describe-tables (&optional choose)
   "Display snippets for each table."
@@ -2559,17 +2560,17 @@ With optional prefix argument KILL quit the window and buffer."
   (let* ((by-name-hash (and choose
                             (y-or-n-p "Show by namehash? ")))
          (buffer (get-buffer-create "*YASnippet tables*"))
-         (active-tables (yas-get-snippet-tables))
+         (active-tables (yas--get-snippet-tables))
          (remain-tables (let ((all))
                           (maphash #'(lambda (k v)
                                        (unless (find v active-tables)
                                          (push v all)))
-                                   yas-tables)
+                                   yas--tables)
                           all))
          (table-lists (list active-tables remain-tables))
          (original-buffer (current-buffer))
          (continue t)
-         (yas-condition-cache-timestamp (current-time)))
+         (yas--condition-cache-timestamp (current-time)))
     (with-current-buffer buffer
       (setq buffer-read-only nil)
       (erase-buffer)
@@ -2578,68 +2579,68 @@ With optional prefix argument KILL quit the window and buffer."
              (while (and table-lists
                          continue)
                (dolist (table (car table-lists))
-                 (yas-describe-pretty-table table original-buffer))
+                 (yas--describe-pretty-table table original-buffer))
                (setq table-lists (cdr table-lists))
                (when table-lists
-                 (yas-create-snippet-xrefs)
+                 (yas--create-snippet-xrefs)
                  (display-buffer buffer)
                  (setq continue (and choose (y-or-n-p "Show also non-active tables? ")))))
-             (yas-create-snippet-xrefs)
+             (yas--create-snippet-xrefs)
              (help-mode)
              (goto-char 1))
             (t
              (insert "\n\nYASnippet tables by NAMEHASH: \n")
              (dolist (table (append active-tables remain-tables))
-               (insert (format "\nSnippet table `%s':\n\n" (yas-table-name table)))
+               (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table)))
                (let ((keys))
                  (maphash #'(lambda (k v)
                               (push k keys))
-                          (yas-table-hash table))
+                          (yas--table-hash table))
                  (dolist (key keys)
                    (insert (format "   key %s maps snippets: %s\n" key
                                    (let ((names))
                                      (maphash #'(lambda (k v)
                                                   (push k names))
-                                              (gethash key (yas-table-hash table)))
+                                              (gethash key (yas--table-hash table)))
                                      names))))))))
       (goto-char 1)
       (setq buffer-read-only t))
     (display-buffer buffer)))
 
-(defun yas-describe-pretty-table (table &optional original-buffer)
+(defun yas--describe-pretty-table (table &optional original-buffer)
   (insert (format "\nSnippet table `%s'"
-                  (yas-table-name table)))
-  (if (yas-table-parents table)
+                  (yas--table-name table)))
+  (if (yas--table-parents table)
       (insert (format " parents: %s\n"
-                      (mapcar #'yas-table-name
-                              (yas-table-parents table))))
+                      (mapcar #'yas--table-name
+                              (yas--table-parents table))))
     (insert "\n"))
   (insert (make-string 100 ?-) "\n")
   (insert "group                   state name                                    key             binding\n")
   (let ((groups-hash (make-hash-table :test #'equal)))
     (maphash #'(lambda (k v)
-                 (let ((group (or (yas-template-fine-group v)
+                 (let ((group (or (yas--template-fine-group v)
                                   "(top level)")))
-                   (when (yas-template-name v)
+                   (when (yas--template-name v)
                      (puthash group
                               (cons v (gethash group groups-hash))
                               groups-hash))))
-             (yas-table-uuidhash table))
+             (yas--table-uuidhash table))
     (maphash
      #'(lambda (group templates)
          (setq group (truncate-string-to-width group 25 0 ?  "..."))
          (insert (make-string 100 ?-) "\n")
          (dolist (p templates)
-           (let ((name (truncate-string-to-width (propertize (format "\\\\snippet `%s'" (yas-template-name p))
+           (let ((name (truncate-string-to-width (propertize (format "\\\\snippet `%s'" (yas--template-name p))
                                                              'yasnippet p)
                                                  50 0 ? "..."))
                  (group (prog1 group
                           (setq group (make-string (length group) ? ))))
-                 (condition-string (let ((condition (yas-template-condition p)))
+                 (condition-string (let ((condition (yas--template-condition p)))
                                      (if (and condition
                                               original-buffer)
                                          (with-current-buffer original-buffer
-                                           (if (yas-eval-condition condition)
+                                           (if (yas--eval-condition condition)
                                                "(y)"
                                              "(s)"))
                                        "(a)"))))
@@ -2650,9 +2651,9 @@ With optional prefix argument KILL quit the window and buffer."
                          "'"
                        " ")
                      " ")
-             (insert (truncate-string-to-width (or (yas-template-key p) "")
+             (insert (truncate-string-to-width (or (yas--template-key p) "")
                                                15 0 ?  "...") " ")
-             (insert (truncate-string-to-width (key-description (yas-template-keybinding p))
+             (insert (truncate-string-to-width (key-description (yas--template-keybinding p))
                                                15 0 ?  "...") " ")
              (insert "\n"))))
      groups-hash)))
@@ -2699,25 +2700,25 @@ If found, the content of subexp group SUBEXP (default 0) is
             key)))))
 
 (defun yas-throw (text)
-  "Throw a yas-exception with TEXT as the reason."
-  (throw 'yas-exception (cons 'yas-exception text)))
+  "Throw a yas--exception with TEXT as the reason."
+  (throw 'yas--exception (cons 'yas--exception text)))
 
 (defun yas-verify-value (possibilities)
   "Verify that the current field value is in POSSIBILITIES
 
 Otherwise throw exception."
   (when (and yas-moving-away-p (notany #'(lambda (pos) (string= pos yas-text)) possibilities))
-    (yas-throw (yas-format "Field only allows %s" possibilities))))
+    (yas-throw (yas--format "Field only allows %s" possibilities))))
 
 (defun yas-field-value (number)
   "Get the string for field with NUMBER.
 
 Use this in primary and mirror transformations to tget."
-  (let* ((snippet (car (yas-snippets-at-point)))
+  (let* ((snippet (car (yas--snippets-at-point)))
          (field (and snippet
-                     (yas-snippet-find-field snippet number))))
+                     (yas--snippet-find-field snippet number))))
     (when field
-      (yas-field-text-for-display field))))
+      (yas--field-text-for-display field))))
 
 (defun yas-text ()
   "Return `yas-text' if that exists and is non-empty, else nil."
@@ -2731,7 +2732,7 @@ Use this in primary and mirror transformations to tget."
 ;;            (not (string= "" yas-selected-text)))
 ;;       yas-selected-text))
 
-(defun yas-get-field-once (number &optional transform-fn)
+(defun yas--get-field-once (number &optional transform-fn)
   (unless yas-modified-p
     (if transform-fn
         (funcall transform-fn (yas-field-value number))
@@ -2745,43 +2746,43 @@ Use this in primary and mirror transformations to tget."
   (equal 'font-lock-string-face (get-char-property (1- (point)) 'face)))
 
 (defun yas-unimplemented (&optional missing-feature)
-  (if yas-current-template
+  (if yas--current-template
       (if (y-or-n-p (format "This snippet is unimplemented (missing %s) Visit the snippet definition? "
                             (or missing-feature
                                 "something")))
-          (yas-visit-snippet-file-1 yas-current-template))
+          (yas--visit-snippet-file-1 yas--current-template))
     (message "No implementation. Missing %s" (or missing-feature "something"))))
 
 \f
 ;;; Snippet expansion and field management
 
-(defvar yas-active-field-overlay nil
+(defvar yas--active-field-overlay nil
   "Overlays the currently active field.")
 
-(defvar yas-field-protection-overlays nil
+(defvar yas--field-protection-overlays nil
   "Two overlays protect the current active field ")
 
-(defconst yas-prefix nil
+(defconst yas--prefix nil
   "A prefix argument for expansion direct from keybindings")
 
 (defvar yas-selected-text nil
   "The selected region deleted on the last snippet expansion.")
 
-(defvar yas-start-column nil
+(defvar yas--start-column nil
   "The column where the snippet expansion started.")
 
-(make-variable-buffer-local 'yas-active-field-overlay)
-(make-variable-buffer-local 'yas-field-protection-overlays)
-(put 'yas-active-field-overlay 'permanent-local t)
-(put 'yas-field-protection-overlays 'permanent-local t)
+(make-variable-buffer-local 'yas--active-field-overlay)
+(make-variable-buffer-local 'yas--field-protection-overlays)
+(put 'yas--active-field-overlay 'permanent-local t)
+(put 'yas--field-protection-overlays 'permanent-local t)
 
-(defstruct (yas-snippet (:constructor yas-make-snippet ()))
+(defstruct (yas--snippet (:constructor yas--make-snippet ()))
   "A snippet.
 
 ..."
   (fields '())
   (exit nil)
-  (id (yas-snippet-next-id) :read-only t)
+  (id (yas--snippet-next-id) :read-only t)
   (control-overlay nil)
   active-field
   ;; stacked expansion: the `previous-active-field' slot saves the
@@ -2789,7 +2790,7 @@ Use this in primary and mirror transformations to tget."
   previous-active-field
   force-exit)
 
-(defstruct (yas-field (:constructor yas-make-field (number start end parent-field)))
+(defstruct (yas--field (:constructor yas--make-field (number start end parent-field)))
   "A field."
   number
   start end
@@ -2799,42 +2800,42 @@ Use this in primary and mirror transformations to tget."
   (modified-p nil)
   next)
 
-(defstruct (yas-mirror (:constructor yas-make-mirror (start end transform)))
+(defstruct (yas--mirror (:constructor yas--make-mirror (start end transform)))
   "A mirror."
   start end
   (transform nil)
   parent-field
   next)
 
-(defstruct (yas-exit (:constructor yas-make-exit (marker)))
+(defstruct (yas--exit (:constructor yas--make-exit (marker)))
   marker
   next)
 
-(defun yas-apply-transform (field-or-mirror field &optional empty-on-nil-p)
+(defun yas--apply-transform (field-or-mirror field &optional empty-on-nil-p)
   "Calculate transformed string for FIELD-OR-MIRROR from FIELD.
 
 If there is no transform for ht field, return nil.
 
 If there is a transform but it returns nil, return the empty
 string iff EMPTY-ON-NIL-P is true."
-  (let* ((yas-text (yas-field-text-for-display field))
+  (let* ((yas-text (yas--field-text-for-display field))
          (text yas-text)
-         (yas-modified-p (yas-field-modified-p field))
+         (yas-modified-p (yas--field-modified-p field))
          (yas-moving-away-p nil)
-         (transform (if (yas-mirror-p field-or-mirror)
-                        (yas-mirror-transform field-or-mirror)
-                      (yas-field-transform field-or-mirror)))
-         (start-point (if (yas-mirror-p field-or-mirror)
-                          (yas-mirror-start field-or-mirror)
-                        (yas-field-start field-or-mirror)))
+         (transform (if (yas--mirror-p field-or-mirror)
+                        (yas--mirror-transform field-or-mirror)
+                      (yas--field-transform field-or-mirror)))
+         (start-point (if (yas--mirror-p field-or-mirror)
+                          (yas--mirror-start field-or-mirror)
+                        (yas--field-start field-or-mirror)))
          (transformed (and transform
                            (save-excursion
                              (goto-char start-point)
-                             (let ((ret (yas-eval-lisp transform)))
+                             (let ((ret (yas--eval-lisp transform)))
                                (or ret (and empty-on-nil-p "")))))))
     transformed))
 
-(defsubst yas-replace-all (from to &optional text)
+(defsubst yas--replace-all (from to &optional text)
   "Replace all occurance from FROM to TO.
 
 With optional string TEXT do it in that string."
@@ -2844,23 +2845,23 @@ With optional string TEXT do it in that string."
     (while (search-forward from nil t)
       (replace-match to t t text))))
 
-(defun yas-snippet-find-field (snippet number)
+(defun yas--snippet-find-field (snippet number)
   (find-if #'(lambda (field)
-               (eq number (yas-field-number field)))
-           (yas-snippet-fields snippet)))
+               (eq number (yas--field-number field)))
+           (yas--snippet-fields snippet)))
 
-(defun yas-snippet-sort-fields (snippet)
+(defun yas--snippet-sort-fields (snippet)
   "Sort the fields of SNIPPET in navigation order."
-  (setf (yas-snippet-fields snippet)
-        (sort (yas-snippet-fields snippet)
-              #'yas-snippet-field-compare)))
+  (setf (yas--snippet-fields snippet)
+        (sort (yas--snippet-fields snippet)
+              #'yas--snippet-field-compare)))
 
-(defun yas-snippet-field-compare (field1 field2)
+(defun yas--snippet-field-compare (field1 field2)
   "Compare two fields. The field with a number is sorted first.
 If they both have a number, compare through the number. If neither
 have, compare through the field's start point"
-  (let ((n1 (yas-field-number field1))
-        (n2 (yas-field-number field2)))
+  (let ((n1 (yas--field-number field1))
+        (n2 (yas--field-number field2)))
     (if n1
         (if n2
             (or (zerop n2) (and (not (zerop n1))
@@ -2868,41 +2869,41 @@ have, compare through the field's start point"
           (not (zerop n1)))
       (if n2
           (zerop n2)
-        (< (yas-field-start field1)
-           (yas-field-start field2))))))
+        (< (yas--field-start field1)
+           (yas--field-start field2))))))
 
-(defun yas-field-probably-deleted-p (snippet field)
+(defun yas--field-probably-deleted-p (snippet field)
   "Guess if SNIPPET's FIELD should be skipped."
   (and
    ;; field must be zero lentgh
    ;;
-   (zerop (- (yas-field-start field) (yas-field-end field)))
+   (zerop (- (yas--field-start field) (yas--field-end field)))
    ;; skip if:
    (or
     ;;  1) is a nested field and it's been modified
     ;;
-    (and (yas-field-parent-field field)
-         (yas-field-modified-p field))
+    (and (yas--field-parent-field field)
+         (yas--field-modified-p field))
     ;;  2) ends just before the snippet end
     ;;
-    (and (eq field (car (last (yas-snippet-fields snippet))))
-         (= (yas-field-start field) (overlay-end (yas-snippet-control-overlay snippet)))))
+    (and (eq field (car (last (yas--snippet-fields snippet))))
+         (= (yas--field-start field) (overlay-end (yas--snippet-control-overlay snippet)))))
    ;; the field numbered 0, just before the exit marker, should
    ;; never be skipped
    ;;
-   (not (zerop (yas-field-number field)))))
+   (not (zerop (yas--field-number field)))))
 
-(defun yas-snippets-at-point (&optional all-snippets)
+(defun yas--snippets-at-point (&optional all-snippets)
   "Return a sorted list of snippets at point, most recently
 inserted first."
   (sort
    (remove nil (remove-duplicates (mapcar #'(lambda (ov)
-                                              (overlay-get ov 'yas-snippet))
+                                              (overlay-get ov 'yas--snippet))
                                           (if all-snippets
                                               (overlays-in (point-min) (point-max))
                                             (nconc (overlays-at (point)) (overlays-at (1- (point))))))))
    #'(lambda (s1 s2)
-       (<= (yas-snippet-id s2) (yas-snippet-id s1)))))
+       (<= (yas--snippet-id s2) (yas--snippet-id s1)))))
 
 (defun yas-next-field-or-maybe-expand ()
   "Try to expand a snippet at a key before point, otherwise
@@ -2910,7 +2911,7 @@ delegate to `yas-next-field'."
   (interactive)
   (if yas-triggers-in-field
       (let ((yas-fallback-behavior 'return-nil)
-            (active-field (overlay-get yas-active-field-overlay 'yas-field)))
+            (active-field (overlay-get yas--active-field-overlay 'yas--field)))
         (when active-field
           (unless (yas-expand-from-trigger-key active-field)
             (yas-next-field))))
@@ -2921,60 +2922,60 @@ delegate to `yas-next-field'."
   (interactive)
   (let* ((arg (or arg
                   1))
-         (snippet (first (yas-snippets-at-point)))
-         (active-field (overlay-get yas-active-field-overlay 'yas-field))
+         (snippet (first (yas--snippets-at-point)))
+         (active-field (overlay-get yas--active-field-overlay 'yas--field))
          (live-fields (remove-if #'(lambda (field)
                                      (and (not (eq field active-field))
-                                          (yas-field-probably-deleted-p snippet field)))
-                                 (yas-snippet-fields snippet)))
+                                          (yas--field-probably-deleted-p snippet field)))
+                                 (yas--snippet-fields snippet)))
          (active-field-pos (position active-field live-fields))
          (target-pos (and active-field-pos (+ arg active-field-pos)))
          (target-field (and target-pos (nth target-pos live-fields))))
     ;; First check if we're moving out of a field with a transform
     ;;
     (when (and active-field
-               (yas-field-transform active-field))
+               (yas--field-transform active-field))
       (let* ((yas-moving-away-p t)
-             (yas-text (yas-field-text-for-display active-field))
+             (yas-text (yas--field-text-for-display active-field))
              (text yas-text)
-             (yas-modified-p (yas-field-modified-p active-field)))
+             (yas-modified-p (yas--field-modified-p active-field)))
         ;; primary field transform: exit call to field-transform
-        (yas-eval-lisp (yas-field-transform active-field))))
+        (yas--eval-lisp (yas--field-transform active-field))))
     ;; Now actually move...
     (cond ((and target-pos (>= target-pos (length live-fields)))
            (yas-exit-snippet snippet))
           (target-field
-           (yas-move-to-field snippet target-field))
+           (yas--move-to-field snippet target-field))
           (t
            nil))))
 
-(defun yas-place-overlays (snippet field)
+(defun yas--place-overlays (snippet field)
   "Correctly place overlays for SNIPPET's FIELD"
-  (yas-make-move-field-protection-overlays snippet field)
-  (yas-make-move-active-field-overlay snippet field))
+  (yas--make-move-field-protection-overlays snippet field)
+  (yas--make-move-active-field-overlay snippet field))
 
-(defun yas-move-to-field (snippet field)
+(defun yas--move-to-field (snippet field)
   "Update SNIPPET to move to field FIELD.
 
 Also create some protection overlays"
-  (goto-char (yas-field-start field))
-  (yas-place-overlays snippet field)
-  (overlay-put yas-active-field-overlay 'yas-field field)
-  (let ((number (yas-field-number field)))
+  (goto-char (yas--field-start field))
+  (yas--place-overlays snippet field)
+  (overlay-put yas--active-field-overlay 'yas--field field)
+  (let ((number (yas--field-number field)))
     ;; check for the special ${0: ...} field
     (if (and number (zerop number))
         (progn
-          (set-mark (yas-field-end field))
-          (setf (yas-snippet-force-exit snippet)
-                (or (yas-field-transform field)
+          (set-mark (yas--field-end field))
+          (setf (yas--snippet-force-exit snippet)
+                (or (yas--field-transform field)
                     t)))
       ;; make this field active
-      (setf (yas-snippet-active-field snippet) field)
+      (setf (yas--snippet-active-field snippet) field)
       ;; primary field transform: first call to snippet transform
-      (unless (yas-field-modified-p field)
-        (if (yas-field-update-display field snippet)
-            (yas-update-mirrors snippet)
-          (setf (yas-field-modified-p field) nil))))))
+      (unless (yas--field-modified-p field)
+        (if (yas--field-update-display field snippet)
+            (yas--update-mirrors snippet)
+          (setf (yas--field-modified-p field) nil))))))
 
 (defun yas-prev-field ()
   "Navigate to prev field.  If there's none, exit the snippet."
@@ -2984,44 +2985,44 @@ Also create some protection overlays"
 (defun yas-abort-snippet (&optional snippet)
   (interactive)
   (let ((snippet (or snippet
-                     (car (yas-snippets-at-point)))))
+                     (car (yas--snippets-at-point)))))
     (when snippet
-      (setf (yas-snippet-force-exit snippet) t))))
+      (setf (yas--snippet-force-exit snippet) t))))
 
 (defun yas-exit-snippet (snippet)
   "Goto exit-marker of SNIPPET."
-  (interactive (list (first (yas-snippets-at-point))))
+  (interactive (list (first (yas--snippets-at-point))))
   (when snippet
-    (setf (yas-snippet-force-exit snippet) t)
-    (goto-char (if (yas-snippet-exit snippet)
-                   (yas-exit-marker (yas-snippet-exit snippet))
-                 (overlay-end (yas-snippet-control-overlay snippet))))))
+    (setf (yas--snippet-force-exit snippet) t)
+    (goto-char (if (yas--snippet-exit snippet)
+                   (yas--exit-marker (yas--snippet-exit snippet))
+                 (overlay-end (yas--snippet-control-overlay snippet))))))
 
 (defun yas-exit-all-snippets ()
   "Exit all snippets."
   (interactive)
   (mapc #'(lambda (snippet)
             (yas-exit-snippet snippet)
-            (yas-check-commit-snippet))
-        (yas-snippets-at-point 'all-snippets)))
+            (yas--check-commit-snippet))
+        (yas--snippets-at-point 'all-snippets)))
 
 \f
 ;;; Some low level snippet-routines:
 
-(defmacro yas-inhibit-overlay-hooks (&rest body)
-  "Run BODY with `yas-inhibit-overlay-hooks' set to t."
+(defmacro yas--inhibit-overlay-hooks (&rest body)
+  "Run BODY with `yas--inhibit-overlay-hooks' set to t."
   (declare (indent 0))
-  `(let ((yas-inhibit-overlay-hooks t))
+  `(let ((yas--inhibit-overlay-hooks t))
      (progn ,@body)))
 
 (defvar yas-snippet-beg nil "Beginning position of the last snippet commited.")
 (defvar yas-snippet-end nil "End position of the last snippet commited.")
 
-(defun yas-commit-snippet (snippet)
+(defun yas--commit-snippet (snippet)
   "Commit SNIPPET, but leave point as it is.  This renders the
 snippet as ordinary text."
 
-  (let ((control-overlay (yas-snippet-control-overlay snippet)))
+  (let ((control-overlay (yas--snippet-control-overlay snippet)))
     ;;
     ;; Save the end of the moribund snippet in case we need to revive it
     ;; its original expansion.
@@ -3032,73 +3033,73 @@ snippet as ordinary text."
       (setq yas-snippet-end (overlay-end control-overlay))
       (delete-overlay control-overlay))
 
-    (yas-inhibit-overlay-hooks
-      (when yas-active-field-overlay
-        (delete-overlay yas-active-field-overlay))
-      (when yas-field-protection-overlays
-        (mapc #'delete-overlay yas-field-protection-overlays)))
+    (yas--inhibit-overlay-hooks
+      (when yas--active-field-overlay
+        (delete-overlay yas--active-field-overlay))
+      (when yas--field-protection-overlays
+        (mapc #'delete-overlay yas--field-protection-overlays)))
 
     ;; stacked expansion: if the original expansion took place from a
     ;; field, make sure we advance it here at least to
     ;; `yas-snippet-end'...
     ;;
-    (let ((previous-field (yas-snippet-previous-active-field snippet)))
+    (let ((previous-field (yas--snippet-previous-active-field snippet)))
       (when (and yas-snippet-end previous-field)
-        (yas-advance-end-maybe previous-field yas-snippet-end)))
+        (yas--advance-end-maybe previous-field yas-snippet-end)))
 
     ;; Convert all markers to points,
     ;;
-    (yas-markers-to-points snippet)
+    (yas--markers-to-points snippet)
 
     ;; Take care of snippet revival
     ;;
     (if yas-snippet-revival
-        (push `(apply yas-snippet-revive ,yas-snippet-beg ,yas-snippet-end ,snippet)
+        (push `(apply yas--snippet-revive ,yas-snippet-beg ,yas-snippet-end ,snippet)
               buffer-undo-list)
       ;; Dismember the snippet... this is useful if we get called
-      ;; again from `yas-take-care-of-redo'....
-      (setf (yas-snippet-fields snippet) nil)))
+      ;; again from `yas--take-care-of-redo'....
+      (setf (yas--snippet-fields snippet) nil)))
 
-  (yas-message 3 "Snippet %s exited." (yas-snippet-id snippet)))
+  (yas--message 3 "Snippet %s exited." (yas--snippet-id snippet)))
 
-(defun yas-safely-run-hooks (hook-var)
+(defun yas--safely-run-hooks (hook-var)
   (condition-case error
       (run-hooks hook-var)
     (error
-     (yas-message 3 "%s error: %s" hook-var (error-message-string error)))))
+     (yas--message 3 "%s error: %s" hook-var (error-message-string error)))))
 
 
-(defun yas-check-commit-snippet ()
+(defun yas--check-commit-snippet ()
   "Checks if point exited the currently active field of the
 snippet, if so cleans up the whole snippet up."
-  (let* ((snippets (yas-snippets-at-point 'all-snippets))
+  (let* ((snippets (yas--snippets-at-point 'all-snippets))
          (snippets-left snippets)
          (snippet-exit-transform))
     (dolist (snippet snippets)
-      (let ((active-field (yas-snippet-active-field snippet)))
-        (setq snippet-exit-transform (yas-snippet-force-exit snippet))
+      (let ((active-field (yas--snippet-active-field snippet)))
+        (setq snippet-exit-transform (yas--snippet-force-exit snippet))
         (cond ((or snippet-exit-transform
-                   (not (and active-field (yas-field-contains-point-p active-field))))
+                   (not (and active-field (yas--field-contains-point-p active-field))))
                (setq snippets-left (delete snippet snippets-left))
-               (setf (yas-snippet-force-exit snippet) nil)
-               (yas-commit-snippet snippet))
+               (setf (yas--snippet-force-exit snippet) nil)
+               (yas--commit-snippet snippet))
               ((and active-field
-                    (or (not yas-active-field-overlay)
-                        (not (overlay-buffer yas-active-field-overlay))))
+                    (or (not yas--active-field-overlay)
+                        (not (overlay-buffer yas--active-field-overlay))))
                ;;
                ;; stacked expansion: this case is mainly for recent
                ;; snippet exits that place us back int the field of
                ;; another snippet
                ;;
                (save-excursion
-                 (yas-move-to-field snippet active-field)
-                 (yas-update-mirrors snippet)))
+                 (yas--move-to-field snippet active-field)
+                 (yas--update-mirrors snippet)))
               (t
                nil))))
     (unless (or (null snippets) snippets-left)
       (if snippet-exit-transform
-          (yas-eval-lisp-no-saves snippet-exit-transform))
-      (yas-safely-run-hooks 'yas-after-exit-snippet-hook))))
+          (yas--eval-lisp-no-saves snippet-exit-transform))
+      (yas--safely-run-hooks 'yas-after-exit-snippet-hook))))
 
 ;; Apropos markers-to-points:
 ;;
@@ -3112,65 +3113,65 @@ snippet, if so cleans up the whole snippet up."
 ;; This shouldn't bring horrible problems with undo/redo, but it
 ;; you never know
 ;;
-(defun yas-markers-to-points (snippet)
+(defun yas--markers-to-points (snippet)
   "Convert all markers in SNIPPET to a cons (POINT . MARKER)
 where POINT is the original position of the marker and MARKER is
 the original marker object with the position set to nil."
-  (dolist (field (yas-snippet-fields snippet))
-    (let ((start (marker-position (yas-field-start field)))
-          (end (marker-position (yas-field-end field))))
-      (set-marker (yas-field-start field) nil)
-      (set-marker (yas-field-end field) nil)
-      (setf (yas-field-start field) (cons start (yas-field-start field)))
-      (setf (yas-field-end field) (cons end (yas-field-end field))))
-    (dolist (mirror (yas-field-mirrors field))
-      (let ((start (marker-position (yas-mirror-start mirror)))
-            (end (marker-position (yas-mirror-end mirror))))
-        (set-marker (yas-mirror-start mirror) nil)
-        (set-marker (yas-mirror-end mirror) nil)
-        (setf (yas-mirror-start mirror) (cons start (yas-mirror-start mirror)))
-        (setf (yas-mirror-end mirror) (cons end (yas-mirror-end mirror))))))
-  (let ((snippet-exit (yas-snippet-exit snippet)))
+  (dolist (field (yas--snippet-fields snippet))
+    (let ((start (marker-position (yas--field-start field)))
+          (end (marker-position (yas--field-end field))))
+      (set-marker (yas--field-start field) nil)
+      (set-marker (yas--field-end field) nil)
+      (setf (yas--field-start field) (cons start (yas--field-start field)))
+      (setf (yas--field-end field) (cons end (yas--field-end field))))
+    (dolist (mirror (yas--field-mirrors field))
+      (let ((start (marker-position (yas--mirror-start mirror)))
+            (end (marker-position (yas--mirror-end mirror))))
+        (set-marker (yas--mirror-start mirror) nil)
+        (set-marker (yas--mirror-end mirror) nil)
+        (setf (yas--mirror-start mirror) (cons start (yas--mirror-start mirror)))
+        (setf (yas--mirror-end mirror) (cons end (yas--mirror-end mirror))))))
+  (let ((snippet-exit (yas--snippet-exit snippet)))
     (when snippet-exit
-      (let ((exit (marker-position (yas-exit-marker snippet-exit))))
-        (set-marker (yas-exit-marker snippet-exit) nil)
-        (setf (yas-exit-marker snippet-exit) (cons exit (yas-exit-marker snippet-exit)))))))
+      (let ((exit (marker-position (yas--exit-marker snippet-exit))))
+        (set-marker (yas--exit-marker snippet-exit) nil)
+        (setf (yas--exit-marker snippet-exit) (cons exit (yas--exit-marker snippet-exit)))))))
 
-(defun yas-points-to-markers (snippet)
+(defun yas--points-to-markers (snippet)
   "Convert all cons (POINT . MARKER) in SNIPPET to markers. This
 is done by setting MARKER to POINT with `set-marker'."
-  (dolist (field (yas-snippet-fields snippet))
-    (setf (yas-field-start field) (set-marker (cdr (yas-field-start field))
-                                              (car (yas-field-start field))))
-    (setf (yas-field-end field) (set-marker (cdr (yas-field-end field))
-                                            (car (yas-field-end field))))
-    (dolist (mirror (yas-field-mirrors field))
-      (setf (yas-mirror-start mirror) (set-marker (cdr (yas-mirror-start mirror))
-                                                  (car (yas-mirror-start mirror))))
-      (setf (yas-mirror-end mirror) (set-marker (cdr (yas-mirror-end mirror))
-                                                (car (yas-mirror-end mirror))))))
-  (let ((snippet-exit (yas-snippet-exit snippet)))
+  (dolist (field (yas--snippet-fields snippet))
+    (setf (yas--field-start field) (set-marker (cdr (yas--field-start field))
+                                              (car (yas--field-start field))))
+    (setf (yas--field-end field) (set-marker (cdr (yas--field-end field))
+                                            (car (yas--field-end field))))
+    (dolist (mirror (yas--field-mirrors field))
+      (setf (yas--mirror-start mirror) (set-marker (cdr (yas--mirror-start mirror))
+                                                  (car (yas--mirror-start mirror))))
+      (setf (yas--mirror-end mirror) (set-marker (cdr (yas--mirror-end mirror))
+                                                (car (yas--mirror-end mirror))))))
+  (let ((snippet-exit (yas--snippet-exit snippet)))
     (when snippet-exit
-      (setf (yas-exit-marker snippet-exit) (set-marker (cdr (yas-exit-marker snippet-exit))
-                                                       (car (yas-exit-marker snippet-exit)))))))
+      (setf (yas--exit-marker snippet-exit) (set-marker (cdr (yas--exit-marker snippet-exit))
+                                                       (car (yas--exit-marker snippet-exit)))))))
 
-(defun yas-field-contains-point-p (field &optional point)
+(defun yas--field-contains-point-p (field &optional point)
   (let ((point (or point
                    (point))))
-    (and (>= point (yas-field-start field))
-         (<= point (yas-field-end field)))))
+    (and (>= point (yas--field-start field))
+         (<= point (yas--field-end field)))))
 
-(defun yas-field-text-for-display (field)
+(defun yas--field-text-for-display (field)
   "Return the propertized display text for field FIELD.  "
-  (buffer-substring (yas-field-start field) (yas-field-end field)))
+  (buffer-substring (yas--field-start field) (yas--field-end field)))
 
-(defun yas-undo-in-progress ()
+(defun yas--undo-in-progress ()
   "True if some kind of undo is in progress"
   (or undo-in-progress
       (eq this-command 'undo)
       (eq this-command 'redo)))
 
-(defun yas-make-control-overlay (snippet start end)
+(defun yas--make-control-overlay (snippet start end)
   "Creates the control overlay that surrounds the snippet and
 holds the keymap."
   (let ((overlay (make-overlay start
@@ -3180,7 +3181,7 @@ holds the keymap."
                                t)))
     (overlay-put overlay 'keymap yas-keymap)
     (overlay-put overlay 'priority 100)
-    (overlay-put overlay 'yas-snippet snippet)
+    (overlay-put overlay 'yas--snippet snippet)
     overlay))
 
 (defun yas-skip-and-clear-or-delete-char (&optional field)
@@ -3189,97 +3190,97 @@ holds the keymap."
 Otherwise deletes a character normally by calling `delete-char'."
   (interactive)
   (let ((field (or field
-                   (and yas-active-field-overlay
-                        (overlay-buffer yas-active-field-overlay)
-                        (overlay-get yas-active-field-overlay 'yas-field)))))
+                   (and yas--active-field-overlay
+                        (overlay-buffer yas--active-field-overlay)
+                        (overlay-get yas--active-field-overlay 'yas--field)))))
     (cond ((and field
-                (not (yas-field-modified-p field))
-                (eq (point) (marker-position (yas-field-start field))))
-           (yas-skip-and-clear field)
+                (not (yas--field-modified-p field))
+                (eq (point) (marker-position (yas--field-start field))))
+           (yas--skip-and-clear field)
            (yas-next-field 1))
           (t
            (call-interactively 'delete-char)))))
 
-(defun yas-skip-and-clear (field)
+(defun yas--skip-and-clear (field)
   "Deletes the region of FIELD and sets it modified state to t"
   ;; Just before skipping-and-clearing the field, mark its children
   ;; fields as modified, too. If the childen have mirrors-in-fields
   ;; this prevents them from updating erroneously (we're skipping and
   ;; deleting!).
   ;;
-  (yas-mark-this-and-children-modified field)
-  (delete-region (yas-field-start field) (yas-field-end field)))
+  (yas--mark-this-and-children-modified field)
+  (delete-region (yas--field-start field) (yas--field-end field)))
 
-(defun yas-mark-this-and-children-modified (field)
-  (setf (yas-field-modified-p field) t)
-  (let ((fom (yas-field-next field)))
+(defun yas--mark-this-and-children-modified (field)
+  (setf (yas--field-modified-p field) t)
+  (let ((fom (yas--field-next field)))
     (while (and fom
-                (yas-fom-parent-field fom))
-      (when (and (eq (yas-fom-parent-field fom) field)
-                 (yas-field-p fom))
-        (yas-mark-this-and-children-modified fom))
-      (setq fom (yas-fom-next fom)))))
+                (yas--fom-parent-field fom))
+      (when (and (eq (yas--fom-parent-field fom) field)
+                 (yas--field-p fom))
+        (yas--mark-this-and-children-modified fom))
+      (setq fom (yas--fom-next fom)))))
 
-(defun yas-make-move-active-field-overlay (snippet field)
+(defun yas--make-move-active-field-overlay (snippet field)
   "Place the active field overlay in SNIPPET's FIELD.
 
 Move the overlay, or create it if it does not exit."
-  (if (and yas-active-field-overlay
-           (overlay-buffer yas-active-field-overlay))
-      (move-overlay yas-active-field-overlay
-                    (yas-field-start field)
-                    (yas-field-end field))
-    (setq yas-active-field-overlay
-          (make-overlay (yas-field-start field)
-                        (yas-field-end field)
+  (if (and yas--active-field-overlay
+           (overlay-buffer yas--active-field-overlay))
+      (move-overlay yas--active-field-overlay
+                    (yas--field-start field)
+                    (yas--field-end field))
+    (setq yas--active-field-overlay
+          (make-overlay (yas--field-start field)
+                        (yas--field-end field)
                         nil nil t))
-    (overlay-put yas-active-field-overlay 'priority 100)
-    (overlay-put yas-active-field-overlay 'face 'yas-field-highlight-face)
-    (overlay-put yas-active-field-overlay 'yas-snippet snippet)
-    (overlay-put yas-active-field-overlay 'modification-hooks '(yas-on-field-overlay-modification))
-    (overlay-put yas-active-field-overlay 'insert-in-front-hooks
-                 '(yas-on-field-overlay-modification))
-    (overlay-put yas-active-field-overlay 'insert-behind-hooks
-                 '(yas-on-field-overlay-modification))))
-
-(defvar yas-inhibit-overlay-hooks nil
-  "Bind this temporarity to non-nil to prevent running `yas-on-*-modification'.")
-
-(defun yas-on-field-overlay-modification (overlay after? beg end &optional length)
+    (overlay-put yas--active-field-overlay 'priority 100)
+    (overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face)
+    (overlay-put yas--active-field-overlay 'yas--snippet snippet)
+    (overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification))
+    (overlay-put yas--active-field-overlay 'insert-in-front-hooks
+                 '(yas--on-field-overlay-modification))
+    (overlay-put yas--active-field-overlay 'insert-behind-hooks
+                 '(yas--on-field-overlay-modification))))
+
+(defvar yas--inhibit-overlay-hooks nil
+  "Bind this temporarity to non-nil to prevent running `yas--on-*-modification'.")
+
+(defun yas--on-field-overlay-modification (overlay after? beg end &optional length)
   "Clears the field and updates mirrors, conditionally.
 
 Only clears the field if it hasn't been modified and it point it
 at field start. This hook doesn't do anything if an undo is in
 progress."
-  (unless (or yas-inhibit-overlay-hooks
-              (yas-undo-in-progress))
-    (let* ((field (overlay-get overlay 'yas-field))
-           (number (and field (yas-field-number field)))
-           (snippet (overlay-get yas-active-field-overlay 'yas-snippet)))
+  (unless (or yas--inhibit-overlay-hooks
+              (yas--undo-in-progress))
+    (let* ((field (overlay-get overlay 'yas--field))
+           (number (and field (yas--field-number field)))
+           (snippet (overlay-get yas--active-field-overlay 'yas--snippet)))
       (cond (after?
-             (yas-advance-end-maybe field (overlay-end overlay))
+             (yas--advance-end-maybe field (overlay-end overlay))
              (save-excursion
-               (yas-field-update-display field snippet))
-             (yas-update-mirrors snippet))
+               (yas--field-update-display field snippet))
+             (yas--update-mirrors snippet))
             (field
              (when (and (not after?)
-                        (not (yas-field-modified-p field))
-                        (eq (point) (if (markerp (yas-field-start field))
-                                        (marker-position (yas-field-start field))
-                                      (yas-field-start field))))
-               (yas-skip-and-clear field))
-             (setf (yas-field-modified-p field) t))))))
+                        (not (yas--field-modified-p field))
+                        (eq (point) (if (markerp (yas--field-start field))
+                                        (marker-position (yas--field-start field))
+                                      (yas--field-start field))))
+               (yas--skip-and-clear field))
+             (setf (yas--field-modified-p field) t))))))
 \f
 ;;; Apropos protection overlays:
 ;;
 ;; These exist for nasty users who will try to delete parts of the
 ;; snippet outside the active field. Actual protection happens in
-;; `yas-on-protection-overlay-modification'.
+;; `yas--on-protection-overlay-modification'.
 ;;
 ;; Currently this signals an error which inhibits the command. For
 ;; commands that move point (like `kill-line'), point is restored in
-;; the `yas-post-command-handler' using a global
-;; `yas-protection-violation' variable.
+;; the `yas--post-command-handler' using a global
+;; `yas--protection-violation' variable.
 ;;
 ;; Alternatively, I've experimented with an implementation that
 ;; commits the snippet before actually calling `this-command'
@@ -3287,12 +3288,12 @@ progress."
 ;; blocks all other million modification hooks. This presented some
 ;; problems with stacked expansion.
 ;;
-(defun yas-make-move-field-protection-overlays (snippet field)
+(defun yas--make-move-field-protection-overlays (snippet field)
   "Place protection overlays surrounding SNIPPET's FIELD.
 
 Move the overlays, or create them if they do not exit."
-  (let ((start (yas-field-start field))
-        (end (yas-field-end field)))
+  (let ((start (yas--field-start field))
+        (end (yas--field-end field)))
     ;; First check if the (1+ end) is contained in the buffer,
     ;; otherwise we'll have to do a bit of cheating and silently
     ;; insert a newline. the `(1+ (buffer-size))' should prevent this
@@ -3300,41 +3301,41 @@ Move the overlays, or create them if they do not exit."
     ;;
     (when (< (buffer-size) end)
       (save-excursion
-        (yas-inhibit-overlay-hooks
+        (yas--inhibit-overlay-hooks
           (goto-char (point-max))
           (newline))))
     ;; go on to normal overlay creation/moving
     ;;
-    (cond ((and yas-field-protection-overlays
-                (every #'overlay-buffer yas-field-protection-overlays))
-           (move-overlay (first yas-field-protection-overlays) (1- start) start)
-           (move-overlay (second yas-field-protection-overlays) end (1+ end)))
+    (cond ((and yas--field-protection-overlays
+                (every #'overlay-buffer yas--field-protection-overlays))
+           (move-overlay (first yas--field-protection-overlays) (1- start) start)
+           (move-overlay (second yas--field-protection-overlays) end (1+ end)))
           (t
-           (setq yas-field-protection-overlays
+           (setq yas--field-protection-overlays
                  (list (make-overlay (1- start) start nil t nil)
                        (make-overlay end (1+ end) nil t nil)))
-           (dolist (ov yas-field-protection-overlays)
-             (overlay-put ov 'face 'yas-field-debug-face)
-             (overlay-put ov 'yas-snippet snippet)
+           (dolist (ov yas--field-protection-overlays)
+             (overlay-put ov 'face 'yas--field-debug-face)
+             (overlay-put ov 'yas--snippet snippet)
              ;; (overlay-put ov 'evaporate t)
-             (overlay-put ov 'modification-hooks '(yas-on-protection-overlay-modification)))))))
+             (overlay-put ov 'modification-hooks '(yas--on-protection-overlay-modification)))))))
 
-(defvar yas-protection-violation nil
+(defvar yas--protection-violation nil
   "When non-nil, signals attempts to erronesly exit or modify the snippet.
 
 Functions in the `post-command-hook', for example
-`yas-post-command-handler' can check it and reset its value to
+`yas--post-command-handler' can check it and reset its value to
 nil. The variables value is the point where the violation
 originated")
 
-(defun yas-on-protection-overlay-modification (overlay after? beg end &optional length)
+(defun yas--on-protection-overlay-modification (overlay after? beg end &optional length)
   "Signals a snippet violation, then issues error.
 
 The error should be ignored in `debug-ignored-errors'"
-  (unless yas-inhibit-overlay-hooks
+  (unless yas--inhibit-overlay-hooks
     (cond ((not (or after?
-                    (yas-undo-in-progress)))
-           (setq yas-protection-violation (point))
+                    (yas--undo-in-progress)))
+           (setq yas--protection-violation (point))
            (error "Exit the snippet first!")))))
 
 (add-to-list 'debug-ignored-errors "^Exit the snippet first!$")
@@ -3346,20 +3347,20 @@ The error should be ignored in `debug-ignored-errors'"
 ;; inside a snippet expansion.
 ;;
 ;; The parent snippet does not run its fields modification hooks
-;; (`yas-on-field-overlay-modification' and
-;; `yas-on-protection-overlay-modification') while the child snippet
+;; (`yas--on-field-overlay-modification' and
+;; `yas--on-protection-overlay-modification') while the child snippet
 ;; is active. This means, among other things, that the mirrors of the
 ;; parent snippet are not updated, this only happening when one exits
 ;; the child snippet.
 ;;
 ;; Unfortunately, this also puts some ugly (and not fully-tested)
 ;; bits of code in `yas-expand-snippet' and
-;; `yas-commit-snippet'. I've tried to mark them with "stacked
+;; `yas--commit-snippet'. I've tried to mark them with "stacked
 ;; expansion:".
 ;;
 ;; This was thought to be safer in in an undo/redo perpective, but
 ;; maybe the correct implementation is to make the globals
-;; `yas-active-field-overlay' and `yas-field-protection-overlays' be
+;; `yas--active-field-overlay' and `yas--field-protection-overlays' be
 ;; snippet-local and be active even while the child snippet is
 ;; running. This would mean a lot of overlay modification hooks
 ;; running, but if managed correctly (including overlay priorities)
@@ -3389,7 +3390,7 @@ considered when expanding the snippet."
         (start (or start (point)))
         (end (or end (point)))
         snippet)
-    (setq yas-indent-original-column (current-column))
+    (setq yas--indent-original-column (current-column))
     ;; Delete the region to delete, this *does* get undo-recorded.
     ;;
     (when (and to-delete
@@ -3399,7 +3400,7 @@ considered when expanding the snippet."
     (cond ((listp content)
            ;; x) This is a snippet-command
            ;;
-           (yas-eval-lisp-no-saves content))
+           (yas--eval-lisp-no-saves content))
           (t
            ;; x) This is a snippet-snippet :-)
            ;;
@@ -3417,68 +3418,68 @@ considered when expanding the snippet."
                ;; might generate errors, so we have to be ready to catch
                ;; them mostly to make the undo information
                ;;
-               (setq yas-start-column (save-restriction (widen) (current-column)))
-               (yas-inhibit-overlay-hooks
+               (setq yas--start-column (save-restriction (widen) (current-column)))
+               (yas--inhibit-overlay-hooks
                  (setq snippet
                        (if expand-env
                            (eval `(let* ,expand-env
                                     (insert content)
-                                    (yas-snippet-create (point-min) (point-max))))
+                                    (yas--snippet-create (point-min) (point-max))))
                          (insert content)
-                         (yas-snippet-create (point-min) (point-max)))))))
+                         (yas--snippet-create (point-min) (point-max)))))))
 
            ;; stacked-expansion: This checks for stacked expansion, save the
-           ;; `yas-previous-active-field' and advance its boudary.
+           ;; `yas--previous-active-field' and advance its boudary.
            ;;
-           (let ((existing-field (and yas-active-field-overlay
-                                      (overlay-buffer yas-active-field-overlay)
-                                      (overlay-get yas-active-field-overlay 'yas-field))))
+           (let ((existing-field (and yas--active-field-overlay
+                                      (overlay-buffer yas--active-field-overlay)
+                                      (overlay-get yas--active-field-overlay 'yas--field))))
              (when existing-field
-               (setf (yas-snippet-previous-active-field snippet) existing-field)
-               (yas-advance-end-maybe existing-field (overlay-end yas-active-field-overlay))))
+               (setf (yas--snippet-previous-active-field snippet) existing-field)
+               (yas--advance-end-maybe existing-field (overlay-end yas--active-field-overlay))))
 
            ;; Exit the snippet immediately if no fields
            ;;
-           (unless (yas-snippet-fields snippet)
+           (unless (yas--snippet-fields snippet)
              (yas-exit-snippet snippet))
 
            ;; Push two undo actions: the deletion of the inserted contents of
            ;; the new snippet (without the "key") followed by an apply of
-           ;; `yas-take-care-of-redo' on the newly inserted snippet boundaries
+           ;; `yas--take-care-of-redo' on the newly inserted snippet boundaries
            ;;
            ;; A small exception, if `yas-also-auto-indent-first-line'
-           ;; is t and `yas-indent' decides to indent the line to a
+           ;; is t and `yas--indent' decides to indent the line to a
            ;; point before the actual expansion point, undo would be
            ;; messed up. We call the early point "newstart"".  case,
            ;; and attempt to fix undo.
            ;;
-           (let ((newstart (overlay-start (yas-snippet-control-overlay snippet)))
-                 (end (overlay-end (yas-snippet-control-overlay snippet))))
+           (let ((newstart (overlay-start (yas--snippet-control-overlay snippet)))
+                 (end (overlay-end (yas--snippet-control-overlay snippet))))
              (when (< newstart start)
                (push (cons (make-string (- start newstart) ? ) newstart) buffer-undo-list))
              (push (cons newstart end) buffer-undo-list)
-             (push `(apply yas-take-care-of-redo ,start ,end ,snippet)
+             (push `(apply yas--take-care-of-redo ,start ,end ,snippet)
                    buffer-undo-list))
            ;; Now, schedule a move to the first field
            ;;
-           (let ((first-field (car (yas-snippet-fields snippet))))
+           (let ((first-field (car (yas--snippet-fields snippet))))
              (when first-field
                (sit-for 0) ;; fix issue 125
-               (yas-move-to-field snippet first-field)))
-           (yas-message 3 "snippet expanded.")
+               (yas--move-to-field snippet first-field)))
+           (yas--message 3 "snippet expanded.")
            t))))
 
-(defun yas-take-care-of-redo (beg end snippet)
+(defun yas--take-care-of-redo (beg end snippet)
   "Commits SNIPPET, which in turn pushes an undo action for
 reviving it.
 
 Meant to exit in the `buffer-undo-list'."
   ;; slightly optimize: this action is only needed for snippets with
   ;; at least one field
-  (when (yas-snippet-fields snippet)
-    (yas-commit-snippet snippet)))
+  (when (yas--snippet-fields snippet)
+    (yas--commit-snippet snippet)))
 
-(defun yas-snippet-revive (beg end snippet)
+(defun yas--snippet-revive (beg end snippet)
   "Revives the SNIPPET and creates a control overlay from BEG to
 END.
 
@@ -3486,39 +3487,39 @@ BEG and END are, we hope, the original snippets boudaries. All
 the markers/points exiting existing inside SNIPPET should point
 to their correct locations *at the time the snippet is revived*.
 
-After revival, push the `yas-take-care-of-redo' in the
+After revival, push the `yas--take-care-of-redo' in the
 `buffer-undo-list'"
   ;; Reconvert all the points to markers
   ;;
-  (yas-points-to-markers snippet)
+  (yas--points-to-markers snippet)
   ;; When at least one editable field existed in the zombie snippet,
   ;; try to revive the whole thing...
   ;;
-  (let ((target-field (or (yas-snippet-active-field snippet)
-                          (car (yas-snippet-fields snippet)))))
+  (let ((target-field (or (yas--snippet-active-field snippet)
+                          (car (yas--snippet-fields snippet)))))
     (when target-field
-      (setf (yas-snippet-control-overlay snippet) (yas-make-control-overlay snippet beg end))
-      (overlay-put (yas-snippet-control-overlay snippet) 'yas-snippet snippet)
+      (setf (yas--snippet-control-overlay snippet) (yas--make-control-overlay snippet beg end))
+      (overlay-put (yas--snippet-control-overlay snippet) 'yas--snippet snippet)
 
-      (yas-move-to-field snippet target-field)
+      (yas--move-to-field snippet target-field)
 
-      (push `(apply yas-take-care-of-redo ,beg ,end ,snippet)
+      (push `(apply yas--take-care-of-redo ,beg ,end ,snippet)
             buffer-undo-list))))
 
-(defun yas-snippet-create (begin end)
+(defun yas--snippet-create (begin end)
   "Creates a snippet from an template inserted between BEGIN and END.
 
 Returns the newly created snippet."
-  (let ((snippet (yas-make-snippet)))
+  (let ((snippet (yas--make-snippet)))
     (goto-char begin)
-    (yas-snippet-parse-create snippet)
+    (yas--snippet-parse-create snippet)
 
     ;; Sort and link each field
-    (yas-snippet-sort-fields snippet)
+    (yas--snippet-sort-fields snippet)
 
     ;; Create keymap overlay for snippet
-    (setf (yas-snippet-control-overlay snippet)
-          (yas-make-control-overlay snippet (point-min) (point-max)))
+    (setf (yas--snippet-control-overlay snippet)
+          (yas--make-control-overlay snippet (point-min) (point-max)))
 
     ;; Move to end
     (goto-char (point-max))
@@ -3535,8 +3536,8 @@ Returns the newly created snippet."
 ;; fields-or-mirrors-or-exit (which I have abbreviated to "fom")
 ;; according to their original positions in the buffer.
 ;;
-;; Then we have operation `yas-advance-end-maybe' and
-;; `yas-advance-start-maybe', which conditionally push the starts and
+;; Then we have operation `yas--advance-end-maybe' and
+;; `yas--advance-start-maybe', which conditionally push the starts and
 ;; ends of these foms down the chain.
 ;;
 ;; This allows for like the printf with the magic ",":
@@ -3544,71 +3545,71 @@ Returns the newly created snippet."
 ;;   printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")}  \
 ;;   $2${1:$(if (string-match "%" text) "\);" "")}$0
 ;;
-(defun yas-fom-start (fom)
-  (cond ((yas-field-p fom)
-         (yas-field-start fom))
-        ((yas-mirror-p fom)
-         (yas-mirror-start fom))
+(defun yas--fom-start (fom)
+  (cond ((yas--field-p fom)
+         (yas--field-start fom))
+        ((yas--mirror-p fom)
+         (yas--mirror-start fom))
         (t
-         (yas-exit-marker fom))))
+         (yas--exit-marker fom))))
 
-(defun yas-fom-end (fom)
-  (cond ((yas-field-p fom)
-         (yas-field-end fom))
-        ((yas-mirror-p fom)
-         (yas-mirror-end fom))
+(defun yas--fom-end (fom)
+  (cond ((yas--field-p fom)
+         (yas--field-end fom))
+        ((yas--mirror-p fom)
+         (yas--mirror-end fom))
         (t
-         (yas-exit-marker fom))))
+         (yas--exit-marker fom))))
 
-(defun yas-fom-next (fom)
-  (cond ((yas-field-p fom)
-         (yas-field-next fom))
-        ((yas-mirror-p fom)
-         (yas-mirror-next fom))
+(defun yas--fom-next (fom)
+  (cond ((yas--field-p fom)
+         (yas--field-next fom))
+        ((yas--mirror-p fom)
+         (yas--mirror-next fom))
         (t
-         (yas-exit-next fom))))
+         (yas--exit-next fom))))
 
-(defun yas-fom-parent-field (fom)
-  (cond ((yas-field-p fom)
-         (yas-field-parent-field fom))
-        ((yas-mirror-p fom)
-         (yas-mirror-parent-field fom))
+(defun yas--fom-parent-field (fom)
+  (cond ((yas--field-p fom)
+         (yas--field-parent-field fom))
+        ((yas--mirror-p fom)
+         (yas--mirror-parent-field fom))
         (t
          nil)))
 
-(defun yas-calculate-adjacencies (snippet)
+(defun yas--calculate-adjacencies (snippet)
   "Calculate adjacencies for fields or mirrors of SNIPPET.
 
 This is according to their relative positions in the buffer, and
 has to be called before the $-constructs are deleted."
-  (flet ((yas-fom-set-next-fom (fom nextfom)
-                               (cond ((yas-field-p fom)
-                                      (setf (yas-field-next fom) nextfom))
-                                     ((yas-mirror-p fom)
-                                      (setf (yas-mirror-next fom) nextfom))
+  (flet ((yas--fom-set-next-fom (fom nextfom)
+                               (cond ((yas--field-p fom)
+                                      (setf (yas--field-next fom) nextfom))
+                                     ((yas--mirror-p fom)
+                                      (setf (yas--mirror-next fom) nextfom))
                                      (t
-                                      (setf (yas-exit-next fom) nextfom))))
-         (yas-compare-fom-begs (fom1 fom2)
-                               (if (= (yas-fom-start fom2) (yas-fom-start fom1))
-                                   (yas-mirror-p fom2)
-                                 (>= (yas-fom-start fom2) (yas-fom-start fom1))))
-         (yas-link-foms (fom1 fom2)
-                        (yas-fom-set-next-fom fom1 fom2)))
-    ;; make some yas-field, yas-mirror and yas-exit soup
+                                      (setf (yas--exit-next fom) nextfom))))
+         (yas--compare-fom-begs (fom1 fom2)
+                               (if (= (yas--fom-start fom2) (yas--fom-start fom1))
+                                   (yas--mirror-p fom2)
+                                 (>= (yas--fom-start fom2) (yas--fom-start fom1))))
+         (yas--link-foms (fom1 fom2)
+                        (yas--fom-set-next-fom fom1 fom2)))
+    ;; make some yas--field, yas--mirror and yas--exit soup
     (let ((soup))
-      (when (yas-snippet-exit snippet)
-        (push (yas-snippet-exit snippet) soup))
-      (dolist (field (yas-snippet-fields snippet))
+      (when (yas--snippet-exit snippet)
+        (push (yas--snippet-exit snippet) soup))
+      (dolist (field (yas--snippet-fields snippet))
         (push field soup)
-        (dolist (mirror (yas-field-mirrors field))
+        (dolist (mirror (yas--field-mirrors field))
           (push mirror soup)))
       (setq soup
             (sort soup
-                  #'yas-compare-fom-begs))
+                  #'yas--compare-fom-begs))
       (when soup
-        (reduce #'yas-link-foms soup)))))
+        (reduce #'yas--link-foms soup)))))
 
-(defun yas-calculate-mirrors-in-fields (snippet mirror)
+(defun yas--calculate-mirrors-in-fields (snippet mirror)
   "Attempt to assign a parent field of SNIPPET to the mirror MIRROR.
 
 Use the tighest containing field if more than one field contains
@@ -3616,111 +3617,111 @@ the mirror. Intended to be called *before* the dollar-regions are
 deleted."
   (let ((min (point-min))
         (max (point-max)))
-    (dolist (field (yas-snippet-fields snippet))
-      (when (and (<= (yas-field-start field) (yas-mirror-start mirror))
-                 (<= (yas-mirror-end mirror) (yas-field-end field))
-               (< min (yas-field-start field))
-               (< (yas-field-end field) max))
-          (setq min (yas-field-start field)
-                max (yas-field-end field))
-          (setf (yas-mirror-parent-field mirror) field)))))
-
-(defun yas-advance-end-maybe (fom newend)
+    (dolist (field (yas--snippet-fields snippet))
+      (when (and (<= (yas--field-start field) (yas--mirror-start mirror))
+                 (<= (yas--mirror-end mirror) (yas--field-end field))
+               (< min (yas--field-start field))
+               (< (yas--field-end field) max))
+          (setq min (yas--field-start field)
+                max (yas--field-end field))
+          (setf (yas--mirror-parent-field mirror) field)))))
+
+(defun yas--advance-end-maybe (fom newend)
   "Maybe advance FOM's end to NEWEND if it needs it.
 
 If it does, also:
 
-* call `yas-advance-start-maybe' on FOM's next fom.
+* call `yas--advance-start-maybe' on FOM's next fom.
 
-* in case FOM is field call `yas-advance-end-maybe' on its parent
+* in case FOM is field call `yas--advance-end-maybe' on its parent
   field
 
 Also, if FOM is an exit-marker, always call
-`yas-advance-start-maybe' on its next fom. This is beacuse
+`yas--advance-start-maybe' on its next fom. This is beacuse
 exit-marker have identical start and end markers.
 
 "
-  (cond ((and fom (< (yas-fom-end fom) newend))
-         (set-marker (yas-fom-end fom) newend)
-         (yas-advance-start-maybe (yas-fom-next fom) newend)
-         (yas-advance-end-of-parents-maybe (yas-fom-parent-field fom) newend))
-        ((yas-exit-p fom)
-         (yas-advance-start-maybe (yas-fom-next fom) newend))))
-
-(defun yas-advance-start-maybe (fom newstart)
+  (cond ((and fom (< (yas--fom-end fom) newend))
+         (set-marker (yas--fom-end fom) newend)
+         (yas--advance-start-maybe (yas--fom-next fom) newend)
+         (yas--advance-end-of-parents-maybe (yas--fom-parent-field fom) newend))
+        ((yas--exit-p fom)
+         (yas--advance-start-maybe (yas--fom-next fom) newend))))
+
+(defun yas--advance-start-maybe (fom newstart)
   "Maybe advance FOM's start to NEWSTART if it needs it.
 
-If it does, also call `yas-advance-end-maybe' on FOM."
-  (when (and fom (< (yas-fom-start fom) newstart))
-    (set-marker (yas-fom-start fom) newstart)
-    (yas-advance-end-maybe fom newstart)))
+If it does, also call `yas--advance-end-maybe' on FOM."
+  (when (and fom (< (yas--fom-start fom) newstart))
+    (set-marker (yas--fom-start fom) newstart)
+    (yas--advance-end-maybe fom newstart)))
 
-(defun yas-advance-end-of-parents-maybe (field newend)
-  "Like `yas-advance-end-maybe' but for parent fields.
+(defun yas--advance-end-of-parents-maybe (field newend)
+  "Like `yas--advance-end-maybe' but for parent fields.
 
 Only works for fields and doesn't care about the start of the
 next FOM. Works its way up recursively for parents of parents."
   (when (and field
-             (< (yas-field-end field) newend))
-    (set-marker (yas-field-end field) newend)
-    (yas-advance-end-of-parents-maybe (yas-field-parent-field field) newend)))
+             (< (yas--field-end field) newend))
+    (set-marker (yas--field-end field) newend)
+    (yas--advance-end-of-parents-maybe (yas--field-parent-field field) newend)))
 
-(defvar yas-dollar-regions nil
+(defvar yas--dollar-regions nil
   "When expanding the snippet the \"parse-create\" functions add
   cons cells to this var")
 
-(defun yas-snippet-parse-create (snippet)
+(defun yas--snippet-parse-create (snippet)
   "Parse a recently inserted snippet template, creating all
 necessary fields, mirrors and exit points.
 
 Meant to be called in a narrowed buffer, does various passes"
   (let ((parse-start (point)))
-    ;; Reset the yas-dollar-regions
+    ;; Reset the yas--dollar-regions
     ;;
-    (setq yas-dollar-regions nil)
+    (setq yas--dollar-regions nil)
     ;; protect escaped quote, backquotes and backslashes
     ;;
-    (yas-protect-escapes nil `(?\\ ?` ?'))
+    (yas--protect-escapes nil `(?\\ ?` ?'))
     ;; replace all backquoted expressions
     ;;
     (goto-char parse-start)
-    (yas-replace-backquotes)
+    (yas--replace-backquotes)
     ;; protect escapes again since previous steps might have generated
     ;; more characters needing escaping
     ;;
     (goto-char parse-start)
-    (yas-protect-escapes)
+    (yas--protect-escapes)
     ;; parse fields with {}
     ;;
     (goto-char parse-start)
-    (yas-field-parse-create snippet)
+    (yas--field-parse-create snippet)
     ;; parse simple mirrors and fields
     ;;
     (goto-char parse-start)
-    (yas-simple-mirror-parse-create snippet)
+    (yas--simple-mirror-parse-create snippet)
     ;; parse mirror transforms
     ;;
     (goto-char parse-start)
-    (yas-transform-mirror-parse-create snippet)
+    (yas--transform-mirror-parse-create snippet)
     ;; calculate adjacencies of fields and mirrors
     ;;
-    (yas-calculate-adjacencies snippet)
+    (yas--calculate-adjacencies snippet)
     ;; Delete $-constructs
     ;;
-    (yas-delete-regions yas-dollar-regions)
+    (yas--delete-regions yas--dollar-regions)
     ;; restore escapes
     ;;
     (goto-char parse-start)
-    (yas-restore-escapes)
+    (yas--restore-escapes)
     ;; update mirrors for the first time
     ;;
-    (yas-update-mirrors snippet)
+    (yas--update-mirrors snippet)
     ;; indent the best we can
     ;;
     (goto-char parse-start)
-    (yas-indent snippet)))
+    (yas--indent snippet)))
 
-(defun yas-indent-according-to-mode (snippet-markers)
+(defun yas--indent-according-to-mode (snippet-markers)
   "Indent current line according to mode, preserving
 SNIPPET-MARKERS."
   ;;; Apropos indenting problems....
@@ -3736,12 +3737,12 @@ SNIPPET-MARKERS."
   ;;
   ;; This is why I have these `trouble-markers', they are the ones at
   ;; they are the ones at the first non-whitespace char at the line
-  ;; (i.e. at `yas-real-line-beginning'. After indentation takes place
+  ;; (i.e. at `yas--real-line-beginning'. After indentation takes place
   ;; we should be at the correct to restore them to. All other
   ;; non-trouble-markers have been *pushed* and don't need special
   ;; attention.
   ;;
-  (goto-char (yas-real-line-beginning))
+  (goto-char (yas--real-line-beginning))
   (let ((trouble-markers (remove-if-not #'(lambda (marker)
                                             (= marker (point)))
                                         snippet-markers)))
@@ -3749,27 +3750,27 @@ SNIPPET-MARKERS."
       (widen)
       (condition-case err
           (indent-according-to-mode)
-        (error (yas-message 3 "Warning: `yas-indent-according-to-mode' having problems running %s" indent-line-function)
+        (error (yas--message 3 "Warning: `yas--indent-according-to-mode' having problems running %s" indent-line-function)
                nil)))
     (mapc #'(lambda (marker)
               (set-marker marker (point)))
           trouble-markers)))
 
-(defvar yas-indent-original-column nil)
-(defun yas-indent (snippet)
-  (let ((snippet-markers (yas-collect-snippet-markers snippet)))
+(defvar yas--indent-original-column nil)
+(defun yas--indent (snippet)
+  (let ((snippet-markers (yas--collect-snippet-markers snippet)))
     ;; Look for those $>
     (save-excursion
       (while (re-search-forward "$>" nil t)
         (delete-region (match-beginning 0) (match-end 0))
         (when (not (eq yas-indent-line 'auto))
-          (yas-indent-according-to-mode snippet-markers))))
+          (yas--indent-according-to-mode snippet-markers))))
     ;; Now do stuff for 'fixed and 'auto
     (save-excursion
       (cond ((eq yas-indent-line 'fixed)
              (while (and (zerop (forward-line))
                          (zerop (current-column)))
-               (indent-to-column yas-indent-original-column)))
+               (indent-to-column yas--indent-original-column)))
             ((eq yas-indent-line 'auto)
              (let ((end (set-marker (make-marker) (point-max)))
                    (indent-first-line-p yas-also-auto-indent-first-line))
@@ -3780,26 +3781,26 @@ SNIPPET-MARKERS."
                                     (forward-line 1)))
                            (not (eobp))
                            (<= (point) end))
-                 (yas-indent-according-to-mode snippet-markers))))
+                 (yas--indent-according-to-mode snippet-markers))))
             (t
              nil)))))
 
-(defun yas-collect-snippet-markers (snippet)
+(defun yas--collect-snippet-markers (snippet)
   "Make a list of all the markers used by SNIPPET."
   (let (markers)
-    (dolist (field (yas-snippet-fields snippet))
-      (push (yas-field-start field) markers)
-      (push (yas-field-end field) markers)
-      (dolist (mirror (yas-field-mirrors field))
-        (push (yas-mirror-start mirror) markers)
-        (push (yas-mirror-end mirror) markers)))
-    (let ((snippet-exit (yas-snippet-exit snippet)))
+    (dolist (field (yas--snippet-fields snippet))
+      (push (yas--field-start field) markers)
+      (push (yas--field-end field) markers)
+      (dolist (mirror (yas--field-mirrors field))
+        (push (yas--mirror-start mirror) markers)
+        (push (yas--mirror-end mirror) markers)))
+    (let ((snippet-exit (yas--snippet-exit snippet)))
       (when (and snippet-exit
-                 (marker-buffer (yas-exit-marker snippet-exit)))
-        (push (yas-exit-marker snippet-exit) markers)))
+                 (marker-buffer (yas--exit-marker snippet-exit)))
+        (push (yas--exit-marker snippet-exit) markers)))
     markers))
 
-(defun yas-real-line-beginning ()
+(defun yas--real-line-beginning ()
   (let ((c (char-after (line-beginning-position)))
         (n (line-beginning-position)))
     (while (or (eql c ?\ )
@@ -3808,10 +3809,10 @@ SNIPPET-MARKERS."
       (setq c (char-after n)))
     n))
 
-(defun yas-escape-string (escaped)
+(defun yas--escape-string (escaped)
   (concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD"))
 
-(defun yas-protect-escapes (&optional text escaped)
+(defun yas--protect-escapes (&optional text escaped)
   "Protect all escaped characters with their numeric ASCII value.
 
 With optional string TEXT do it in string instead of buffer."
@@ -3819,13 +3820,13 @@ With optional string TEXT do it in string instead of buffer."
         (text-provided-p text))
     (mapc #'(lambda (escaped)
               (setq changed-text
-                    (yas-replace-all (concat "\\" (char-to-string escaped))
-                                     (yas-escape-string escaped)
+                    (yas--replace-all (concat "\\" (char-to-string escaped))
+                                     (yas--escape-string escaped)
                                      (when text-provided-p changed-text))))
-          (or escaped yas-escaped-characters))
+          (or escaped yas--escaped-characters))
     changed-text))
 
-(defun yas-restore-escapes (&optional text escaped)
+(defun yas--restore-escapes (&optional text escaped)
   "Restore all escaped characters from their numeric ASCII value.
 
 With optional string TEXT do it in string instead of the buffer."
@@ -3833,36 +3834,36 @@ With optional string TEXT do it in string instead of the buffer."
         (text-provided-p text))
     (mapc #'(lambda (escaped)
               (setq changed-text
-                    (yas-replace-all (yas-escape-string escaped)
+                    (yas--replace-all (yas--escape-string escaped)
                                      (char-to-string escaped)
                                      (when text-provided-p changed-text))))
-          (or escaped yas-escaped-characters))
+          (or escaped yas--escaped-characters))
     changed-text))
 
-(defun yas-replace-backquotes ()
+(defun yas--replace-backquotes ()
   "Replace all the \"`(lisp-expression)`\"-style expression
        with their evaluated value"
-  (while (re-search-forward yas-backquote-lisp-expression-regexp nil t)
+  (while (re-search-forward yas--backquote-lisp-expression-regexp nil t)
     (let ((current-string (match-string 1)) transformed)
       (delete-region (match-beginning 0) (match-end 0))
-      (setq transformed (yas-eval-lisp (yas-read-lisp (yas-restore-escapes current-string))))
+      (setq transformed (yas--eval-lisp (yas--read-lisp (yas--restore-escapes current-string))))
       (goto-char (match-beginning 0))
       (when transformed (insert transformed)))))
 
-(defun yas-scan-sexps (from count)
+(defun yas--scan-sexps (from count)
   (condition-case err
       (with-syntax-table (standard-syntax-table)
         (scan-sexps from count))
     (error
      nil)))
 
-(defun yas-make-marker (pos)
+(defun yas--make-marker (pos)
   "Create a marker at POS with `nil' `marker-insertion-type'"
   (let ((marker (set-marker (make-marker) pos)))
     (set-marker-insertion-type marker nil)
     marker))
 
-(defun yas-field-parse-create (snippet &optional parent-field)
+(defun yas--field-parse-create (snippet &optional parent-field)
   "Parse most field expressions, except for the simple one \"$n\".
 
 The following count as a field:
@@ -3870,15 +3871,15 @@ The following count as a field:
 * \"${n: text}\", for a numbered field with default text, as long as N is not 0;
 
 * \"${n: text$(expression)}, the same with a lisp expression;
-  this is caught with the curiously named `yas-multi-dollar-lisp-expression-regexp'
+  this is caught with the curiously named `yas--multi-dollar-lisp-expression-regexp'
 
 * the same as above but unnumbered, (no N:) and number is calculated automatically.
 
 When multiple expressions are found, only the last one counts."
   ;;
   (save-excursion
-    (while (re-search-forward yas-field-regexp nil t)
-      (let* ((real-match-end-0 (yas-scan-sexps (1+ (match-beginning 0)) 1))
+    (while (re-search-forward yas--field-regexp nil t)
+      (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1))
              (number (and (match-string-no-properties 1)
                           (string-to-number (match-string-no-properties 1))))
              (brand-new-field (and real-match-end-0
@@ -3891,33 +3892,33 @@ When multiple expressions are found, only the last one counts."
                                                             (match-string-no-properties 2)) 0)))
                                    ;; allow ${0: some exit text}
                                    ;; (not (and number (zerop number)))
-                                   (yas-make-field number
-                                                   (yas-make-marker (match-beginning 2))
-                                                   (yas-make-marker (1- real-match-end-0))
+                                   (yas--make-field number
+                                                   (yas--make-marker (match-beginning 2))
+                                                   (yas--make-marker (1- real-match-end-0))
                                                    parent-field))))
         (when brand-new-field
           (goto-char real-match-end-0)
           (push (cons (1- real-match-end-0) real-match-end-0)
-                yas-dollar-regions)
+                yas--dollar-regions)
           (push (cons (match-beginning 0) (match-beginning 2))
-                yas-dollar-regions)
-          (push brand-new-field (yas-snippet-fields snippet))
+                yas--dollar-regions)
+          (push brand-new-field (yas--snippet-fields snippet))
           (save-excursion
             (save-restriction
-              (narrow-to-region (yas-field-start brand-new-field) (yas-field-end brand-new-field))
+              (narrow-to-region (yas--field-start brand-new-field) (yas--field-end brand-new-field))
               (goto-char (point-min))
-              (yas-field-parse-create snippet brand-new-field)))))))
+              (yas--field-parse-create snippet brand-new-field)))))))
   ;; if we entered from a parent field, now search for the
-  ;; `yas-multi-dollar-lisp-expression-regexp'. THis is used for
+  ;; `yas--multi-dollar-lisp-expression-regexp'. THis is used for
   ;; primary field transformations
   ;;
   (when parent-field
     (save-excursion
-      (while (re-search-forward yas-multi-dollar-lisp-expression-regexp nil t)
-        (let* ((real-match-end-1 (yas-scan-sexps (match-beginning 1) 1)))
+      (while (re-search-forward yas--multi-dollar-lisp-expression-regexp nil t)
+        (let* ((real-match-end-1 (yas--scan-sexps (match-beginning 1) 1)))
           ;; commit the primary field transformation if:
           ;;
-          ;; 1. we don't find it in yas-dollar-regions (a subnested
+          ;; 1. we don't find it in yas--dollar-regions (a subnested
           ;; field) might have already caught it.
           ;;
           ;; 2. we really make sure we have either two '$' or some
@@ -3927,47 +3928,47 @@ When multiple expressions are found, only the last one counts."
           (when (and real-match-end-1
                      (not (member (cons (match-beginning 0)
                                         real-match-end-1)
-                                  yas-dollar-regions))
+                                  yas--dollar-regions))
                      (not (eq ?:
                               (char-before (1- (match-beginning 1))))))
             (let ((lisp-expression-string (buffer-substring-no-properties (match-beginning 1)
                                                                           real-match-end-1)))
-              (setf (yas-field-transform parent-field)
-                    (yas-read-lisp (yas-restore-escapes lisp-expression-string))))
+              (setf (yas--field-transform parent-field)
+                    (yas--read-lisp (yas--restore-escapes lisp-expression-string))))
             (push (cons (match-beginning 0) real-match-end-1)
-                  yas-dollar-regions)))))))
+                  yas--dollar-regions)))))))
 
-(defun yas-transform-mirror-parse-create (snippet)
+(defun yas--transform-mirror-parse-create (snippet)
   "Parse the \"${n:$(lisp-expression)}\" mirror transformations."
-  (while (re-search-forward yas-transform-mirror-regexp nil t)
-    (let* ((real-match-end-0 (yas-scan-sexps (1+ (match-beginning 0)) 1))
+  (while (re-search-forward yas--transform-mirror-regexp nil t)
+    (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1))
            (number (string-to-number (match-string-no-properties 1)))
            (field (and number
                        (not (zerop number))
-                       (yas-snippet-find-field snippet number)))
+                       (yas--snippet-find-field snippet number)))
            (brand-new-mirror
             (and real-match-end-0
                  field
-                 (yas-make-mirror (yas-make-marker (match-beginning 0))
-                                  (yas-make-marker (match-beginning 0))
-                                  (yas-read-lisp
-                                   (yas-restore-escapes
+                 (yas--make-mirror (yas--make-marker (match-beginning 0))
+                                  (yas--make-marker (match-beginning 0))
+                                  (yas--read-lisp
+                                   (yas--restore-escapes
                                     (buffer-substring-no-properties (match-beginning 2)
                                                                     (1- real-match-end-0))))))))
       (when brand-new-mirror
         (push brand-new-mirror
-              (yas-field-mirrors field))
-        (yas-calculate-mirrors-in-fields snippet brand-new-mirror)
-        (push (cons (match-beginning 0) real-match-end-0) yas-dollar-regions)))))
+              (yas--field-mirrors field))
+        (yas--calculate-mirrors-in-fields snippet brand-new-mirror)
+        (push (cons (match-beginning 0) real-match-end-0) yas--dollar-regions)))))
 
-(defun yas-simple-mirror-parse-create (snippet)
+(defun yas--simple-mirror-parse-create (snippet)
   "Parse the simple \"$n\" fields/mirrors/exitmarkers."
-  (while (re-search-forward yas-simple-mirror-regexp nil t)
+  (while (re-search-forward yas--simple-mirror-regexp nil t)
     (let ((number (string-to-number (match-string-no-properties 1))))
       (cond ((zerop number)
 
-             (setf (yas-snippet-exit snippet)
-                   (yas-make-exit (yas-make-marker (match-end 0))))
+             (setf (yas--snippet-exit snippet)
+                   (yas--make-exit (yas--make-marker (match-end 0))))
              (save-excursion
                (goto-char (match-beginning 0))
                (when yas-wrap-around-region
@@ -3978,27 +3979,27 @@ When multiple expressions are found, only the last one counts."
                              (get-register ?0))
                         (insert (prog1 (get-register ?0)
                                   (set-register ?0 nil))))))
-               (push (cons (point) (yas-exit-marker (yas-snippet-exit snippet)))
-                     yas-dollar-regions)))
+               (push (cons (point) (yas--exit-marker (yas--snippet-exit snippet)))
+                     yas--dollar-regions)))
             (t
-             (let ((field (yas-snippet-find-field snippet number)))
+             (let ((field (yas--snippet-find-field snippet number)))
                (if field
-                   (let ((brand-new-mirror (yas-make-mirror
-                                            (yas-make-marker (match-beginning 0))
-                                            (yas-make-marker (match-beginning 0))
+                   (let ((brand-new-mirror (yas--make-mirror
+                                            (yas--make-marker (match-beginning 0))
+                                            (yas--make-marker (match-beginning 0))
                                             nil)))
                      (push brand-new-mirror
-                           (yas-field-mirrors field))
-                     (yas-calculate-mirrors-in-fields snippet brand-new-mirror))
-                 (push (yas-make-field number
-                                       (yas-make-marker (match-beginning 0))
-                                       (yas-make-marker (match-beginning 0))
+                           (yas--field-mirrors field))
+                     (yas--calculate-mirrors-in-fields snippet brand-new-mirror))
+                 (push (yas--make-field number
+                                       (yas--make-marker (match-beginning 0))
+                                       (yas--make-marker (match-beginning 0))
                                        nil)
-                       (yas-snippet-fields snippet))))
+                       (yas--snippet-fields snippet))))
              (push (cons (match-beginning 0) (match-end 0))
-                   yas-dollar-regions))))))
+                   yas--dollar-regions))))))
 
-(defun yas-delete-regions (regions)
+(defun yas--delete-regions (regions)
   "Sort disjuct REGIONS by start point, then delete from the back."
   (mapc #'(lambda (reg)
             (delete-region (car reg) (cdr reg)))
@@ -4006,97 +4007,97 @@ When multiple expressions are found, only the last one counts."
               #'(lambda (r1 r2)
                   (>= (car r1) (car r2))))))
 
-(defun yas-update-mirrors (snippet)
+(defun yas--update-mirrors (snippet)
   "Updates all the mirrors of SNIPPET."
   (save-excursion
-    (let* ((fields (copy-list (yas-snippet-fields snippet)))
+    (let* ((fields (copy-list (yas--snippet-fields snippet)))
            (field (car fields)))
       (while field
-        (dolist (mirror (yas-field-mirrors field))
-          (let ((mirror-parent-field (yas-mirror-parent-field mirror)))
+        (dolist (mirror (yas--field-mirrors field))
+          (let ((mirror-parent-field (yas--mirror-parent-field mirror)))
             ;; updatte this mirror
             ;;
-            (yas-mirror-update-display mirror field)
+            (yas--mirror-update-display mirror field)
             ;; for mirrors-in-fields: schedule a possible
             ;; parent field for reupdting later on
             ;;
             (when mirror-parent-field
               (add-to-list 'fields mirror-parent-field 'append #'eq))
-            ;; `yas-place-overlays' is needed if the active field and
+            ;; `yas--place-overlays' is needed if the active field and
             ;; protected overlays have been changed because of insertions
-            ;; in `yas-mirror-update-display'
+            ;; in `yas--mirror-update-display'
             ;;
-            (when (eq field (yas-snippet-active-field snippet))
-              (yas-place-overlays snippet field))))
+            (when (eq field (yas--snippet-active-field snippet))
+              (yas--place-overlays snippet field))))
         (setq fields (cdr fields))
         (setq field (car fields))))))
 
-(defun yas-mirror-update-display (mirror field)
+(defun yas--mirror-update-display (mirror field)
   "Update MIRROR according to FIELD (and mirror transform)."
 
-  (let* ((mirror-parent-field (yas-mirror-parent-field mirror))
+  (let* ((mirror-parent-field (yas--mirror-parent-field mirror))
          (reflection (and (not (and mirror-parent-field
-                                    (yas-field-modified-p mirror-parent-field)))
-                          (or (yas-apply-transform mirror field 'empty-on-nil)
-                              (yas-field-text-for-display field)))))
+                                    (yas--field-modified-p mirror-parent-field)))
+                          (or (yas--apply-transform mirror field 'empty-on-nil)
+                              (yas--field-text-for-display field)))))
     (when (and reflection
-               (not (string= reflection (buffer-substring-no-properties (yas-mirror-start mirror)
-                                                                        (yas-mirror-end mirror)))))
-      (goto-char (yas-mirror-start mirror))
-      (yas-inhibit-overlay-hooks
+               (not (string= reflection (buffer-substring-no-properties (yas--mirror-start mirror)
+                                                                        (yas--mirror-end mirror)))))
+      (goto-char (yas--mirror-start mirror))
+      (yas--inhibit-overlay-hooks
         (insert reflection))
-      (if (> (yas-mirror-end mirror) (point))
-          (delete-region (point) (yas-mirror-end mirror))
-        (set-marker (yas-mirror-end mirror) (point))
-        (yas-advance-start-maybe (yas-mirror-next mirror) (point))
+      (if (> (yas--mirror-end mirror) (point))
+          (delete-region (point) (yas--mirror-end mirror))
+        (set-marker (yas--mirror-end mirror) (point))
+        (yas--advance-start-maybe (yas--mirror-next mirror) (point))
         ;; super-special advance
-        (yas-advance-end-of-parents-maybe mirror-parent-field (point))))))
+        (yas--advance-end-of-parents-maybe mirror-parent-field (point))))))
 
-(defun yas-field-update-display (field snippet)
-  "Much like `yas-mirror-update-display', but for fields"
-  (when (yas-field-transform field)
-    (let ((transformed (and (not (eq (yas-field-number field) 0))
-                            (yas-apply-transform field field)))
+(defun yas--field-update-display (field snippet)
+  "Much like `yas--mirror-update-display', but for fields"
+  (when (yas--field-transform field)
+    (let ((transformed (and (not (eq (yas--field-number field) 0))
+                            (yas--apply-transform field field)))
           (point (point)))
       (when (and transformed
-                 (not (string= transformed (buffer-substring-no-properties (yas-field-start field)
-                                                                           (yas-field-end field)))))
-        (setf (yas-field-modified-p field) t)
-        (goto-char (yas-field-start field))
-        (yas-inhibit-overlay-hooks
+                 (not (string= transformed (buffer-substring-no-properties (yas--field-start field)
+                                                                           (yas--field-end field)))))
+        (setf (yas--field-modified-p field) t)
+        (goto-char (yas--field-start field))
+        (yas--inhibit-overlay-hooks
           (insert transformed)
-          (if (> (yas-field-end field) (point))
-              (delete-region (point) (yas-field-end field))
-            (set-marker (yas-field-end field) (point))
-            (yas-advance-start-maybe (yas-field-next field) (point)))
+          (if (> (yas--field-end field) (point))
+              (delete-region (point) (yas--field-end field))
+            (set-marker (yas--field-end field) (point))
+            (yas--advance-start-maybe (yas--field-next field) (point)))
           t)))))
 
 \f
 ;;; Post-command hook:
 
-(defun yas-post-command-handler ()
+(defun yas--post-command-handler ()
   "Handles various yasnippet conditions after each command."
-  (cond (yas-protection-violation
-         (goto-char yas-protection-violation)
-         (setq yas-protection-violation nil))
+  (cond (yas--protection-violation
+         (goto-char yas--protection-violation)
+         (setq yas--protection-violation nil))
         ((eq 'undo this-command)
          ;;
          ;; After undo revival the correct field is sometimes not
          ;; restored correctly, this condition handles that
          ;;
-         (let* ((snippet (car (yas-snippets-at-point)))
+         (let* ((snippet (car (yas--snippets-at-point)))
                 (target-field (and snippet
                                    (find-if-not #'(lambda (field)
-                                                    (yas-field-probably-deleted-p snippet field))
+                                                    (yas--field-probably-deleted-p snippet field))
                                                 (remove nil
-                                                        (cons (yas-snippet-active-field snippet)
-                                                              (yas-snippet-fields snippet)))))))
+                                                        (cons (yas--snippet-active-field snippet)
+                                                              (yas--snippet-fields snippet)))))))
            (when target-field
-             (yas-move-to-field snippet target-field))))
-        ((not (yas-undo-in-progress))
+             (yas--move-to-field snippet target-field))))
+        ((not (yas--undo-in-progress))
          ;; When not in an undo, check if we must commit the snippet
          ;; (user exited it).
-         (yas-check-commit-snippet))))
+         (yas--check-commit-snippet))))
 \f
 ;;; Fancy docs:
 ;;
@@ -4104,9 +4105,9 @@ When multiple expressions are found, only the last one counts."
 ;; depending on the context.
 ;;
 (put 'yas-expand  'function-documentation
-     '(yas-expand-from-trigger-key-doc))
-(defun yas-expand-from-trigger-key-doc ()
-  "A doc synthethizer for `yas-expand-from-trigger-key-doc'."
+     '(yas--expand-from-trigger-key-doc))
+(defun yas--expand-from-trigger-key-doc ()
+  "A doc synthethizer for `yas--expand-from-trigger-key-doc'."
   (let ((fallback-description
          (cond ((eq yas-fallback-behavior 'call-other-command)
                 (let* ((yas-minor-mode nil)
@@ -4117,35 +4118,35 @@ When multiple expressions are found, only the last one counts."
                ((eq yas-fallback-behavior 'return-nil)
                 ", do nothing.")
                (t
-                ", defer to `yas-fallback-behaviour' :-)"))))
+                ", defer to `yas--fallback-behaviour' :-)"))))
     (concat "Expand a snippet before point. If no snippet
 expansion is possible,"
             fallback-description
             "\n\nOptional argument FIELD is for non-interactive use and is an
-object satisfying `yas-field-p' to restrict the expansion to.")))
+object satisfying `yas--field-p' to restrict the expansion to.")))
 
-(put 'yas-expand-from-keymap  'function-documentation '(yas-expand-from-keymap-doc))
-(defun yas-expand-from-keymap-doc ()
-  "A doc synthethizer for `yas-expand-from-keymap-doc'."
-  (add-hook 'temp-buffer-show-hook 'yas-snippet-description-finish-runonce)
+(put 'yas-expand-from-keymap  'function-documentation '(yas--expand-from-keymap-doc))
+(defun yas--expand-from-keymap-doc ()
+  "A doc synthethizer for `yas--expand-from-keymap-doc'."
+  (add-hook 'temp-buffer-show-hook 'yas--snippet-description-finish-runonce)
   (concat "Expand/run snippets from keymaps, possibly falling back to original binding.\n"
           (when (eq this-command 'describe-key)
             (let* ((vec (this-single-command-keys))
                    (templates (mapcan #'(lambda (table)
-                                          (yas-fetch table vec))
-                                      (yas-get-snippet-tables)))
-                   (yas-direct-keymaps nil)
+                                          (yas--fetch table vec))
+                                      (yas--get-snippet-tables)))
+                   (yas--direct-keymaps nil)
                    (fallback (key-binding vec)))
               (concat "In this case, "
                       (when templates
                         (concat "these snippets are bound to this key:\n"
-                                (yas-template-pretty-list templates)
+                                (yas--template-pretty-list templates)
                                 "\n\nIf none of these expands, "))
                       (or (and fallback
                                (format "fallback `%s' will be called." (pp-to-string fallback)))
                           "no fallback keybinding is called."))))))
 
-(defun yas-template-pretty-list (templates)
+(defun yas--template-pretty-list (templates)
   (let ((acc)
         (yas-buffer-local-condition 'always))
     (dolist (plate templates)
@@ -4156,15 +4157,15 @@ object satisfying `yas-field-p' to restrict the expansion to.")))
 
 (define-button-type 'help-snippet-def
   :supertype 'help-xref
-  'help-function (lambda (template) (yas-visit-snippet-file-1 template))
+  'help-function (lambda (template) (yas--visit-snippet-file-1 template))
   'help-echo (purecopy "mouse-2, RET: find snippets's definition"))
 
-(defun yas-snippet-description-finish-runonce ()
+(defun yas--snippet-description-finish-runonce ()
   "Final adjustments for the help buffer when snippets are concerned."
-  (yas-create-snippet-xrefs)
-  (remove-hook 'temp-buffer-show-hook 'yas-snippet-description-finish-runonce))
+  (yas--create-snippet-xrefs)
+  (remove-hook 'temp-buffer-show-hook 'yas--snippet-description-finish-runonce))
 
-(defun yas-create-snippet-xrefs ()
+(defun yas--create-snippet-xrefs ()
   (save-excursion
     (goto-char (point-min))
     (while (search-forward-regexp "\\\\\\\\snippet[ \s\t]+`\\([^']+\\)'" nil t)
@@ -4175,26 +4176,26 @@ object satisfying `yas-field-p' to restrict the expansion to.")))
           (kill-region (match-end 1) (match-end 0))
           (kill-region (match-beginning 0) (match-beginning 1)))))))
 
-(defun yas-expand-uuid (mode-symbol uuid &optional start end expand-env)
+(defun yas--expand-uuid (mode-symbol uuid &optional start end expand-env)
   "Expand a snippet registered in MODE-SYMBOL's table with UUID.
 
 Remaining args as in `yas-expand-snippet'."
-  (let* ((table (gethash mode-symbol yas-tables))
-         (yas-current-template (and table
-                                    (gethash uuid (yas-table-uuidhash table)))))
-    (when yas-current-template
-      (yas-expand-snippet (yas-template-content yas-current-template)))))
+  (let* ((table (gethash mode-symbol yas--tables))
+         (yas--current-template (and table
+                                    (gethash uuid (yas--table-uuidhash table)))))
+    (when yas--current-template
+      (yas-expand-snippet (yas--template-content yas--current-template)))))
 \f
 ;;; Utils
 
 (defvar yas-verbosity 4
-  "Log level for `yas-message' 4 means trace most anything, 0 means nothing.")
+  "Log level for `yas--message' 4 means trace most anything, 0 means nothing.")
 
-(defun yas-message (level message &rest args)
+(defun yas--message (level message &rest args)
   (when (> yas-verbosity level)
-    (message (apply #'yas-format message args))))
+    (message (apply #'yas--format message args))))
 
-(defun yas-format (format-control &rest format-args)
+(defun yas--format (format-control &rest format-args)
   (apply #'format (concat "[yas] " format-control) format-args))
 
 \f
@@ -4273,7 +4274,7 @@ and return the directory.  Return nil if not found."
 ;; # type inside `<>`
 
 (defadvice c-neutralize-syntax-in-CPP
-  (around yas-mp/c-neutralize-syntax-in-CPP activate)
+  (around yas--mp/c-neutralize-syntax-in-CPP activate)
   "Adviced `c-neutralize-syntax-in-CPP' to properly
 handle the end-of-buffer error fired in it by calling
 `forward-char' at the end of buffer."
@@ -4289,88 +4290,123 @@ handle the end-of-buffer error fired in it by calling
                  k 'self-insert-command))))
 \f
 ;;; Backward compatibility to to yasnippet <= 0.7
-
-(dolist (sym '(;; obsolete `defcustom's
-               ;;
-               yas/snippet-dirs
-               yas/prompt-functions
-               yas/indent-line
-               yas/also-auto-indent-first-line
-               yas/snippet-revival
-               yas/trigger-key
-               yas/next-field-key
-               yas/prev-field-key
-               yas/skip-and-clear-key
-               yas/triggers-in-field
-               yas/fallback-behavior
-               yas/choose-keys-first
-               yas/choose-tables-first
-               yas/use-menu
-               yas/trigger-symbol
-               yas/wrap-around-region
-               yas/good-grace
-               yas/visit-from-menu
-               yas/expand-only-for-last-commands
-
-               ;; these vars can be customized as well
-               ;;
-               yas/keymap
-               yas/key-syntaxes
-               yas/after-exit-snippet-hook
-               yas/before-expand-snippet-hook
-               yas/buffer-local-condition
-
-               ;; obsolete interactive functions
-               ;;
-               yas/minor-mode
-               yas/global-mode
-               yas/direct-keymaps-reload
-               yas/minor-mode-on
-               yas/load-directory
-               yas/reload-all
-               yas/compile-directory
-               yas/recompile-all
-               yas/about
-               yas/expand-from-trigger-key
-               yas/expand-from-keymap
-               yas/insert-snippet
-               yas/visit-snippet-file
-               yas/new-snippet
-               yas/load-snippet-buffer
-               yas/tryout-snippet
-               yas/describe-tables
-               yas/next-field-or-maybe-expand
-               yas/next-field
-               yas/prev-field
-               yas/abort-snippet
-               yas/exit-snippet
-               yas/exit-all-snippets
-               yas/skip-and-clear-or-delete-char
-
-               ;; obsolete non-interactive that I "exported" for use
-               ;; in snippets
-               ;;
-               yas/modified-p
-               yas/moving-away-p
-               yas/text
-               yas/substr
-               yas/choose-value
-               yas/key-to-value
-               yas/throw
-               yas/verify-value
-               yas/field-value
-               yas/text
-               yas/selected-text
-               yas/default-from-field
-               yas/inside-string
-               yas/unimplemented))
-  (let ((replacement (intern (replace-regexp-in-string "^yas/" "yas-" (symbol-name sym)))))
-    (when (boundp replacement)
-      (make-obsolete-variable sym replacement "yasnippet 0.8")
-      (defvaralias sym replacement))
-    (when (fboundp replacement)
-      (make-obsolete sym replacement "yasnippet 0.8")
-      (defalias sym replacement))))
+(defvar yas--exported-syms '(;; `defcustom's
+                             ;;
+                             yas-snippet-dirs
+                             yas-prompt-functions
+                             yas-indent-line
+                             yas-also-auto-indent-first-line
+                             yas-snippet-revival
+                             yas-trigger-key
+                             yas-next-field-key
+                             yas-prev-field-key
+                             yas-skip-and-clear-key
+                             yas-triggers-in-field
+                             yas-fallback-behavior
+                             yas-choose-keys-first
+                             yas-choose-tables-first
+                             yas-use-menu
+                             yas-trigger-symbol
+                             yas-wrap-around-region
+                             yas-good-grace
+                             yas-visit-from-menu
+                             yas-expand-only-for-last-commands
+                             yas-field-highlight-face
+
+                             ;; these vars can be customized as well
+                             ;;
+                             yas-keymap
+                             yas-verbosity
+                             yas-extra-modes
+                             yas-key-syntaxes
+                             yas-after-exit-snippet-hook
+                             yas-before-expand-snippet-hook
+                             yas-buffer-local-condition
+
+                             ;; prompting functions
+                             ;;
+                             yas-x-prompt
+                             yas-ido-prompt
+                             yas-no-prompt
+                             yas-completing-prompt
+                             yas-dropdown-prompt
+
+                             ;; interactive functions
+                             ;;
+                             yas-expand
+                             yas-minor-mode
+                             yas-global-mode
+                             yas-direct-keymaps-reload
+                             yas-minor-mode-on
+                             yas-load-directory
+                             yas-reload-all
+                             yas-compile-directory
+                             yas-recompile-all
+                             yas-about
+                             yas-expand-from-trigger-key
+                             yas-expand-from-keymap
+                             yas-insert-snippet
+                             yas-visit-snippet-file
+                             yas-new-snippet
+                             yas-load-snippet-buffer
+                             yas-tryout-snippet
+                             yas-describe-tables
+                             yas-next-field-or-maybe-expand
+                             yas-next-field
+                             yas-prev-field
+                             yas-abort-snippet
+                             yas-exit-snippet
+                             yas-exit-all-snippets
+                             yas-skip-and-clear-or-delete-char
+
+                             ;; symbols that I "exported" for use
+                             ;; in snippets and hookage
+                             ;;
+                             yas-expand-snippet
+                             yas-define-snippets
+                             yas-define-menu
+                             yas-snippet-beg
+                             yas-snippet-end
+                             yas-modified-p
+                             yas-moving-away-p
+                             yas-text
+                             yas-substr
+                             yas-choose-value
+                             yas-key-to-value
+                             yas-throw
+                             yas-verify-value
+                             yas-field-value
+                             yas-text
+                             yas-selected-text
+                             yas-default-from-field
+                             yas-inside-string
+                             yas-unimplemented
+                             yas-define-condition-cache
+
+                             ;; debug definitions
+                             ;; yas-debug-snippet-vars
+                             ;; yas-exterminate-package
+                             ;; yas-debug-test
+
+                             ;; testing definitions
+                             ;; yas-should-expand
+                             ;; yas-should-not-expand
+                             ;; yas-mock-insert
+                             ;; yas-make-file-or-dirs
+                             ;; yas-variables
+                             ;; yas-saving-variables
+                             ;; yas-call-with-snippet-dirs
+                             ;; yas-with-snippet-dirs
+))
+
+(dolist (sym yas--exported-syms)
+  (let ((backported (intern (replace-regexp-in-string "^yas-" "yas/" (symbol-name sym)))))
+    (when (boundp sym)
+      (make-obsolete-variable backported sym "yasnippet 0.8")
+      (defvaralias backported sym))
+    (when (fboundp sym)
+      (make-obsolete backported sym "yasnippet 0.8")
+      (defalias backported sym))))
 
 \f
 (provide 'yasnippet)