diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-06 16:09:38 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-06 16:09:38 +0200 |
commit | afc14e4f661194969ef1622e2d9310cfbf662aff (patch) | |
tree | 6e480d181b95e40d4f6a807851b9466f935f3113 /test/lisp/subr-tests.el | |
parent | 92bbe911e99968c04509c553767fa83bfdcbeb18 (diff) | |
download | emacs-afc14e4f661194969ef1622e2d9310cfbf662aff.tar.gz |
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/lisp/subr-tests.el')
-rw-r--r-- | test/lisp/subr-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
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.")) (should (equal (kbd "C-x ( C-d C-x )") "")) (should (equal (kbd "C-x ( C-x )") ""))) +(ert-deftest test-local-set-state () + (setq global 1) + (with-temp-buffer + (setq-local local 2) + (let ((state (buffer-local-set-state global 10 + local 20 + unexist 30))) + (buffer-local-restore-state state) + (should (= global 1)) + (should (= local 2)) + (should-not (boundp 'unexist))))) + (provide 'subr-tests) ;;; subr-tests.el ends here |