From 38093c1a9e1f44679f2f41d9df05a8b4fc363c08 Mon Sep 17 00:00:00 2001 From: Joao Tavora Date: Tue, 7 Aug 2012 12:06:53 +0100 Subject: [PATCH] Fix: default value for `yas-trigger-key` is not "" not "TAB" 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 | 6 +++--- yasnippet.el | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yasnippet-tests.el b/yasnippet-tests.el index eb1a245..6c75b35 100644 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -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 "")) '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 "")) '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 "")) 'yas-expand)))) ;;; Helpers ;;; diff --git a/yasnippet.el b/yasnippet.el index 4a4b6ed..ed75cab 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -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 "" + "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'."