[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9cf9208 32/40: Fix test-rebindings
From: |
Noam Postavsky |
Subject: |
[elpa] master 9cf9208 32/40: Fix test-rebindings |
Date: |
Wed, 26 Oct 2016 23:06:34 +0000 (UTC) |
branch: master
commit 9cf92085e53f579af997f43540a26b4377f07678
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Fix test-rebindings
* yasnippet-tests.el (test-rebindings): Make the rebindings properly
temporary instead of just setting them back to what the presumed default
is.
---
yasnippet-tests.el | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index c5fd376..55cd137 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -900,23 +900,21 @@ TODO: be meaner"
(should (eq (key-binding [backtab]) 'yas-prev-field))))
(ert-deftest test-rebindings ()
- (unwind-protect
- (progn
- (define-key yas-minor-mode-map [tab] nil)
- (define-key yas-minor-mode-map (kbd "TAB") nil)
- (define-key yas-minor-mode-map (kbd "SPC") 'yas-expand)
- (with-temp-buffer
- (yas-minor-mode 1)
- (should (not (eq (key-binding (yas--read-keybinding "TAB"))
'yas-expand)))
- (should (eq (key-binding (yas--read-keybinding "SPC")) 'yas-expand))
- (yas-reload-all)
- (should (not (eq (key-binding (yas--read-keybinding "TAB"))
'yas-expand)))
- (should (eq (key-binding (yas--read-keybinding "SPC"))
'yas-expand))))
- ;; FIXME: actually should restore to whatever saved values where there.
- ;;
- (define-key yas-minor-mode-map [tab] 'yas-expand)
- (define-key yas-minor-mode-map (kbd "TAB") 'yas-expand)
- (define-key yas-minor-mode-map (kbd "SPC") nil)))
+ (let* ((yas-minor-mode-map (copy-keymap yas-minor-mode-map))
+ (minor-mode-map-alist
+ (cons `(yas-minor-mode . ,yas-minor-mode-map)
+ (cl-remove 'yas-minor-mode minor-mode-map-alist
+ :test #'eq :key #'car))))
+ (define-key yas-minor-mode-map [tab] nil)
+ (define-key yas-minor-mode-map (kbd "TAB") nil)
+ (define-key yas-minor-mode-map (kbd "SPC") 'yas-expand)
+ (with-temp-buffer
+ (yas-minor-mode 1)
+ (should-not (eq (key-binding (kbd "TAB")) 'yas-expand))
+ (should (eq (key-binding (kbd "SPC")) 'yas-expand))
+ (yas-reload-all)
+ (should-not (eq (key-binding (kbd "TAB")) 'yas-expand))
+ (should (eq (key-binding (kbd "SPC")) 'yas-expand)))))
(ert-deftest test-yas-in-org ()
(with-temp-buffer
- [elpa] master 00be21c 36/40: Change cl dep to cl-lib for tests too, (continued)
- [elpa] master 00be21c 36/40: Change cl dep to cl-lib for tests too, Noam Postavsky, 2016/10/26
- [elpa] master 9c9952c 12/40: Add test for indentation of single line mirrors, Noam Postavsky, 2016/10/26
- [elpa] master 4296a86 15/40: yasnippet.el (yas--quote-string): Remove., Noam Postavsky, 2016/10/26
- [elpa] master d4da806 17/40: Fix removal of snippets by uuid, Noam Postavsky, 2016/10/26
- [elpa] master 42b0c26 18/40: Don't warn about modifications to other buffers, Noam Postavsky, 2016/10/26
- [elpa] master eaaec30 38/40: Replace all occurances of `capitaomorte', Noam Postavsky, 2016/10/26
- [elpa] master ff6f31e 37/40: Replace yas--with-temp-redefs with cl-letf, Noam Postavsky, 2016/10/26
- [elpa] master 244cdfa 26/40: Merge: Simplify `yas-new-snippet' load&save logic, Noam Postavsky, 2016/10/26
- [elpa] master 9500b00 21/40: Fix field navigation in the backwards direction, Noam Postavsky, 2016/10/26
- [elpa] master 309fe15 31/40: * Rakefile: Handle unset `warnings' parameter, Noam Postavsky, 2016/10/26
- [elpa] master 9cf9208 32/40: Fix test-rebindings,
Noam Postavsky <=
- [elpa] master 7e0a0de 28/40: Use new name of python-in-string/comment in docs, Noam Postavsky, 2016/10/26
- [elpa] master e6b8651 39/40: * NEWS: Update for 0.11.0., Noam Postavsky, 2016/10/26
- [elpa] master 5264379 29/40: Cleanup redundant cl dependency, :group & :require, Noam Postavsky, 2016/10/26
- [elpa] master 4b12f7d 30/40: Don't warn about cl-functions with old cl-lib, Noam Postavsky, 2016/10/26
- [elpa] master a5e88b2 34/40: Add test for snippet saving, Noam Postavsky, 2016/10/26
- [elpa] master 299efcb 40/40: packages/yasnippet: Merge external (v0.11.0), Noam Postavsky, 2016/10/26