[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole b40f9e8 6/8: Merge branch 'master' of hyperbo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole b40f9e8 6/8: Merge branch 'master' of hyperbole |
Date: |
Tue, 18 May 2021 23:57:14 -0400 (EDT) |
branch: externals/hyperbole
commit b40f9e80600414b98f946c9487de7361f0a18bce
Merge: 51171bb 847c5c7
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
Merge branch 'master' of hyperbole
---
ChangeLog | 15 +++++++++
hypb.el | 7 ++++
hyperbole.el | 5 ++-
kotl/kotl-mode.el | 5 ++-
test/kotl-mode-tests.el | 87 +++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 117 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 544964a..193e3f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,8 +11,21 @@
if key-file was not given. Also remove interactive conditional
that prevented normalized-file from being set.
+2021-05-18 Mats Lidell <matsl@gnu.org>
+
+* test/kotl-mode-tests.el (setup-kotl-mode-example-test)
+ (smart-menu-loads-kotl-example, kotl-mode-example-loads-kotl-example)
+ (kotl-mode-move-between-cells, kotl-mode-indent-cell-changes-level):
+ Add kotl-mode tests.
+
2021-05-17 Mats Lidell <matsl@gnu.org>
+* kotl/kotl-mode.el (hypb):
+ hyperbole.el (hypb): Use compatibility macro.
+
+* hypb.el (hypb-with-suppressed-warnings): Add compatibility macro for
+ suppressing warnings
+
* Makefile (kotl/kotl-autoloads.el): Remove PRELOADS for generating
autoloads. Patch from Stefan Monnier. Thank you Stefan.
@@ -20,6 +33,8 @@
hyperbole.el (fboundp): Do not use with-suppressed-warnings since not
available in Emacs 26
+2021-05-17 Mats Lidell <matsl@gnu.org>
+
* kotl/kmenu.el (id-menubar-set): Add external dependency.
* hyrolo.el (google-contacts-history, google-contacts-expire-time)
diff --git a/hypb.el b/hypb.el
index 63af433..8caa156 100644
--- a/hypb.el
+++ b/hypb.el
@@ -18,6 +18,13 @@
(eval-and-compile (mapc #'require '(compile hversion hact locate)))
+(defmacro hypb-with-suppressed-warnings (spec &rest body)
+ "Backwards compatibility macro."
+ (declare (debug (sexp &optional body)) (indent 1))
+ (if (fboundp 'with-suppressed-warnings)
+ `(with-suppressed-warnings ,spec ,@body)
+ `(with-no-warnings ,@body)))
+
;;; ************************************************************************
;;; Public variables
;;; ************************************************************************
diff --git a/hyperbole.el b/hyperbole.el
index 5ba685f..64ddd99 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -75,6 +75,8 @@
;;; Start Initializations
;;; ************************************************************************
+(require 'hypb)
+
(defconst hyperbole-loading t
"Temporary constant available for testing while Hyperbole is loading.")
@@ -424,7 +426,8 @@ The function does NOT recursively descend into
subdirectories of the
directory or directories specified."
;; Don't use a 'let' on this next line or it will fail.
(setq generated-autoload-file output-file)
- (update-directory-autoloads dir)))
+ (hypb-with-suppressed-warnings ((obsolete update-directory-autoloads))
+ (update-directory-autoloads dir))))
;; Before the 6.0.1 release, Hyperbole used to patch the
package-generate-autoloads
;; function to ensure that kotl/ subdirectories were autoloaded. This
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index 1a55bf7..6c87ea7 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -18,6 +18,8 @@
(eval-and-compile (mapc #'require '(cl-lib delsel hsettings hmail kfile kvspec
kcell outline org-table kotl-orgtbl)))
+(require 'hypb)
+
;;; ************************************************************************
;;; Public variables
;;; ************************************************************************
@@ -166,7 +168,8 @@ It provides the following keys:
;; We have been converting a buffer from a foreign format to a koutline.
;; Now that it is converted, ensure that `kotl-previous-mode' is set to
;; koutline.
- (setq kotl-previous-mode 'kotl-mode)
+ (hypb-with-suppressed-warnings ((free-vars kotl-previous-mode))
+ (setq kotl-previous-mode 'kotl-mode))
;; Enable Org Table editing minor mode (user can disable via kotl-mode-hook
;; if desired).
(orgtbl-mode 1)
diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el
new file mode 100644
index 0000000..5ce7658
--- /dev/null
+++ b/test/kotl-mode-tests.el
@@ -0,0 +1,87 @@
+;;; kotl-mode-tests.el --- kotl-mode-el tests -*- lexical-binding:
t; -*-
+
+;; Copyright (C) 2021 Mats Lidell
+
+;; Author: Mats Lidell <matsl@gnu.org>
+;;
+;; Orig-Date: 18-May-21 at 22:14:10
+;;
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; See the "HY-COPY" file for license information.
+;;
+;; This file is part of GNU Hyperbole.
+
+;;; Commentary:
+
+;; Tests for kotl-mode in "../kotl/kotl-mode.el"
+
+;;; Code:
+
+(require 'ert)
+(require 'kotl-mode)
+
+(load (expand-file-name "hy-test-helpers"
+ (file-name-directory (or load-file-name
+ default-directory))))
+(declare-function hy-test-helpers:consume-input-events "hy-test-helpers")
+
+(defmacro setup-kotl-mode-example-test (&rest body)
+ "Setup for test using kotl-mode:example and run BODY."
+ `(unwind-protect
+ (progn
+ ,@body
+ (should (equal major-mode 'kotl-mode))
+ (should (string= (buffer-name (current-buffer)) "EXAMPLE.kotl")))
+ (kill-buffer "EXAMPLE.kotl")))
+
+(ert-deftest smart-menu-loads-kotl-example ()
+ "Loading kotl-mode example file works."
+ (skip-unless (not noninteractive))
+ (setup-kotl-mode-example-test
+ (should (hact 'kbd-key "C-h h k e"))
+ (hy-test-helpers:consume-input-events)))
+
+(ert-deftest kotl-mode-example-loads-kotl-example ()
+ "Loading kotl-mode example file works."
+ (setup-kotl-mode-example-test
+ (kotl-mode:example)))
+
+(ert-deftest kotl-mode-move-between-cells ()
+ "Loading kotl-mode example file works."
+ (setup-kotl-mode-example-test
+ ;; Start in first cell
+ (kotl-mode:example)
+ (should (kotl-mode:first-cell-p))
+
+ ;; Move to next cell
+ (kotl-mode:next-cell 1)
+ (should (not (kotl-mode:first-cell-p)))
+ (should (equal (kcell-view:level) 1))
+ (should (string= (kcell-view:visible-label) "2"))
+
+ ;; Move to next cell
+ (kotl-mode:next-cell 1)
+ (should (not (kotl-mode:first-cell-p)))
+ (should (equal (kcell-view:level) 2))
+ (should (string= (kcell-view:visible-label) "2a")))
+ )
+
+(ert-deftest kotl-mode-indent-cell-changes-level ()
+ "Loading kotl-mode example file works."
+ (skip-unless (not noninteractive))
+ (setup-kotl-mode-example-test
+ (kotl-mode:example)
+ (should (kotl-mode:first-cell-p))
+ (kotl-mode:next-cell 1)
+ (should (hact 'kbd-key "TAB"))
+ (hy-test-helpers:consume-input-events)
+ (should (equal (kcell-view:level) 2))
+ (should (string= (kcell-view:visible-label) "1a"))
+ ;; Cleanup
+ (set-buffer-modified-p nil)))
+
+(provide 'kotl-mode-tests)
+;;; kotl-mode-tests.el ends here
+
+
+
- [elpa] externals/hyperbole updated (e991ad7 -> c05d22c), ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 4a21251 1/8: Use compatibility macro for with-suppressed-warnings (#92), ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 912f02b 4/8: hpath:find - Add support for prog, outline & text mode # anchors, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 847c5c7 2/8: Add kotl-mode tests (#94), ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole cdbf1b5 3/8: hactypes.el - link-to-ebut - Fix error when key-file is nil, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 3f33725 7/8: Rename hypb-with-suppressed-warnings to hypb:with-suppressed-warnings, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole c05d22c 8/8: For automated testing, let kotl-mode:example use alternative dirs, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 51171bb 5/8: Remove additional byte-compile warnings, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole b40f9e8 6/8: Merge branch 'master' of hyperbole,
ELPA Syncer <=