]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix: default value for `yas-trigger-key` is not "<tab>" not "TAB"
authorJoao Tavora <joaotavora@gmail.com>
Tue, 7 Aug 2012 11:06:53 +0000 (12:06 +0100)
committerJoao Tavora <joaotavora@gmail.com>
Tue, 7 Aug 2012 11:06:53 +0000 (12:06 +0100)
After some exploration, this seems to be the more correct default.
Corrected test that checks for correct binding in org-mode, pass in emacs23 and emacs24

yasnippet-tests.el
yasnippet.el

index eb1a2452fbdc223e10754d11af92996645652992..6c75b3596af766b191940b731a35bc9a19e6402c 100644 (file)
@@ -422,9 +422,9 @@ TODO: be meaner"
 (ert-deftest test-yas-tab-binding ()
   (with-temp-buffer
     (yas-minor-mode -1)
-    (should (not (eq (key-binding (yas--read-keybinding yas-trigger-key)) 'yas-expand)))
+    (should (not (eq (key-binding (yas--read-keybinding "<tab>")) 'yas-expand)))
     (yas-minor-mode 1)
-    (should (eq (key-binding (yas--read-keybinding yas-trigger-key)) 'yas-expand))
+    (should (eq (key-binding (yas--read-keybinding "<tab>")) 'yas-expand))
     (yas-expand-snippet "$1 $2 $3")
     (dolist (k (if (listp yas-next-field-key)
                    yas-next-field-key
@@ -439,7 +439,7 @@ TODO: be meaner"
   (with-temp-buffer
     (org-mode)
     (yas-minor-mode 1)
-    (should (eq (key-binding (yas--read-keybinding yas-trigger-key)) 'yas-expand))))
+    (should (eq (key-binding (yas--read-keybinding "<tab>")) 'yas-expand))))
 
 ;;; Helpers
 ;;;
index 4a4b6ed63bd30cf9241b9688f24c8d8c95a2cd6f..ed75cabb385ad1a9cba32065c7817e078d7476a8 100644 (file)
@@ -236,8 +236,8 @@ Naturally this is only valid when `yas-indent-line' is `auto'"
   :type 'boolean
   :group 'yasnippet)
 
-(defcustom yas-trigger-key "TAB"
-  "The key bound to `yas-expand' when function `yas-minor-mode' is active.
+(defcustom yas-trigger-key "<tab>"
+  "The key bound to `yas-expand' when `yas-minor-mode' is active.
 
 Value is a string that is converted to the internal Emacs key
 representation using `read-kbd-macro'."