[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/so-long 0e0d677 06/10: ; * lisp/so-long.el: Minor bug fixes
From: |
Phil Sainty |
Subject: |
scratch/so-long 0e0d677 06/10: ; * lisp/so-long.el: Minor bug fixes |
Date: |
Thu, 29 Jul 2021 23:59:38 -0400 (EDT) |
branch: scratch/so-long
commit 0e0d677db07d1b9415c25b245f547481e49c7fd9
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>
; * lisp/so-long.el: Minor bug fixes
(so-long-disable-minor-modes): Don't call the mode function to disable
the mode unless it was actually enabled.
(so-long-restore-minor-modes, so-long-restore-variables): Use the
remembered list values, which might be different to the defaults.
Also comments, and spelling consistency changes for the so-long tests
(a fixup for commit 83bc4ad369 which had only addressed so-long.el,
and not the test files).
---
lisp/so-long.el | 7 ++++---
test/lisp/so-long-tests/so-long-tests.el | 9 ++++++---
test/lisp/so-long-tests/spelling-tests.el | 2 +-
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/lisp/so-long.el b/lisp/so-long.el
index edb97e3..07f8370 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -1343,14 +1343,15 @@ Calls `so-long-disable-minor-modes' and
`so-long-override-variables'."
(defun so-long-disable-minor-modes ()
"Disable any active minor modes listed in `so-long-minor-modes'."
(dolist (mode (so-long-original 'so-long-minor-modes))
- (when (and (boundp mode) mode)
+ (when (and (boundp mode)
+ (symbol-value mode))
(funcall mode 0))))
(defun so-long-restore-minor-modes ()
"Restore the minor modes which were disabled.
The modes are enabled in accordance with what was remembered in `so-long'."
- (dolist (mode so-long-minor-modes)
+ (dolist (mode (so-long-original 'so-long-minor-modes))
(when (and (so-long-original mode)
(boundp mode)
(not (symbol-value mode)))
@@ -1365,7 +1366,7 @@ The modes are enabled in accordance with what was
remembered in `so-long'."
"Restore the remembered values for the overridden variables.
The variables are set in accordance with what was remembered in `so-long'."
- (dolist (ovar so-long-variable-overrides)
+ (dolist (ovar (so-long-original 'so-long-variable-overrides))
(so-long-restore-variable (car ovar))))
(defun so-long-restore-variable (variable)
diff --git a/test/lisp/so-long-tests/so-long-tests.el
b/test/lisp/so-long-tests/so-long-tests.el
index a6d8721..56c20e6 100644
--- a/test/lisp/so-long-tests/so-long-tests.el
+++ b/test/lisp/so-long-tests/so-long-tests.el
@@ -58,7 +58,7 @@
(declare-function so-long-tests-assert-reverted "so-long-tests-helpers")
(declare-function so-long-tests-assert-and-revert "so-long-tests-helpers")
-;; Enable the automated behavior for all tests.
+;; Enable the automated behaviour for all tests.
(global-so-long-mode 1)
(ert-deftest so-long-tests-threshold-under ()
@@ -180,7 +180,7 @@
;; From Emacs 27 the `display-buffer' call is insufficient.
;; The various 'window change functions' are now invoked by the
;; redisplay, and redisplay does nothing at all in batch mode,
- ;; so we cannot test under this revised behavior. Refer to:
+ ;; so we cannot test under this revised behaviour. Refer to:
;; https://lists.gnu.org/r/emacs-devel/2019-10/msg00971.html
;; For interactive (non-batch) test runs, calling `redisplay'
;; does do the trick; so do that first.
@@ -405,7 +405,10 @@
(insert ,local-vars)
(normal-mode)
;; Remember the `emacs-lisp-mode' state. The other cases
- ;; will validate the 'reverted' state against this.
+ ;; will validate the 'reverted' state against this. (Note
+ ;; that we haven't displayed the buffer, and therefore only
+ ;; `so-long-invisible-buffer-function' has acted, so we are
+ ;; still remembering the 'before' state.)
(so-long-tests-remember)
(should (eq major-mode 'emacs-lisp-mode)))
;; Downgrade the action from major mode to minor mode.
diff --git a/test/lisp/so-long-tests/spelling-tests.el
b/test/lisp/so-long-tests/spelling-tests.el
index 0be8555..f778b64 100644
--- a/test/lisp/so-long-tests/spelling-tests.el
+++ b/test/lisp/so-long-tests/spelling-tests.el
@@ -57,7 +57,7 @@
(unwind-protect
(cl-letf (((symbol-function 'ispell-command-loop)
(lambda (_miss _guess word _start _end)
- (message "Unrecognized word: %s." word)
+ (message "Unrecognised word: %s." word)
(throw 'mistake t))))
(catch 'mistake
(find-library "so-long")
- branch scratch/so-long created (now 3d685ba), Phil Sainty, 2021/07/29
- scratch/so-long 3555187 01/10: ; * lisp/so-long.el: Documentation, Phil Sainty, 2021/07/29
- scratch/so-long d7de002 02/10: ; * lisp/so-long.el: Bump to version 1.1, Phil Sainty, 2021/07/29
- scratch/so-long fbb3a89 04/10: Make `global-so-long-mode' handle unrecognised file types, Phil Sainty, 2021/07/29
- scratch/so-long 57d7cb6 05/10: * lisp/so-long.el (so-long-minor-modes): Additional modes to disable, Phil Sainty, 2021/07/29
- scratch/so-long cf5ef99 07/10: ; so-long-tests.el: Suppress expected warnings, Phil Sainty, 2021/07/29
- scratch/so-long 3a109aa 08/10: Support 'preserved' variables and minor modes in `so-long-mode', Phil Sainty, 2021/07/29
- scratch/so-long 3d685ba 10/10: Make `global-so-long-mode' use `buffer-line-statistics', Phil Sainty, 2021/07/29
- scratch/so-long f019be5 03/10: Increase `so-long-threshold' and `so-long-max-lines' defaults, Phil Sainty, 2021/07/29
- scratch/so-long 0e0d677 06/10: ; * lisp/so-long.el: Minor bug fixes,
Phil Sainty <=
- scratch/so-long 647eb06 09/10: ; Revert "Make `so-long' restore `view-mode'", Phil Sainty, 2021/07/29