[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole a85f06a9e4 090/143: Merge branch 'rsw' of hyp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole a85f06a9e4 090/143: Merge branch 'rsw' of hyperbole into rsw |
Date: |
Mon, 19 Feb 2024 15:59:13 -0500 (EST) |
branch: externals/hyperbole
commit a85f06a9e429b96509c6d0a355f4f3c742aaec39
Merge: 1b8fb059c6 2f2d51b816
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
Merge branch 'rsw' of hyperbole into rsw
---
ChangeLog | 13 ++++++
hui-mouse.el | 6 +--
test/hyrolo-tests.el | 115 ++++++++++++++++++++++++++++++++++++++++++++-------
3 files changed, 115 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index feedb4d0cc..59127db689 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2024-01-16 Mats Lidell <matsl@gnu.org>
+
+* test/hyrolo-tests.el
+ (hyrolo-tests--forward-same-level-all-file-types-level1-depth2)
+ (hyrolo-tests--forward-same-level-all-file-types-level2): Add test
+ with more file types and second level headings.
+
+ (hyrolo-tests--outline-content-org, hyrolo-tests--outline-content-otl)
+ (hyrolo-tests--outline-content-md); Add test content constants.
+
+ (hyrolo-tests--gen-kotl-outline): Add depth arg to kotl to generate
+ child cells in test data.
+
2024-01-15 Bob Weiner <rsw@gnu.org>
* test/hyrolo-tests.el
(hyrolo-tests--forward-same-level-all-file-types-level1):
diff --git a/hui-mouse.el b/hui-mouse.el
index 8d1af80747..cb6195aad7 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-89
-;; Last-Mod: 15-Jan-24 at 18:18:37 by Bob Weiner
+;; Last-Mod: 15-Jan-24 at 22:12:47 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1447,8 +1447,8 @@ buffer and has moved the cursor to the selected buffer."
(interactive)
(if (hyrolo-hdr-in-p)
(hact 'hyp-source (save-excursion
- (hyrolo-hdr-to-first-line-p)
- (when (search-forward hbut:source-prefix nil t)
+ (when (and (hyrolo-hdr-to-first-line-p)
+ (search-forward hbut:source-prefix nil t))
(hbut:source t))))
(hyrolo-edit-entry)))
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index 89e2974540..392312014d 100644
--- a/test/hyrolo-tests.el
+++ b/test/hyrolo-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 19-Jun-21 at 22:42:00
-;; Last-Mod: 15-Jan-24 at 21:40:51 by Bob Weiner
+;; Last-Mod: 15-Jan-24 at 22:15:11 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -229,7 +229,7 @@ and {b} the previous same level cell."
(hyrolo-add "a")
(hyrolo-add "b/d")
- ; Verify insertion order and following date on separate line
+ ;; Verify insertion order and following date on separate line
(goto-char (point-min))
(should (looking-at "==="))
(dolist (insertion-order '("a" "b" "d" "c"))
@@ -238,7 +238,7 @@ and {b} the previous same level cell."
(hyrolo-sort)
- ; Verify sorted order and following date on separate line
+ ;; Verify sorted order and following date on separate line
(goto-char (point-min))
(should (looking-at "==="))
(dolist (sorted-order '("a" "b" "d" "c"))
@@ -565,7 +565,7 @@ Example:
(ert-deftest hyrolo-tests--outline-next-visible-heading-md ()
"Verify movement to next visible heading."
(let* ((md-file (make-temp-file "hypb" nil ".md"
- (hyrolo-tests--gen-outline ?# "heading" 2
"body" 2)))
+ (hyrolo-tests--gen-outline ?# "heading" 2
"body" 2)))
(hyrolo-file-list (list md-file)))
(unwind-protect
(progn
@@ -603,7 +603,7 @@ Example:
(ert-deftest hyrolo-tests--outline-next-visible-heading-all ()
"Verify movement to next visible heading."
(let* ((md-file (make-temp-file "hypb" nil ".md"
- (hyrolo-tests--gen-outline ?# "heading" 2
"body" 2)))
+ (hyrolo-tests--gen-outline ?# "heading" 2
"body" 2)))
(hyrolo-file-list (list md-file)))
(unwind-protect
(progn
@@ -665,7 +665,7 @@ Example:
(let* ((org-file1 (make-temp-file "hypb" nil ".org"
(hyrolo-tests--gen-outline ?* "heading-a"
1 "body-a" 2)))
(md-file1 (make-temp-file "hypb" nil ".md"
- (hyrolo-tests--gen-outline ?# "heading-b"
1 "body-b" 2)))
+ (hyrolo-tests--gen-outline ?# "heading-b" 1
"body-b" 2)))
(hyrolo-file-list (list org-file1 md-file1)))
(unwind-protect
(progn
@@ -702,15 +702,22 @@ Example:
(kill-buffer hyrolo-display-buffer)
(hy-delete-files-and-buffers hyrolo-file-list))))
-(defun hyrolo-tests--gen-kotl-outline (heading body)
+(defun hyrolo-tests--gen-kotl-outline (heading body &optional depth)
"Generate a temp file with kotl outline structure for hyrolo outline test.
-Make cell start with HEADING and follow by next line BODY."
+Make cell start with HEADING and follow by next line BODY. With
+optional DEPTH the number of sub cells are created to that depth."
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(find-file kotl-file)
(insert heading)
(kotl-mode:newline 1)
(insert body)
(kotl-mode:newline 1)
+ (when (and depth (< 0 depth))
+ (dotimes (d depth)
+ (kotl-mode:add-child)
+ (insert (format "%s %d" heading (1+ d)))
+ (kotl-mode:newline 1)
+ (insert (format "%s %d" body (1+ d)))))
(save-buffer)
kotl-file))
@@ -933,10 +940,39 @@ All files types are present."
(kill-buffer hyrolo-display-buffer)
(hy-delete-files-and-buffers hyrolo-file-list))))
-(ert-deftest hyrolo-tests--forward-same-level-org-level2 ()
- "Verify forward and backward to second level headers with org files."
- (let* ((content
- "\
+(ert-deftest hyrolo-tests--forward-same-level-all-file-types-level1-depth2 ()
+ "Verify forward and backward to first level headers and section lines.
+All files types are present with a max depth of 2 of the outline
+structure."
+ (let* ((org-file1 (make-temp-file "hypb" nil ".org"
+ (hyrolo-tests--gen-outline ?*
"heading-org" 1 "body-org" 2)))
+ (md-file1 (make-temp-file "hypb" nil ".md"
+ (hyrolo-tests--gen-outline ?# "heading-md"
1 "body-md" 2)))
+ (otl-file1 (make-temp-file "hypb" nil ".otl"
+ (hyrolo-tests--gen-outline ?*
"heading-otl" 1 "body-otl" 2)))
+ (kotl-file1 (hyrolo-tests--gen-kotl-outline "heading-kotl"
"body-kotl" 2))
+ (hyrolo-file-list (list org-file1 md-file1 otl-file1 kotl-file1)))
+ (unwind-protect
+ (progn
+ (hyrolo-grep "body")
+ (should (string= hyrolo-display-buffer (buffer-name)))
+
+ ;; Move forward
+ (dolist (v '("===" "^\\* heading-org 1$" "===" "^# heading-md 1$"
+ "===" "^\\* heading-otl 1$" "==="))
+ (should (and (looking-at-p v) (hact 'kbd-key "f"))))
+ (should (looking-at-p "^ +1\\. heading-kotl$")) ; When on last match
do not move further
+
+ ;; Move backward
+ (dolist (v '("===" "^\\* heading-otl 1$" "===" "^# heading-md 1$"
+ "===" "^\\* heading-org 1$" "==="))
+ (should (and (hact 'kbd-key "b") (looking-at-p v))))
+ (should (= 1 (line-number-at-pos))))
+ (kill-buffer hyrolo-display-buffer)
+ (hy-delete-files-and-buffers hyrolo-file-list))))
+
+(defconst hyrolo-tests--outline-content-org
+ "\
* h-org 1
body
** h-org 1.1
@@ -949,9 +985,22 @@ body
body
** h-org-2.1
body
-")
- (org-file1 (make-temp-file "hypb" nil ".org" content))
- (org-file2 (make-temp-file "hypb" nil ".org" content))
+"
+ "Outline content for org files.")
+
+(defconst hyrolo-tests--outline-content-otl
+ (string-replace "org" "otl" hyrolo-tests--outline-content-org)
+ "Outline content for otl files.")
+
+(defconst hyrolo-tests--outline-content-md
+ (string-replace "*" "#"
+ (string-replace "org" "md"
hyrolo-tests--outline-content-org))
+ "Outline content for markdown files.")
+
+(ert-deftest hyrolo-tests--forward-same-level-org-level2 ()
+ "Verify forward and backward to second level headers with org files."
+ (let* ((org-file1 (make-temp-file "hypb" nil ".org"
hyrolo-tests--outline-content-org))
+ (org-file2 (make-temp-file "hypb" nil ".org"
hyrolo-tests--outline-content-org))
(hyrolo-file-list (list org-file1 org-file2)))
(unwind-protect
(progn
@@ -967,7 +1016,41 @@ body
(should (and (hact 'kbd-key "f") (looking-at-p "^\\*\\* h-org
1\\.2")))
;; Multiple times does not move point when there are no more headers
at the same level
- (should-error (and (hact 'kbd-key "f") (looking-at-p "^\\*\\* h-org
1\\.2")))
+ (should-error (hact 'kbd-key "f"))
+ (should (looking-at-p "^\\*\\* h-org 1\\.2"))
+
+ ;; Move back on same level
+ (should (and (hact 'kbd-key "b") (looking-at-p "\\*\\* h-org
1\\.1")))
+
+ ;; Moving up from first header on a level errors, also when repeated.
+ (should-error (and (hact 'kbd-key "b") (looking-at-p "^\\*\\* h-org
1\\.1")))
+ (should-error (and (hact 'kbd-key "b") (looking-at-p "^\\*\\* h-org
1\\.1"))))
+ (kill-buffer hyrolo-display-buffer)
+ (hy-delete-files-and-buffers hyrolo-file-list))))
+
+(ert-deftest hyrolo-tests--forward-same-level-all-file-types-level2 ()
+ "Verify forward and backward to second level headers with org files."
+ (let* ((org-file1 (make-temp-file "hypb" nil ".org"
hyrolo-tests--outline-content-org))
+ (otl-file1 (make-temp-file "hypb" nil ".otl"
hyrolo-tests--outline-content-otl))
+ (md-file1 (make-temp-file "hypb" nil ".md"
hyrolo-tests--outline-content-md))
+ (kotl-file1 (hyrolo-tests--gen-kotl-outline "heading-kotl"
"body-kotl" 2))
+ (hyrolo-file-list (list org-file1 otl-file1 md-file1 kotl-file1)))
+ (unwind-protect
+ (progn
+ (hyrolo-grep "body")
+ (should (string= hyrolo-display-buffer (buffer-name)))
+
+ ;; Move to first second level header
+ (search-forward "** h-org 1.1")
+ (beginning-of-line)
+ (should (looking-at-p "^\\*\\* h-org 1\\.1"))
+
+ ;; Move forward same level
+ (should (and (hact 'kbd-key "f") (looking-at-p "^\\*\\* h-org
1\\.2")))
+
+ ;; Multiple times does not move point when there are no more headers
at the same level
+ (should-error (hact 'kbd-key "f"))
+ (should (looking-at-p "^\\*\\* h-org 1\\.2"))
;; Move back on same level
(should (and (hact 'kbd-key "b") (looking-at-p "\\*\\* h-org
1\\.1")))
- [elpa] externals/hyperbole 7e6d2e9659 062/143: Remove flymake/flycheck/byte-compile warnings (#431), (continued)
- [elpa] externals/hyperbole 7e6d2e9659 062/143: Remove flymake/flycheck/byte-compile warnings (#431), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole a4c41006cf 066/143: *ert* buffer - make {.} jump to interactively defined test def, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 3e88bb0b17 067/143: Reuse ert test result items when Smart Keys run tests from defs, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole c36535463c 071/143: Merge pull request #435 from rswgnu/matsl-rsw-run-tests-specified-by-selector, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole ffd2dcbb85 077/143: Add tests for non file ebut creation and deletion, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 3940e00d12 080/143: Fix mult-version/mixed Org installations and hyrolo improvements, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole cec4659839 082/143: ebut-delete-removes-ebut-in-non-file-buffer - Enable this test, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 1b8fb059c6 089/143: Fix HyRolo {f} and {b} commands and tests, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 3206c44448 086/143: Remove tar-ball dependency on elc files (#442), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 433eba17ca 092/143: Print build environment info when using eln target (#445), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole a85f06a9e4 090/143: Merge branch 'rsw' of hyperbole into rsw,
ELPA Syncer <=
- [elpa] externals/hyperbole 19aced9b01 078/143: Fix hyrolo-org-mode hide/show commands;, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 94b792e23f 076/143: hsys-xref.el - Add forgotten file, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 72d17af6e8 081/143: Merge branch 'rsw' into HEAD, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 30ec5b242a 083/143: Merge pull request #440 from rswgnu/matsl-rsw-add-tests-for-various-ebut, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 89b2477423 094/143: Remove skip guard on test that works in batch mode, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 4c28ade4aa 093/143: Respect EMACS macro in echo target (#446), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 48210fb535 091/143: Fix hyrolo-to-entry-beginning, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole edeaad38cd 102/143: Set copyright notice to include 2024 for files updated under 2024 (#453), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 44b5b447f7 101/143: Add hsettings tests (#452), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 9def89866a 112/143: HyRolo - (hyrolo-markdown-mode): Add missing (require 'markdown-mode), ELPA Syncer, 2024/02/19