Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2026-01-07 Mats Lidell <[email protected]>

* hywiki.el (hywiki-mode): Remove arg value :toggle, not an alternative to
'toogle.

* test/hywiki-tests.el (hywiki-test--hywiki-mode): Add test for hywiki-mode.

2025-12-31 Mats Lidell <[email protected]>

* Remove starting asterix from defcustom variable docstrings.
Expand Down
8 changes: 4 additions & 4 deletions hywiki.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Apr-24 at 22:41:13
;; Last-Mod: 30-Nov-25 at 18:06:52 by Bob Weiner
;; Last-Mod: 7-Jan-26 at 15:26:05 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
;; Copyright (C) 2024-2025 Free Software Foundation, Inc.
;; Copyright (C) 2024-2026 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
Expand Down Expand Up @@ -801,9 +801,9 @@ See the Info documentation at \"(hyperbole)HyWiki\".
:keymap hywiki-mode-map
:group 'hyperbole-hywiki
(progn
(when (memq arg '(toggle :toggle))
(when (eq arg 'toggle)
;; Toggle across all editable buffers
(setq arg (if hywiki-mode 1 0)))
(setq arg hywiki-mode))
(cond
((or (and (integerp arg) (= arg 1))
(memq arg '(:all t)))
Expand Down
20 changes: 19 additions & 1 deletion test/hywiki-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
;; Copyright (C) 2024-2025 Free Software Foundation, Inc.
;; Copyright (C) 2024-2026 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
Expand Down Expand Up @@ -2141,6 +2141,24 @@ expected result."
(hy-delete-files-and-buffers (list wikiHi wikiHo))
(hywiki-tests--delete-hywiki-dir-and-buffer hywiki-directory)))))

(ert-deftest hywiki-test--hywiki-mode ()
"Verify activating local and global `hywiki-mode'."
(hywiki-tests--preserve-hywiki-mode
(with-temp-buffer
(should (eq nil (hywiki-mode 0)))
(should (eq nil (hywiki-mode -1)))
(should (eq nil (hywiki-mode nil)))
(should (eq :pages (hywiki-mode 2)))
(should (eq :all (hywiki-mode 1)))
(should (eq :all (hywiki-mode t)))
(should (eq :all (hywiki-mode :all)))

;; Toggle
(should (eq nil (call-interactively #'hywiki-mode)))
(should (eq :all (call-interactively #'hywiki-mode)))
(should (eq nil (hywiki-mode 'toggle)))
(should (eq :all (hywiki-mode 'toggle))))))

(ert-deftest hywiki-tests--interactive-hywiki-mode-toggles ()
"Verify `hywiki-mode' called interactively toggles mode."
(hywiki-tests--preserve-hywiki-mode
Expand Down