79
79
80
80
;;;_* Dependency loads
81
81
(require 'overlay)
82
- (eval-when-compile
83
- ;; `cl' is required for `assert'. `assert' is not covered by a standard
84
- ;; autoload, but it is a macro, so that eval-when-compile is sufficient
85
- ;; to byte-compile it in, or to do the require when the buffer evalled.
86
- (require 'cl)
87
- )
82
+ (eval-when-compile (require 'cl-lib))
88
83
89
84
;;;_* USER CUSTOMIZATION VARIABLES:
90
85
@@ -6122,13 +6117,13 @@ signal."
6122
6117
(point-max))))
6123
6118
;; determine key mode and, if keypair, recipients:
6124
6119
(setq recipients
6125
- (case keypair-mode
6120
+ (pcase keypair-mode
6126
6121
6127
- (decrypting nil)
6122
+ (' decrypting nil)
6128
6123
6129
- (default (if encrypt-to (epg-list-keys epg-context encrypt-to)))
6124
+ (' default (if encrypt-to (epg-list-keys epg-context encrypt-to)))
6130
6125
6131
- ((prompt prompt-save)
6126
+ ((or ' prompt ' prompt-save)
6132
6127
(save-window-excursion
6133
6128
(epa-select-keys epg-context keypair-message)))))
6134
6129
@@ -6786,6 +6781,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
6786
6781
(defvar allout-tests-locally-true nil
6787
6782
"Fodder for allout resumptions tests -- defvar just for byte compiler.")
6788
6783
(defun allout-test-resumptions ()
6784
+ ;; FIXME: Use ERT.
6789
6785
"Exercise allout resumptions."
6790
6786
;; for each resumption case, we also test that the right local/global
6791
6787
;; scopes are affected during resumption effects:
@@ -6794,48 +6790,48 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
6794
6790
(with-temp-buffer
6795
6791
(allout-tests-obliterate-variable 'allout-tests-globally-unbound)
6796
6792
(allout-add-resumptions '(allout-tests-globally-unbound t))
6797
- (assert (not (default-boundp 'allout-tests-globally-unbound)))
6798
- (assert (local-variable-p 'allout-tests-globally-unbound (current-buffer)))
6799
- (assert (boundp 'allout-tests-globally-unbound))
6800
- (assert (equal allout-tests-globally-unbound t))
6793
+ (cl- assert (not (default-boundp 'allout-tests-globally-unbound)))
6794
+ (cl- assert (local-variable-p 'allout-tests-globally-unbound (current-buffer)))
6795
+ (cl- assert (boundp 'allout-tests-globally-unbound))
6796
+ (cl- assert (equal allout-tests-globally-unbound t))
6801
6797
(allout-do-resumptions)
6802
- (assert (not (local-variable-p 'allout-tests-globally-unbound
6798
+ (cl- assert (not (local-variable-p 'allout-tests-globally-unbound
6803
6799
(current-buffer))))
6804
- (assert (not (boundp 'allout-tests-globally-unbound))))
6800
+ (cl- assert (not (boundp 'allout-tests-globally-unbound))))
6805
6801
6806
6802
;; ensure that variable with prior global value is resumed
6807
6803
(with-temp-buffer
6808
6804
(allout-tests-obliterate-variable 'allout-tests-globally-true)
6809
6805
(setq allout-tests-globally-true t)
6810
6806
(allout-add-resumptions '(allout-tests-globally-true nil))
6811
- (assert (equal (default-value 'allout-tests-globally-true) t))
6812
- (assert (local-variable-p 'allout-tests-globally-true (current-buffer)))
6813
- (assert (equal allout-tests-globally-true nil))
6807
+ (cl- assert (equal (default-value 'allout-tests-globally-true) t))
6808
+ (cl- assert (local-variable-p 'allout-tests-globally-true (current-buffer)))
6809
+ (cl- assert (equal allout-tests-globally-true nil))
6814
6810
(allout-do-resumptions)
6815
- (assert (not (local-variable-p 'allout-tests-globally-true
6811
+ (cl- assert (not (local-variable-p 'allout-tests-globally-true
6816
6812
(current-buffer))))
6817
- (assert (boundp 'allout-tests-globally-true))
6818
- (assert (equal allout-tests-globally-true t)))
6813
+ (cl- assert (boundp 'allout-tests-globally-true))
6814
+ (cl- assert (equal allout-tests-globally-true t)))
6819
6815
6820
6816
;; ensure that prior local value is resumed
6821
6817
(with-temp-buffer
6822
6818
(allout-tests-obliterate-variable 'allout-tests-locally-true)
6823
6819
(set (make-local-variable 'allout-tests-locally-true) t)
6824
- (assert (not (default-boundp 'allout-tests-locally-true))
6820
+ (cl- assert (not (default-boundp 'allout-tests-locally-true))
6825
6821
nil (concat "Test setup mistake -- variable supposed to"
6826
6822
" not have global binding, but it does."))
6827
- (assert (local-variable-p 'allout-tests-locally-true (current-buffer))
6823
+ (cl- assert (local-variable-p 'allout-tests-locally-true (current-buffer))
6828
6824
nil (concat "Test setup mistake -- variable supposed to have"
6829
6825
" local binding, but it lacks one."))
6830
6826
(allout-add-resumptions '(allout-tests-locally-true nil))
6831
- (assert (not (default-boundp 'allout-tests-locally-true)))
6832
- (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6833
- (assert (equal allout-tests-locally-true nil))
6827
+ (cl- assert (not (default-boundp 'allout-tests-locally-true)))
6828
+ (cl- assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6829
+ (cl- assert (equal allout-tests-locally-true nil))
6834
6830
(allout-do-resumptions)
6835
- (assert (boundp 'allout-tests-locally-true))
6836
- (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6837
- (assert (equal allout-tests-locally-true t))
6838
- (assert (not (default-boundp 'allout-tests-locally-true))))
6831
+ (cl- assert (boundp 'allout-tests-locally-true))
6832
+ (cl- assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6833
+ (cl- assert (equal allout-tests-locally-true t))
6834
+ (cl- assert (not (default-boundp 'allout-tests-locally-true))))
6839
6835
6840
6836
;; ensure that last of multiple resumptions holds, for various scopes.
6841
6837
(with-temp-buffer
@@ -6851,27 +6847,27 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
6851
6847
'(allout-tests-globally-true 3)
6852
6848
'(allout-tests-locally-true 4))
6853
6849
;; reestablish many of the basic conditions are maintained after re-add:
6854
- (assert (not (default-boundp 'allout-tests-globally-unbound)))
6855
- (assert (local-variable-p 'allout-tests-globally-unbound (current-buffer)))
6856
- (assert (equal allout-tests-globally-unbound 2))
6857
- (assert (default-boundp 'allout-tests-globally-true))
6858
- (assert (local-variable-p 'allout-tests-globally-true (current-buffer)))
6859
- (assert (equal allout-tests-globally-true 3))
6860
- (assert (not (default-boundp 'allout-tests-locally-true)))
6861
- (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6862
- (assert (equal allout-tests-locally-true 4))
6850
+ (cl- assert (not (default-boundp 'allout-tests-globally-unbound)))
6851
+ (cl- assert (local-variable-p 'allout-tests-globally-unbound (current-buffer)))
6852
+ (cl- assert (equal allout-tests-globally-unbound 2))
6853
+ (cl- assert (default-boundp 'allout-tests-globally-true))
6854
+ (cl- assert (local-variable-p 'allout-tests-globally-true (current-buffer)))
6855
+ (cl- assert (equal allout-tests-globally-true 3))
6856
+ (cl- assert (not (default-boundp 'allout-tests-locally-true)))
6857
+ (cl- assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6858
+ (cl- assert (equal allout-tests-locally-true 4))
6863
6859
(allout-do-resumptions)
6864
- (assert (not (local-variable-p 'allout-tests-globally-unbound
6860
+ (cl- assert (not (local-variable-p 'allout-tests-globally-unbound
6865
6861
(current-buffer))))
6866
- (assert (not (boundp 'allout-tests-globally-unbound)))
6867
- (assert (not (local-variable-p 'allout-tests-globally-true
6862
+ (cl- assert (not (boundp 'allout-tests-globally-unbound)))
6863
+ (cl- assert (not (local-variable-p 'allout-tests-globally-true
6868
6864
(current-buffer))))
6869
- (assert (boundp 'allout-tests-globally-true))
6870
- (assert (equal allout-tests-globally-true t))
6871
- (assert (boundp 'allout-tests-locally-true))
6872
- (assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6873
- (assert (equal allout-tests-locally-true t))
6874
- (assert (not (default-boundp 'allout-tests-locally-true))))
6865
+ (cl- assert (boundp 'allout-tests-globally-true))
6866
+ (cl- assert (equal allout-tests-globally-true t))
6867
+ (cl- assert (boundp 'allout-tests-locally-true))
6868
+ (cl- assert (local-variable-p 'allout-tests-locally-true (current-buffer)))
6869
+ (cl- assert (equal allout-tests-locally-true t))
6870
+ (cl- assert (not (default-boundp 'allout-tests-locally-true))))
6875
6871
6876
6872
;; ensure that deliberately unbinding registered variables doesn't foul things
6877
6873
(with-temp-buffer
0 commit comments