[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 7657601745 043/143: hyrolo-mode-map - bind {n
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 7657601745 043/143: hyrolo-mode-map - bind {n} and {C-c C-n} to the same command |
Date: |
Mon, 19 Feb 2024 15:58:52 -0500 (EST) |
branch: externals/hyperbole
commit 76576017456ddab142c9b141e0bc525e91abe7fb
Author: bw <rsw@gnu.org>
Commit: bw <rsw@gnu.org>
hyrolo-mode-map - bind {n} and {C-c C-n} to the same command
Rename `hyrolo-next-visible-heading' to
`hyrolo-outline-next-visible-heading'
and remove old version of the latter function name.
---
ChangeLog | 5 +++++
hyrolo.el | 60 +++++++++++++++++++++++-----------------------------
test/hyrolo-tests.el | 14 ++++++------
3 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c4c4e97a62..94821e93a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2023-12-30 Bob Weiner <rsw@gnu.org>
+* hyrolo.el (hyrolo-show-levels): Add top-level save-excursion so point does
+ not move.
+ (hyrolo-outline-next-visible-heading): Rename
+ 'hyrolo-next-visible-heading' to this.
+
* FAST-DEMO (Action Buttons): Update to include ert test definition within
the file so do not have to load all of the test files to run the demo.
diff --git a/hyrolo.el b/hyrolo.el
index 2c68bb7374..17396613d6 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 7-Jun-89 at 22:08:29
-;; Last-Mod: 29-Dec-23 at 21:55:32 by Bob Weiner
+;; Last-Mod: 30-Dec-23 at 23:23:18 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1921,15 +1921,6 @@ When found, return the match start position."
t)
(match-beginning 0)))
-(defun hyrolo-next-visible-heading (arg)
- "Move to the next visible heading or match buffer header.
-With ARG, repeats or can move backward if negative.
-
-A heading is one that starts with an `outline-regexp' match.
-A match buffer header is one that starts with `hyrolo-hdr-regexp'."
- (interactive "p")
- (hyrolo-move-forward #'outline-next-visible-heading arg))
-
;;; In `hyrolo-mode' replace `outline-minor-mode' bindings with hyrolo-*
overrides.
;;; Wrap outline movement commands with a `hyrolo-funcall-match' call
;;; Wrap outline whole buffer commands with a `hyrolo-map-matches' call.
@@ -2050,12 +2041,13 @@ This puts point at the start of the current subtree,
and mark at the end."
(hyrolo-funcall-match (lambda () (outline-move-subtree-up arg)) t))
(defun hyrolo-outline-next-visible-heading (arg)
- "Move to the next visible heading line.
+ "Move to the next visible heading or match buffer header.
With ARG, repeats or can move backward if negative.
-A heading line is one that starts with a `*' (or that
-`outline-regexp' matches)."
+
+A heading is one that starts with an `outline-regexp' match.
+A match buffer header is one that starts with `hyrolo-hdr-regexp'."
(interactive "p")
- (hyrolo-funcall-match (lambda () (outline-next-visible-heading arg))))
+ (hyrolo-move-forward #'outline-next-visible-heading arg))
(defun hyrolo-outline-previous-heading ()
"Move to the previous (possibly invisible) heading line."
@@ -2249,7 +2241,7 @@ beginning of the highest ancestor level. Return final
point."
(unless (<= (hyrolo-outline-level) 1)
(outline-up-heading 80)))
(when (hyrolo-hdr-move-after-p)
- (hyrolo-next-visible-heading 1)))
+ (hyrolo-outline-next-visible-heading 1)))
include-sub-entries))
(defun hyrolo-to-entry-end (&optional include-sub-entries)
@@ -2633,23 +2625,24 @@ shown.
Any call to this function should be wrapped in a call to
`hyrolo-map-matches'."
- (hyrolo-verify)
- (outline-show-all)
- (hyrolo-outline-hide-subtree) ;; Ensure reveal-mode does not expand current
entry.
- ;; Use {t} to display top-level cells only.
- (hyrolo-map-matches
- (lambda ()
- (save-excursion
- (save-restriction
- (goto-char (point-min))
- (hyrolo-hdr-move-after-p)
- ;; Prevent collapsing of initial file header
- (narrow-to-region (point) (point-max))
- (let ((max-level-to-show (+ (hyrolo-min-matched-level)
- (1- levels-to-show))))
- (outline-hide-sublevels max-level-to-show)
- (goto-char (point-min))))))
- t))
+ (save-excursion
+ (hyrolo-verify)
+ (outline-show-all)
+ (hyrolo-outline-hide-subtree) ;; Ensure reveal-mode does not expand
current entry.
+ ;; Use {t} to display top-level cells only.
+ (hyrolo-map-matches
+ (lambda ()
+ (save-excursion
+ (save-restriction
+ (goto-char (point-min))
+ (hyrolo-hdr-move-after-p)
+ ;; Prevent collapsing of initial file header
+ (narrow-to-region (point) (point-max))
+ (let ((max-level-to-show (+ (hyrolo-min-matched-level)
+ (1- levels-to-show))))
+ (outline-hide-sublevels max-level-to-show)
+ (goto-char (point-min))))))
+ t)))
(defun hyrolo-shrink-window ()
(let* ((lines (count-lines (point-min) (point-max)))
@@ -2963,7 +2956,7 @@ Add `hyrolo-hdr-regexp' to `hyrolo-hdr-and-entry-regexp'
and `outline-regexp'."
(define-key hyrolo-mode-map "h" 'hyrolo-outline-hide-subtree)
(define-key hyrolo-mode-map "l" 'hyrolo-locate)
(define-key hyrolo-mode-map "m" 'hyrolo-mail-to)
- (define-key hyrolo-mode-map "n" 'hyrolo-next-visible-heading)
+ (define-key hyrolo-mode-map "n" 'hyrolo-outline-next-visible-heading)
(define-key hyrolo-mode-map "o" 'hyrolo-overview)
(define-key hyrolo-mode-map "p"
'hyrolo-outline-previous-visible-heading)
(define-key hyrolo-mode-map "q" 'hyrolo-quit)
@@ -2976,6 +2969,7 @@ Add `hyrolo-hdr-regexp' to `hyrolo-hdr-and-entry-regexp'
and `outline-regexp'."
(define-key hyrolo-mode-map [backtab] 'hyrolo-previous-match) ;; {Shift-TAB}
(define-key hyrolo-mode-map "u" 'hyrolo-outline-up-heading)
+ ;; Rebind all `outline-mode-prefix-map' keys to hyrolo equivalents
(let (otl-cmd-name
hyrolo-cmd-name
hyrolo-cmd)
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index e63b29b63d..68dac7f64f 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: 28-Dec-23 at 22:16:53 by Bob Weiner
+;; Last-Mod: 30-Dec-23 at 23:22:54 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -314,7 +314,7 @@ and {b} the previous same level cell."
(should (string= (buffer-name) hyrolo-display-buffer))
(should (= (how-many "@loc>") 1))
(should (looking-at-p "==="))
- (hyrolo-next-visible-heading 1)
+ (hyrolo-outline-next-visible-heading 1)
(should (looking-at-p "* heading"))
(let ((revisit-normally (concat "y" (if noninteractive " RET"))))
(with-simulated-input revisit-normally
@@ -342,7 +342,7 @@ and {b} the previous same level cell."
(should (string= (buffer-name) hyrolo-display-buffer))
(should (= (how-many "@loc>") 1))
(should (looking-at-p "==="))
- (hyrolo-next-visible-heading 1)
+ (hyrolo-outline-next-visible-heading 1)
(should (looking-at-p ".*1\\. heading"))
(action-key)
(should (equal (current-buffer) (find-buffer-visiting kotl-file)))
@@ -362,7 +362,7 @@ and {b} the previous same level cell."
(should (string= (buffer-name) hyrolo-display-buffer))
(should (= (how-many "@loc>") 1))
(should (looking-at-p "==="))
- (hyrolo-next-visible-heading 1)
+ (hyrolo-outline-next-visible-heading 1)
(should (looking-at-p "* heading"))
(action-key)
(should (equal (current-buffer) (find-buffer-visiting outl-file)))
@@ -382,7 +382,7 @@ and {b} the previous same level cell."
(should (string= (buffer-name) hyrolo-display-buffer))
(should (= (how-many "@loc>") 1))
(should (looking-at-p "==="))
- (hyrolo-next-visible-heading 1)
+ (hyrolo-outline-next-visible-heading 1)
(should (looking-at-p "# heading"))
(action-key)
(should (equal (current-buffer) (find-buffer-visiting md-file)))
@@ -411,7 +411,7 @@ Match a string in a level 2 child cell."
(should (string= (buffer-name) hyrolo-display-buffer))
(should (= (how-many "@loc>") 1))
(should (looking-at-p "==="))
- (hyrolo-next-visible-heading 1)
+ (hyrolo-outline-next-visible-heading 1)
(should (looking-at-p ".*1a\\. heading"))
(action-key)
(should (equal (current-buffer) (find-buffer-visiting kotl-file)))
@@ -440,7 +440,7 @@ Match a string in the second cell."
(should (string= (buffer-name) hyrolo-display-buffer))
(should (= (how-many "@loc>") 1))
(should (looking-at-p "==="))
- (hyrolo-next-visible-heading 1)
+ (hyrolo-outline-next-visible-heading 1)
(should (looking-at-p ".*2\\. heading"))
(action-key)
(should (equal (current-buffer) (find-buffer-visiting kotl-file)))
- [elpa] externals/hyperbole 926f8a02fd 010/143: Fix many hyrolo multi-file-format issues; fix hywconfig by name, (continued)
- [elpa] externals/hyperbole 926f8a02fd 010/143: Fix many hyrolo multi-file-format issues; fix hywconfig by name, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 027eb85174 014/143: Merge matsl-rsw-hpath-expand' into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole a7a5723712 015/143: Fix 'hpath--expand-list-match-regexp' test., ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 54d7ae565a 020/143: Complete test suite for hui:link-possible-types, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 12950cd2db 029/143: Matsl rsw fix failing tests (#424), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 98edfae8d1 021/143: Fix test with link-to-string-match since bug is fixed, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 966605b7a3 028/143: hkey-window-link, {M-o w} - invert the meaning of prefix arg, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7adb441c0e 036/143: kotl-mode - fix kill and yank commands not moving to valid pos first, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 2187b3522b 049/143: Add test for hiding and showing, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole e995fc8905 050/143: Add test for moving between two sections, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7657601745 043/143: hyrolo-mode-map - bind {n} and {C-c C-n} to the same command,
ELPA Syncer <=
- [elpa] externals/hyperbole e67d0f733f 058/143: Fix edebugging of tests that have not been previously defined, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole fc6df9d652 056/143: Merge remote branch 'rsw' into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole acec506a2c 061/143: Require hbut so defib is defined, needed for compiling (#430), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 12e714d824 072/143: Move xref extensions to new "hsys-xref.el". Add ibut API extensions, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole a08fd67af3 057/143: Merge pull request #427 from rswgnu/matsl-rsw-add-hyrolo-tests, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 29dda66c3e 059/143: Merge remote branch 'rsw' of hyperbole into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 19e51dfb0e 009/143: +* hyrolo.el (hyrolo-move-backward, hyrolo-move-forward): Fixes., ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 564c147587 046/143: Add tests for hypb-ert (#429), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 97f4e12386 023/143: hui--link-possible-types - ensure only 1 specific type per test, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole badf1e5281 027/143: Merge remote branch 'rsw' into rsw, ELPA Syncer, 2024/02/19