diff options
| author | Lars Ingebrigtsen | 2022-05-06 16:09:38 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-05-06 16:09:38 +0200 |
| commit | afc14e4f661194969ef1622e2d9310cfbf662aff (patch) | |
| tree | 6e480d181b95e40d4f6a807851b9466f935f3113 /test | |
| parent | 92bbe911e99968c04509c553767fa83bfdcbeb18 (diff) | |
| download | emacs-afc14e4f661194969ef1622e2d9310cfbf662aff.tar.gz emacs-afc14e4f661194969ef1622e2d9310cfbf662aff.zip | |
Move buffer-local-set-state to subr because it's used at runtime
* lisp/subr.el (buffer-local-set-state)
(buffer-local-set-state--get, buffer-local-restore-state): Moved
from easy-mmode.el because they have to be available run-time.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/easy-mmode-tests.el | 12 | ||||
| -rw-r--r-- | test/lisp/subr-tests.el | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/test/lisp/emacs-lisp/easy-mmode-tests.el b/test/lisp/emacs-lisp/easy-mmode-tests.el index 697bf6c2152..f6d07196727 100644 --- a/test/lisp/emacs-lisp/easy-mmode-tests.el +++ b/test/lisp/emacs-lisp/easy-mmode-tests.el | |||
| @@ -60,16 +60,4 @@ | |||
| 60 | (easy-mmode-test-mode 'toggle) | 60 | (easy-mmode-test-mode 'toggle) |
| 61 | (should (eq easy-mmode-test-mode t)))) | 61 | (should (eq easy-mmode-test-mode t)))) |
| 62 | 62 | ||
| 63 | (ert-deftest test-local-set-state () | ||
| 64 | (setq global 1) | ||
| 65 | (with-temp-buffer | ||
| 66 | (setq-local local 2) | ||
| 67 | (let ((state (buffer-local-set-state global 10 | ||
| 68 | local 20 | ||
| 69 | unexist 30))) | ||
| 70 | (buffer-local-restore-state state) | ||
| 71 | (should (= global 1)) | ||
| 72 | (should (= local 2)) | ||
| 73 | (should-not (boundp 'unexist))))) | ||
| 74 | |||
| 75 | ;;; easy-mmode-tests.el ends here | 63 | ;;; easy-mmode-tests.el ends here |
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 3725f180f3a..6bcac2a5eba 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el | |||
| @@ -1058,5 +1058,17 @@ final or penultimate step during initialization.")) | |||
| 1058 | (should (equal (kbd "C-x ( C-d C-x )") "")) | 1058 | (should (equal (kbd "C-x ( C-d C-x )") "")) |
| 1059 | (should (equal (kbd "C-x ( C-x )") ""))) | 1059 | (should (equal (kbd "C-x ( C-x )") ""))) |
| 1060 | 1060 | ||
| 1061 | (ert-deftest test-local-set-state () | ||
| 1062 | (setq global 1) | ||
| 1063 | (with-temp-buffer | ||
| 1064 | (setq-local local 2) | ||
| 1065 | (let ((state (buffer-local-set-state global 10 | ||
| 1066 | local 20 | ||
| 1067 | unexist 30))) | ||
| 1068 | (buffer-local-restore-state state) | ||
| 1069 | (should (= global 1)) | ||
| 1070 | (should (= local 2)) | ||
| 1071 | (should-not (boundp 'unexist))))) | ||
| 1072 | |||
| 1061 | (provide 'subr-tests) | 1073 | (provide 'subr-tests) |
| 1062 | ;;; subr-tests.el ends here | 1074 | ;;; subr-tests.el ends here |