branch: externals/hyperbole
commit d59f27c469af9ad225bd7f1cf9386773794f9cf0
Author: bw <[email protected]>
Commit: bw <[email protected]>
Fix most remaining outstanding issues in HyRolo, ibut-link-directly
---
ChangeLog | 65 ++++++++++++++++++++-
DEMO | 2 +-
hactypes.el | 9 ++-
hbut.el | 14 ++---
hpath.el | 4 +-
hsys-org.el | 4 +-
hui-mouse.el | 6 +-
hui-select.el | 17 +++---
hui.el | 34 +++++------
hyrolo-logic.el | 136 +++++++++++++++++++++++++++++---------------
hyrolo.el | 163 ++++++++++++++++++++++++++++++++++++++++-------------
man/hyperbole.html | 77 +++++++++++++++++--------
man/hyperbole.info | Bin 618127 -> 619272 bytes
man/hyperbole.pdf | Bin 1372135 -> 1373019 bytes
man/hyperbole.texi | 83 ++++++++++++++++++---------
15 files changed, 431 insertions(+), 183 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3d792debff..9c23b66c46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,68 @@
2023-12-26 Bob Weiner <[email protected]>
+* hpath.el (hpath:to-markup-anchor): If referent-regexp starts with '^', add
+ "[ \t]*" instead of "[ \t]+" to the expression in case it matches the
whole line.
+
+* hui.el (hui:link-possible-types): Change outline heading line link to
trigger only
+ for outline, org and kotl modes when point is anywhere on the heading line.
+ Include non-zero column in pathname so returns to the original point.
Produce a
+ link-to-string-match type.
+ hbut.el (ibut:insert-text): Change 'actypes::link-to-string-match' to use a
pathname
+ format ibut rather than a <link-to-string-match> action button when the
occurrence
+ number is 1.
+
+* hui-select.el (hui-select-scan-sexps): Don't use 'hui-select-syntax-table'
in Lisp
+ modes as its use of matching angle brackets prevents proper sexp selection
when
+ on the opening parentheses of anything with angle brackets inside, e.g. (<
2 3).
+
+* hyrolo-logic.el (hyrolo-fgrep-logical): Fix quoting for Lisp read and regexp
+ operator handling.
+ hyrolo.el (hyrolo-fgrep): Fix to handle 'r-<operator>' regexp logic
operators.
+ man/hyperbole.texi (HyRolo Searching): Add doc for regular expression-based
+ logic operators.
+
+* hyrolo-logic.el (hyrolo-map-logic): Update to handle multi-file formats
+ in 'hyrolo-display-buffer'.
+ (hyrolo-map-entries, hyrolo-map-kotl): Add doc string.
+ (hyrolo-fgrep-logical): Rename arg 'whole-buffer-flag' to
+ 'koutline-flag' to match its purpose. Does not seem to be sent as true
+ anywhere in the existing code base.
+
+* hyrolo.el (hyrolo-hdr-in-p): Add to test if in a HyRolo file header.
+ (hyrolo-hdr-to-first-line-p): Add to move to file header start.
+ (hyrolo-outline-hide-subtree): If point is on a file header in the
+ 'hyrolo-display-buffer', then collapse the entire file from the current
+ end-of-line forward. This makes {h} work within file headers.
+ (hyrolo-hdr-move-after-p): Handle point on single text line between
+ header delimiters.
+ (hyrolo-outline-show-subtree): If point is on a file header in the
+ 'hyrolo-display-buffer', then show/expand the entire file. This makes {s}
+ work within file headers.
+ man/hyperbole.texi (HyRolo Keys): Update to document latest {h} and {s}
behavior.
+ hbut.el (hbut:get-key-src): Call (hyrolo-hdr-move-after-p) so if in a file
+ hdr, backwards search finds its @loc line rather than going to prior one.
+
+* hyrolo.el (hyrolo-outline-level): Fix to return level 1 when on a file header
+ separator or @loc> line.
+ (hyrolo-outline-up-heading): Rewrite and fix to handle edge cases.
+ (hyrolo-name-at-p): Fix to store the current line and col in a text
+ property when possibly hierarchical name is found/used so can jump to the
+ specific line within an entry when editing.
+ (hyrolo-to): Fix to jump to stored current line and col after
finding
+ a possibly hierarchical name in HyRolo.
+
+* man/hyperbole.texi (HyRolo Keys): Update doc for 'hyrolo-edit', {e} key, and
+ how it handles datestamps. Mention 'hyrolo-date-format'.
+
+* hactypes.el (link-to-kcell): Fix to use any source location, e.g. in HyRolo
+ display matches buffer.
+
+* hsys-org.el (hsys-org-agenda-item-at-p):
+ hui-mouse.el (smart-org):
+ man/hyperbole.texi (Smart Key - Org Mode): Update doc to note the context is
+ an Org agenda item within an Org agenda view, not the item in its source
+ context.
+
* test/hy-test-helpers.el (hy-test-helpers:ensure-link-possible-type): Add.
test/hui-tests.el (hui--link-possible-types): Use above function to ensure
'hui:link-possible-types' returns one given type only for each test herein.
@@ -522,7 +585,7 @@
and 'keymap-sym' locally within the function rather than globally
which would affect modes beyond those in 'hui-select-markup-modes'.
(hui-select-goto-matching-delimiter): If the key that
- invokes this command in hyperbole-minor-mode is also bound in the
+ invokes this command in hyperbole's minor-mode is also bound in the
current major mode map, then interactively invoke that command
instead. Typically prevents clashes over {C-c .}. Previously
did this only for 'org-mode' but 'kotl-mode' also has a conflict
diff --git a/DEMO b/DEMO
index b7c684fb97..21a8cc3f9c 100644
--- a/DEMO
+++ b/DEMO
@@ -542,7 +542,7 @@ the Action Key is pressed.
1. If on an Org todo keyword, cycle through the keywords in
that set or if final done keyword, remove it.
- 2. If on an Org agenda item, jump to the item for editing.
+ 2. If on an Org agenda view item, jump to the item for editing.
3. Within a radio or internal target or a link to it, jump between
the target and the first link to it, allowing two-way navigation.
diff --git a/hactypes.el b/hactypes.el
index 5665dcbba1..cad2b42fc5 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 23-Sep-91 at 20:34:36
-;; Last-Mod: 23-Dec-23 at 02:17:41 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 14:19:50 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -562,7 +562,7 @@ on the implicit button to which to link."
"Display FILE with kcell given by CELL-REF at window top.
See documentation for `kcell:ref-to-id' for valid cell-ref formats.
-If FILE is nil, use the current buffer.
+If FILE is nil, use any source location or the current buffer.
If CELL-REF is nil, show the first cell in the view."
(interactive (hargs:iform-read '(interactive "fKotl file to link to:
\n+KKcell to link to: ")))
(require 'kfile)
@@ -581,9 +581,12 @@ If CELL-REF is nil, show the first cell in the view."
(string-empty-p file)
(equal (file-name-nondirectory file)
(file-name-nondirectory buffer-file-name))))
+ (when (or (null file) (string-empty-p file))
+ (setq file (hbut:get-key-src t)))
(if (stringp file)
(hpath:find file)
- (hpath:display-buffer (current-buffer))))
+ ;; file can be a buffer from get-key-src call
+ (hpath:display-buffer (or file (current-buffer)))))
(kotl-mode:goto-cell-ref cell-ref))
(defact link-to-mail (mail-msg-id &optional mail-file)
diff --git a/hbut.el b/hbut.el
index 73a6717736..cf9809d34e 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 18-Sep-91 at 02:57:09
-;; Last-Mod: 25-Dec-23 at 01:59:28 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 23:32:56 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1251,6 +1251,7 @@ is given."
((save-excursion
(save-restriction
(widen)
+ (hyrolo-hdr-move-after-p)
(end-of-visible-line)
(when (and (search-backward hbut:source-prefix
nil t)
(or (memq (preceding-char) '(?\n ?\r))
@@ -2484,11 +2485,6 @@ Summary of operations based on inputs (name arg comes
from \\='hbut:current attr
(ibut:at-p)
(let ((lbl-key (hattr:get 'hbut:current 'lbl-key)))
- ;; (unless lbl-key
- ;; (when (or (and (ibut:set-name-and-label-key-p)
- ;; (hattr:get 'hbut:current 'lbl-key))
- ;; (ibut:at-p)) ;; Sets lbl-key for non-delimited ibtypes
- ;; (setq lbl-key (hattr:get 'hbut:current 'lbl-key))))
(unless (and (stringp lbl-key) (not (string-empty-p lbl-key)))
(hypb:error "(ibut:operate): hbut:current lbl-key must be non-nil")))
@@ -2578,8 +2574,10 @@ Summary of operations based on inputs (name arg comes
from \\='hbut:current attr
;; includes buffer pos that we translate to line:col
(hpath:file-position-to-line-and-column arg1 arg2)))))
('actypes::link-to-string-match
- (insert (format "<%s \"%s\" %d \"%s\">" (actype:def-symbol actype) arg1
arg2
- (hpath:shorten arg3))))
+ (if (= arg2 1)
+ (insert (format "\"%s#%s\"" (hpath:shorten arg3) arg1))
+ (insert (format "<%s \"%s\" %d \"%s\">" (actype:def-symbol actype)
arg1 arg2
+ (hpath:shorten arg3)))))
('nil (error "(ibut:insert-text): actype must be a Hyperbole actype or
Lisp function symbol, not '%s'" orig-actype))
;; Generic action button type
(_ (insert (format "<%s%s%s>" (actype:def-symbol actype) (if args " " "")
diff --git a/hpath.el b/hpath.el
index e22171d80c..0ed3599ea3 100644
--- a/hpath.el
+++ b/hpath.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 1-Nov-91 at 00:44:23
-;; Last-Mod: 17-Dec-23 at 23:01:29 by Mats Lidell
+;; Last-Mod: 26-Dec-23 at 22:42:39 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1624,7 +1624,7 @@ Move point to beginning of buffer if HASH is non-nil and
ANCHOR is null."
(referent-leading-spaces-regexp
(when (and (not (string-empty-p
referent-regexp))
(= (aref referent-regexp 0) ?^))
- (concat "^[ \t]+" (substring
referent-regexp 1)))))
+ (concat "^[ \t]*" (substring
referent-regexp 1)))))
(goto-char (point-min))
(if (or (re-search-forward referent-regexp nil t)
(and referent-leading-spaces-regexp
diff --git a/hsys-org.el b/hsys-org.el
index 5ab09a56b2..2d7bf681bb 100644
--- a/hsys-org.el
+++ b/hsys-org.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 2-Jul-16 at 14:54:14
-;; Last-Mod: 4-Dec-23 at 00:04:31 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 12:05:46 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -267,7 +267,7 @@ Return the (start . end) buffer positions of the region."
(cons start-point (next-single-property-change start-point property)))))
(defun hsys-org-agenda-item-at-p ()
- "Return non-nil if point is on an Org Agenda item line, else nil."
+ "Return non-nil if point is on an Org Agenda view item line, else nil."
(and (derived-mode-p 'org-agenda-mode)
(org-get-at-bol 'org-marker)))
diff --git a/hui-mouse.el b/hui-mouse.el
index 2b7596186c..9315410254 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-89
-;; Last-Mod: 23-Nov-23 at 03:45:24 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 12:06:25 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1737,7 +1737,7 @@ When the Action Key is pressed:
1. If on an Org todo keyword, cycle through the keywords in
that set or if final done keyword, remove it.
- 2. If on an Org agenda item, jump to the item for editing.
+ 2. If on an Org agenda view item, jump to the item for editing.
3. Within a radio or internal target or a link to it, jump between
the target and the first link to it, allowing two-way navigation.
@@ -1767,7 +1767,7 @@ in these contexts:
1. If on an Org todo keyword, move to the first todo keyword in
the next set, if any.
- 2. If on an Org mode link or agenda item, display Hyperbole
+ 2. If on an Org mode link or agenda view item, display Hyperbole
context-sensitive help.
3. On a Hyperbole button, perform the Assist Key function, generally
diff --git a/hui-select.el b/hui-select.el
index 612a7c00ba..a027c9a502 100644
--- a/hui-select.el
+++ b/hui-select.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Oct-96 at 02:25:27
-;; Last-Mod: 30-Nov-23 at 11:33:09 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 21:57:18 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -465,8 +465,10 @@ Also, add language-specific syntax setups to aid in thing
selection."
(defun hui-select-scan-sexps (from count)
"Scan FROM point across COUNT sexpressions."
- (with-syntax-table hui-select-syntax-table
- (scan-sexps from count)))
+ (if (memq major-mode hui-select-ignore-quoted-sexp-modes)
+ (scan-sexps from count)
+ (with-syntax-table hui-select-syntax-table
+ (scan-sexps from count))))
;;;###autoload
(defun hui-select-thing ()
@@ -542,10 +544,9 @@ displayed in the minibuffer."
(defun hui-select-goto-matching-tag ()
"Move point to start of the tag paired with closest tag point is at or
precedes.
Tag in this context is an sgml-like tag surrounded by angle brackets, <>.
-Enabled in major modes in `hui-select-markup-modes'. Returns t if
-point is moved, else nil. Signals an error if no tag is found
-following point or if the closing tag does not have a `>'
-terminator character."
+Enabled in major modes contained in the list, `hui-select-markup-modes'.
+Return t if point is moved, else nil. Signal an error if no tag is found
+following point or if the closing tag does not have a `>' terminator
character."
(interactive)
(when (memq major-mode hui-select-markup-modes)
(let ((result)
@@ -790,7 +791,7 @@ Ignores any match if on an Emacs button and instead returns
nil."
(defun hui-select-delimited-thing ()
"Select a markup pair, list, array/vector, set, comment or string at point.
-Return t is selected, else nil."
+Return t if selected, else nil."
(interactive)
(prog1 (and (hui-select-delimited-thing-call #'hui-select-thing) t)
;; If selected region is followed by only whitespace and then a
diff --git a/hui.el b/hui.el
index 81055fa062..afb711f2c3 100644
--- a/hui.el
+++ b/hui.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Sep-91 at 21:42:03
-;; Last-Mod: 25-Dec-23 at 22:28:16 by Mats Lidell
+;; Last-Mod: 26-Dec-23 at 23:43:32 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1898,29 +1898,29 @@ Buffer without File link-to-buffer-tmp"
(list 'link-to-file val))
((derived-mode-p #'kotl-mode)
(list 'link-to-kcell
buffer-file-name (kcell-view:idstamp)))
- ;; If link is within an
outline-regexp prefix, use
+ ;;
+ ;; If current line starts with an
outline-regexp prefix, use
;; a link-to-string-match.
- ((and (boundp 'outline-regexp)
+ ((and (derived-mode-p 'outline-mode
'org-mode 'kotl-mode)
(stringp outline-regexp)
(save-excursion
- (<= (point)
- (progn
- (beginning-of-line)
- (if (looking-at
outline-regexp)
+ (beginning-of-line)
+ (looking-at outline-regexp)))
+ (let ((heading (string-trim
+
(buffer-substring-no-properties
(match-end 0)
- 0)))))
- (save-excursion
- (let ((heading (string-trim
-
(buffer-substring-no-properties
- (point)
-
(line-end-position))))
- (occur 0))
+
(line-end-position))))
+ (occur 0))
+ (save-excursion
(end-of-line)
(while (and (not (string-empty-p
heading))
(search-backward
heading nil t))
- (setq occur (1+ occur)))
- (list 'link-to-string-match
- heading occur
buffer-file-name))))
+ (setq occur (1+ occur))))
+ (list 'link-to-string-match
+ (if (zerop (current-column))
+ heading
+ (format "%s:L1:C%d"
heading (current-column)))
+ occur buffer-file-name)))
(buffer-file-name
(list 'link-to-file buffer-file-name
(point)))
((derived-mode-p 'dired-mode)
diff --git a/hyrolo-logic.el b/hyrolo-logic.el
index 097efd474a..f96b779fb0 100644
--- a/hyrolo-logic.el
+++ b/hyrolo-logic.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 13-Jun-89 at 22:57:33
-;; Last-Mod: 14-Dec-23 at 00:22:05 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 20:46:10 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -51,7 +51,7 @@
;;
;; (hyrolo-logic (hyrolo-and (hyrolo-not "Tool-And-Die") "secretary"))
;;
-;; would find all non-Tool-And-Die Corp. secretaries in your rolo.
+;; would find all non-Tool-And-Die Corporation secretaries in your rolo.
;;
;; The logical matching routines are not at all optimal, but then most
;; rolo files are not terribly lengthy either, so results are often
@@ -76,7 +76,7 @@
;;;###autoload
(defun hyrolo-fgrep-logical (expr &optional count-only include-sub-entries
no-sub-entries-out
- whole-buffer-flag)
+ koutline-flag)
"Display rolo entries matching EXPR.
EXPR is a string that may contain sexpression logical prefix operators.
If optional COUNT-ONLY is non-nil, don't display entries, return
@@ -85,30 +85,30 @@ flag is non-nil, SEXP will be applied across all
sub-entries at
once. Default is to apply SEXP to each entry and sub-entry
separately. Entries are displayed with all of their sub-entries
unless INCLUDE-SUB-ENTRIES is nil and optional NO-SUB-ENTRIES-OUT
-flag is non-nil.
+flag is non-nil. With optional KOUTLINE-FLAG, map entries with
+`hyrolo-map-kotl' rather than `hyrolo-map-entries'.
A complex example of EXPR might be:
- (and (or (not time card) (xor (and french balloons) spanish)) teacher pet)
+ (and (or (not time card) (xor (and french \"red balloons\") spanish))
teacher pet)
which means:
- Match neither `time' nor `card'
- or
- Match exactly one of (`french' and `balloons') or (`spanish').
+ (Match neither `time' nor `card'
+ or
+ Match exactly one of (`french' and `red balloons') or (`spanish'))
and
- Match `teacher' and `pet'.
+ must include the terms `teacher' as well as `pet' to match.
-Either double quotes or parentheses may be used to group multiple words as a
-single argument."
+Double quotes may be used to group multiple words as a single argument."
(interactive "sLogical rolo search: \nP\nP")
(when (called-interactively-p 'any)
(setq no-sub-entries-out (not no-sub-entries-out)))
(let* ((case-fold-search t)
(total-matches))
- (cond (whole-buffer-flag
+ (cond (koutline-flag
(setq expr (format "(hyrolo-logic (quote %S) nil %s %s %s %s)"
- expr count-only include-sub-entries
+ (read expr) count-only include-sub-entries
no-sub-entries-out t))
(setq total-matches (eval (read expr))))
- ((string-match "\(\\(and\\|or\\|xor\\|not\\)\\>" expr)
+ ((string-match-p "\(\\(r-\\)?\\(and\\|or\\|xor\\|not\\)\\>" expr)
(setq expr (replace-regexp-in-string "\(or " "\(| " expr nil t))
(setq expr (replace-regexp-in-string "\(xor " "\(@ " expr nil t))
(setq expr (replace-regexp-in-string "\(not " "\(! " expr nil t))
@@ -121,14 +121,12 @@ single argument."
(setq expr (replace-regexp-in-string
"\"\\([^\"]*\\)\"" "{\\1}" expr nil nil))
- (setq expr (replace-regexp-in-string
- "\(\\([^@|!&()][^()\"]*\\)\)" "{\\1}" expr nil nil))
(let ((saved-expr expr))
(while
(not (equal
saved-expr
(setq expr (replace-regexp-in-string
- "\\(\\s-\\)\\([^{}()\"
\t\n\r]+\\)\\([^{}()]*[()]\\)"
+ "\\(\\s-\\)\\([^{}()\"
\t\n\r]+\\)\\([^{}()]*\\([()]\\|\\s-\\)\\)"
"\\1\"\\2\"\\3" expr nil nil))))
(setq saved-expr expr)))
(setq expr (replace-regexp-in-string
@@ -144,8 +142,8 @@ single argument."
(setq expr (replace-regexp-in-string "\(r-& " "\(hyrolo-r-and start
end " expr nil t))
(setq expr (format "(hyrolo-logic (quote %S) nil %s %s %s %s)"
- expr count-only include-sub-entries
- no-sub-entries-out whole-buffer-flag))
+ (read expr) count-only include-sub-entries
+ no-sub-entries-out koutline-flag))
(setq total-matches (eval (read expr))))
(t
;; Search string does not contain embedded logic
@@ -159,16 +157,21 @@ single argument."
total-matches))
(defun hyrolo-logic (sexp &optional in-bufs count-only include-sub-entries
no-sub-entries-out
- whole-buffer-flag)
- "Apply SEXP to all entries in optional IN-BUFS.
+ koutline-flag)
+ "Apply SEXP to all entries in optional buffer list, IN-BUFS.
Display entries where SEXP is non-nil.
If IN-BUFS is nil, `hyrolo-file-list' is used. If optional COUNT-ONLY is
non-nil, don't display entries, return count of matching entries only. If
optional INCLUDE-SUB-ENTRIES flag is non-nil, apply SEXP across all sub-entries
at once. Default is to apply SEXP to each entry and sub-entry separately.
Entries are displayed with all of their sub-entries unless INCLUDE-SUB-ENTRIES
-is nil and optional NO-SUB-ENTRIES-OUT flag is non-nil. SEXP should utilize
the
-free variables `start' and `end' as the region on which to operate.
+is nil and optional NO-SUB-ENTRIES-OUT flag is non-nil. With optional
+KOUTLINE-FLAG, map entries with `hyrolo-map-kotl' rather than
+`hyrolo-map-entries'.
+
+SEXP should utilize the free variables `start' and `end' as the region on which
+to operate.
+
Return the number of evaluations of SEXP that match entries."
(let* ((display-buf (unless count-only
(prog1 (hyrolo-set-display-buffer)
@@ -184,7 +187,7 @@ Return the number of evaluations of SEXP that match
entries."
(setq buf-or-file (or (get-buffer buf-or-file)
(funcall hyrolo-find-file-noselect-function
buf-or-file)))
(hyrolo-map-logic sexp buf-or-file count-only include-sub-entries
- no-sub-entries-out whole-buffer-flag))
+ no-sub-entries-out koutline-flag))
(cond ((null in-bufs) (hyrolo-get-file-list))
((listp in-bufs) in-bufs)
((list in-bufs)))))
@@ -196,7 +199,7 @@ Return the number of evaluations of SEXP that match
entries."
(defun hyrolo-map-logic (sexp hyrolo-buf &optional count-only
include-sub-entries _no-sub-entries-out
- whole-buffer-flag)
+ koutline-flag)
"Apply logical SEXP to each entry in HYROLO-BUF.
Write out matching entries to `hyrolo-display-buffer'. If
optional COUNT-ONLY is non-nil, don't display entries, return
@@ -204,13 +207,14 @@ count of matching entries only. If optional
INCLUDE-SUB-ENTRIES
flag is non-nil, apply SEXP across all sub-entries at once.
Default is to apply SEXP to each entry and sub-entry separately.
Entries are displayed with all of their sub-entries unless
-INCLUDE-SUB-ENTRIES is nil and optional NO-SUB-ENTRIES-OUT flag
-is non-nil. With optional WHOLE-BUFFER-FLAG, map entries with
+INCLUDE-SUB-ENTRIES is nil and optional _NO-SUB-ENTRIES-OUT flag
+is non-nil. With optional KOUTLINE-FLAG, map entries with
`hyrolo-map-kotl' rather than `hyrolo-map-entries'.
SEXP should utilize the free variables `start' and `end' as the
-region on which to operate. Return the number of evaluations of
-SEXP that match entries."
+region on which to operate.
+
+Return the number of evaluations of SEXP that match entries."
(setq hyrolo-buf (or (get-buffer hyrolo-buf) hyrolo-buf))
(if (or (bufferp hyrolo-buf)
(when (file-exists-p hyrolo-buf)
@@ -228,7 +232,7 @@ SEXP that match entries."
(when (re-search-forward hyrolo-hdr-regexp nil t 2)
(forward-line)
(setq hdr-pos (cons (point-min) (point))))
- (setq num-found (if whole-buffer-flag
+ (setq num-found (if koutline-flag
(hyrolo-map-kotl
sexp hyrolo-buf display-buf hdr-pos
count-only include-sub-entries)
(hyrolo-map-entries
@@ -242,6 +246,22 @@ SEXP that match entries."
;;
(defun hyrolo-map-entries (sexp hyrolo-buf display-buf hdr-pos &optional
count-only include-sub-entries)
+ "Apply logical SEXP to each entry in HYROLO-BUF.
+Write out matching entries to DISPLAY-BUF. HDR-POS is a cons of
+\(start . end) positions of HYROLO-BUF's file header, if any;
+otherwise, nil.
+
+If optional COUNT-ONLY is non-nil, don't display entries, return
+count of matching entries only. If optional INCLUDE-SUB-ENTRIES
+flag is non-nil, apply SEXP across all sub-entries at once.
+Default is to apply SEXP to each entry and sub-entry separately.
+Entries are displayed with all of their sub-entries unless
+INCLUDE-SUB-ENTRIES is nil.
+
+SEXP should utilize the free variables `start' and `end' as the
+region on which to operate.
+
+Return the number of evaluations of SEXP that match entries."
(let* ((start)
(end)
(end-entry-hdr)
@@ -281,6 +301,22 @@ SEXP that match entries."
num-found))
(defun hyrolo-map-kotl (sexp hyrolo-buf display-buf hdr-pos &optional
count-only include-sub-entries)
+ "Apply logical SEXP to each entry in HYROLO-BUF.
+Write out matching entries to DISPLAY-BUF. HDR-POS is a cons of
+\(start . end) positions of HYROLO-BUF's file header, if any;
+otherwise, nil.
+
+If optional COUNT-ONLY is non-nil, don't display entries, return
+count of matching entries only. If optional INCLUDE-SUB-ENTRIES
+flag is non-nil, apply SEXP across all sub-entries at once.
+Default is to apply SEXP to each entry and sub-entry separately.
+Entries are displayed with all of their sub-entries unless
+INCLUDE-SUB-ENTRIES is nil.
+
+SEXP should utilize the free variables `start' and `end' as the
+region on which to operate.
+
+Return the number of evaluations of SEXP that match entries."
(let* ((start)
(end)
(end-entry-hdr)
@@ -325,8 +361,9 @@ SEXP that match entries."
;; Send them as parts of an expression to `hyrolo-logic'.
(defun hyrolo-not (start end &rest pat-list)
- "Logical <not> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a string."
+ "Logical <not> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+string."
(save-restriction
(narrow-to-region start end)
(let ((pat))
@@ -339,8 +376,9 @@ Each element may be t, nil, or a string."
(not pat-list))))
(defun hyrolo-or (start end &rest pat-list)
- "Logical <or> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a string."
+ "Logical <or> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+string."
(if (memq t pat-list)
t
(save-restriction
@@ -355,8 +393,9 @@ Each element may be t, nil, or a string."
(if pat-list t nil)))))
(defun hyrolo-xor (start end &rest pat-list)
- "Logical <xor> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a string."
+ "Logical <xor> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+string."
(save-restriction
(narrow-to-region start end)
(let ((pat)
@@ -373,8 +412,9 @@ Each element may be t, nil, or a string."
(= matches 1))))
(defun hyrolo-and (start end &rest pat-list)
- "Logical <and> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a string."
+ "Logical <and> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+string."
(unless (memq nil pat-list)
(save-restriction
(narrow-to-region start end)
@@ -390,8 +430,9 @@ Each element may be t, nil, or a string."
;; Work with regular expression patterns rather than strings
(defun hyrolo-r-not (start end &rest pat-list)
- "Logical <not> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a regular expression."
+ "Logical <not> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+regular expression."
(save-restriction
(narrow-to-region start end)
(let ((pat))
@@ -404,8 +445,9 @@ Each element may be t, nil, or a regular expression."
(not pat-list))))
(defun hyrolo-r-or (start end &rest pat-list)
- "Logical <or> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a regular expression."
+ "Logical <or> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+regular expression."
(if (memq t pat-list)
t
(save-restriction
@@ -420,8 +462,9 @@ Each element may be t, nil, or a regular expression."
(if pat-list t nil)))))
(defun hyrolo-r-xor (start end &rest pat-list)
- "Logical <xor> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a regular expression."
+ "Logical <xor> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+regular expression."
(save-restriction
(narrow-to-region start end)
(let ((pat)
@@ -438,8 +481,9 @@ Each element may be t, nil, or a regular expression."
(= matches 1))))
(defun hyrolo-r-and (start end &rest pat-list)
- "Logical <and> rolo entry filter. PAT-LIST is a list of pattern elements.
-Each element may be t, nil, or a regular expression."
+ "Logical <and> rolo entry filter applied between START and END positions.
+PAT-LIST is a list of pattern elements. Each element may be t, nil, or a
+regular expression."
(unless (memq nil pat-list)
(save-restriction
(narrow-to-region start end)
diff --git a/hyrolo.el b/hyrolo.el
index 8b9866f41f..e2ae608772 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: 26-Dec-23 at 01:45:22 by Bob Weiner
+;; Last-Mod: 26-Dec-23 at 22:03:08 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -646,7 +646,7 @@ the logical sexpression matching."
(interactive "sFind rolo string (or logical sexpression): \nP")
(setq string (string-trim string "\"" "\""))
(let ((total-matches 0))
- (if (string-match "\(\\(and\\|or\\|xor\\|not\\)\\>" string)
+ (if (string-match-p "\(\\(r-\\)?\\(and\\|or\\|xor\\|not\\)\\>" string)
(progn
;; Search string contains embedded logic operators.
;; First try to match logical sexpression within a single
@@ -804,9 +804,8 @@ With optional prefix ARG, do an fgrep string match instead
of a regexp match."
(defun hyrolo-isearch (&optional arg)
"Interactively search forward for the next occurrence of current match
string.
-Then add characters to further narrow the search. With optional
-prefix ARG non-nil, search for the current match regular
-expression rather than string."
+Then add characters to further narrow the search. With optional prefix ARG
+non-nil, search for the current match regular expression rather than string."
(interactive "P")
(if arg
(hyrolo-isearch-for-regexp hyrolo-match-regexp t)
@@ -820,9 +819,8 @@ expression rather than string."
(defun hyrolo-isearch-regexp (&optional arg)
"Interactively search forward for the next occurrence of current match
string.
-Then add characters to further narrow the search. With optional
-prefix ARG non-nil, search for the current match regular
-expression rather than string."
+Then add characters to further narrow the search. With optional prefix ARG
+non-nil, search for the current match regular expression rather than string."
(interactive "P")
(if arg
(hyrolo-isearch-for-regexp hyrolo-match-regexp t)
@@ -1604,8 +1602,18 @@ Stop at the first and last subheadings of a superior
heading."
(interactive "p")
(hyrolo-move-forward #'outline-forward-same-level arg))
+(defun hyrolo-hdr-to-first-line-p ()
+ "If point is on a file hdr single text/sep/loc line, go to its first line.
+Return t in such cases. Otherwise, don't move and return nil.
+
+The header includes lines matching both `hyrolo-hdr-regexp' and
+`hbut:source-prefix'."
+ (when (and (hyrolo-hdr-move-after-p)
+ (re-search-backward hyrolo-hdr-regexp nil t 2))
+ t))
+
(defun hyrolo-hdr-to-last-line-p ()
- "If point is on a file hdr separator/loc line, move to start of its last
line.
+ "If point is on a file hdr single text/sep/loc line, go to its last line.
Return t in such cases. Otherwise, don't move and return nil.
The header includes lines matching both `hyrolo-hdr-regexp' and
@@ -1614,6 +1622,10 @@ The header includes lines matching both
`hyrolo-hdr-regexp' and
(forward-line -1)
t))
+(defun hyrolo-hdr-in-p ()
+ "If point is on a file hdr single text/separator/loc line, return t, else
nil."
+ (save-excursion (hyrolo-hdr-move-after-p)))
+
(defun hyrolo-hdr-move-after-p ()
"If point is on a file hdr separator/loc line, move past the hdr and return
t.
Otherwise, don't move and return nil."
@@ -1625,6 +1637,13 @@ Otherwise, don't move and return nil."
(or (when (looking-at hyrolo-hdr-regexp)
(cl-incf hdr-delim-count))
(when (looking-at hbut:source-prefix)
+ (cl-incf loc-count))
+ ;; Handle textual single line between header delimiter lines
+ (when (and (forward-line -1)
+ (looking-at hyrolo-hdr-regexp)
+ (forward-line 2)
+ (looking-at hyrolo-hdr-regexp))
+ (forward-line -1)
(cl-incf loc-count))))
(forward-line 1))
(when (and (/= (point) opoint) (< hdr-delim-count 2) (zerop loc-count))
@@ -1985,20 +2004,29 @@ of the current heading, or to 1 if the current line is
not a heading."
(defun hyrolo-outline-hide-subtree ()
"Move back to the start of current subtree and hide everything after the
heading.
+If within a file header, hide the whole file after the end of the current line.
Necessary, since with reveal-mode active, outline-hide-subtree works
only if on the heading line of the subtree."
(interactive)
- (hyrolo-funcall-match
- (lambda ()
- (let ((opoint (point)))
- (forward-line 0)
- (unless (looking-at outline-regexp)
- (outline-previous-visible-heading 1))
- (if (looking-at outline-regexp)
- (outline-hide-subtree)
- (goto-char opoint))))
- t))
+ (if (and (hyrolo-hdr-in-p)
+ (eq (current-buffer) (get-buffer hyrolo-display-buffer)))
+ (cl-destructuring-bind (start end)
+ (hyrolo-cache-location-start-and-end)
+ (setq start (line-end-position)
+ end (1- (or end (point-max))))
+ ;; Hide region
+ (outline-flag-region start end t))
+ (hyrolo-funcall-match
+ (lambda ()
+ (let ((opoint (point)))
+ (forward-line 0)
+ (unless (looking-at outline-regexp)
+ (outline-previous-visible-heading 1))
+ (if (looking-at outline-regexp)
+ (outline-hide-subtree)
+ (goto-char opoint))))
+ t)))
(defun hyrolo-outline-insert-heading ()
"Insert a new heading at same depth at point."
@@ -2075,24 +2103,60 @@ Show the heading too, if it is currently invisible."
(hyrolo-funcall-match #'outline-show-entry t))
(defun hyrolo-outline-show-subtree ()
- "Show everything after this heading at deeper levels."
+ "Show everything after this heading at deeper levels.
+If within a file header, show the whole file starting with the header."
(interactive)
- (hyrolo-funcall-match #'outline-show-subtree t))
+ (if (and (hyrolo-hdr-in-p)
+ (eq (current-buffer) (get-buffer hyrolo-display-buffer)))
+ (cl-destructuring-bind (start end)
+ (hyrolo-cache-location-start-and-end)
+ (setq start (or start (line-beginning-position))
+ end (1- (or end (point-max))))
+ ;; Hide region
+ (outline-flag-region start end nil))
+ (hyrolo-funcall-match #'outline-show-subtree t)))
(defun hyrolo-outline-up-heading (arg &optional invisible-ok)
"Move to the visible heading line of which the present line is a subheading.
With argument, move up ARG levels.
If INVISIBLE-OK is non-nil, also consider invisible lines."
(interactive "p")
- (hyrolo-move-backward #'outline-up-heading arg invisible-ok))
+ (hyrolo-funcall-match
+ (lambda ()
+ (and (eq this-command 'hyrolo-outline-up-heading)
+ (or (eq last-command 'hyrolo-outline-up-heading) (push-mark)))
+ (outline-back-to-heading invisible-ok)
+ (let ((start-level (funcall outline-level))
+ (start-point (point)))
+ (when (<= start-level 1)
+ (error "Already at top level of this outline tree"))
+ (while (and (> start-level 1) (> arg 0) (not (bobp)))
+ (let ((level start-level)
+ (opoint (point)))
+ (while (not (or (< level start-level) (bobp)))
+ (if invisible-ok
+ (outline-previous-heading)
+ (outline-previous-visible-heading 1))
+ (setq level (funcall outline-level))
+ (when (not (looking-at hyrolo-entry-regexp))
+ ;; Have moved into a file header; move back to opoint and stop
+ (goto-char opoint)
+ ;; Exit
+ (when (= opoint start-point)
+ (error "Already at top level of this outline tree"))
+ (setq level -1)))
+ (setq start-level level))
+ (setq arg (- arg 1))))
+ (looking-at outline-regexp))
+ t))
(defun hyrolo-to (name &optional file-or-buf-list)
"Move point to entry for NAME within optional FILE-OR-BUF-LIST.
\(hyrolo-get-file-or-buf-list) provides the default when
-FILE-OR-BUF-LIST is nil. Leave point immediately after match for
-NAME within an entry. Switches internal current buffer but does
-not alter the frame. Return point where matching entry begins or
-nil if not found."
+FILE-OR-BUF-LIST is nil. Leave point immediately after the first
+match of NAME within an entry. Switches internal current buffer
+but does not alter the frame. Return point where matching entry
+begins or nil if not found."
(when (or (not (stringp name)) (string-blank-p name))
(error "(hyrolo-to): Invalid name: `%s'" name))
(unless file-or-buf-list
@@ -2115,13 +2179,14 @@ nil if not found."
(or (get-file-buffer file-or-buf)
(hyrolo-find-file-noselect file-or-buf))
;; must be a buffer
file-or-buf))
- (let ((case-fold-search t) (real-name name) (parent "") (level) end)
+ (let ((case-fold-search t) (real-name name) (parent "") (level)
+ col-num end line line-and-col)
(hyrolo-widen)
(goto-char (point-min))
- (if (get-text-property 0 'hyrolo-line-entry name)
+ (if (setq col-num (get-text-property 0 'hyrolo-line-entry name))
;; this is a whole line to find without any entry delimiters
(when (search-forward name nil t)
- (forward-line 0)
+ (move-to-column col-num)
(setq found (point)))
(while (string-match "\\`[^\]\[<>{}\"]*/" name)
(setq end (1- (match-end 0))
@@ -2158,6 +2223,12 @@ nil if not found."
;; Jump to non-first line within an
entry
(progn (back-to-indentation)
(looking-at (regexp-quote
name))))
+ (when (setq line-and-col (get-text-property 0
'hyrolo-name-entry name))
+ ;; this is a whole line to find except for
leading whitespace
+ (setq line (car line-and-col)
+ col-num (cdr line-and-col))
+ (when (search-forward line nil t)
+ (move-to-column col-num)))
(when (derived-mode-p 'kotl-mode)
(kotl-mode:to-valid-position))
(point)))))))))
@@ -2429,11 +2500,15 @@ Name is returned as `last, first-and-middle'."
"Iff point is at or within an entry in `hyrolo-display-buffer', return
non-nil.
Any non-nil value returned is a cons of (<entry-name> . <entry-source>)."
(let ((entry-source (hbut:get-key-src t))
- (opoint (point)))
+ (col-num (current-column))
+ (line-start (line-beginning-position))
+ (line-end (line-end-position)))
(when entry-source
(save-excursion
(forward-line 0)
- (let (case-fold-search)
+ (let (case-fold-search
+ entry-line
+ entry-name)
(if (and (or (looking-at hyrolo-hdr-and-entry-regexp)
(re-search-backward hyrolo-hdr-and-entry-regexp nil t))
(save-match-data (not (looking-at hyrolo-hdr-regexp))))
@@ -2441,17 +2516,21 @@ Any non-nil value returned is a cons of (<entry-name> .
<entry-source>)."
(skip-chars-forward " \t")
(when (or (looking-at "[^ \t\n\r]+ ?, ?[^ \t\n\r]+")
(looking-at "\\( ?[^ \t\n\r]+\\)+"))
- (cons (match-string-no-properties 0) entry-source)))
+ (setq entry-name (match-string-no-properties 0)
+ entry-line (buffer-substring-no-properties
line-start line-end))
+ ;; Add a text-property of 'hyrolo-name-entry with
+ ;; value of (entry-line . current-column) to entry-name.
+ (put-text-property 0 1 'hyrolo-name-entry
+ (cons entry-line col-num)
+ entry-name)
+ (cons entry-name entry-source)))
;; If not blank, return the current line as the name with
- ;; a text-property of 'hyrolo-line-entry with value t.
- (goto-char opoint)
- (forward-line 0)
+ ;; a text-property of 'hyrolo-line-entry with value of
(current-column).
+ (goto-char line-start)
(when (not (looking-at "[ \t\f]*$"))
- (let* ((line-start (point))
- (line-end (line-end-position))
- (entry-name (buffer-substring line-start line-end)))
- (put-text-property 0 1 'hyrolo-line-entry t entry-name)
- (cons entry-name entry-source)))))))))
+ (setq entry-line (buffer-substring-no-properties line-start
line-end))
+ (put-text-property 0 1 'hyrolo-line-entry col-num entry-line)
+ (cons entry-line entry-source))))))))
(define-derived-mode hyrolo-org-mode outline-mode "HyRoloOrg"
"Basic Org mode for use in HyRolo display match searches."
@@ -2631,6 +2710,8 @@ trailing periods and whitespace.
Point must be at the beginning of a heading line and a regexp match to
`outline-regexp' must have been done prior to calling this."
(or (cdr (assoc (match-string-no-properties 0) outline-heading-alist))
+ (when (looking-at-p hyrolo-hdr-regexp) 1)
+ (when (looking-at-p hbut:source-prefix) 1)
(1- (- (match-end 0) (match-beginning 0)))))
;;; ************************************************************************
@@ -2901,6 +2982,8 @@ Add `hyrolo-hdr-regexp' to `hyrolo-hdr-and-entry-regexp'
and `outline-regexp'."
outline-mode-prefix-map)))
;;; Integrate reveal-mode with HyRolo.
+;;; NOTE: !! TODO: This does not yet work so is not enabled in `hyrolo-mode'
yet,
+;;; thus the `reveal-post-command' below is not yet used.
;; Note that `outline-reveal-toggle-invisible' is the function
;; stored in the `outline' `reveal-toggle-invisible' property. It
diff --git a/man/hyperbole.html b/man/hyperbole.html
index 027b53f4d2..1b83abf2bf 100644
--- a/man/hyperbole.html
+++ b/man/hyperbole.html
@@ -382,7 +382,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
<PRE>
Edition 9.0.0
-Printed December 25, 2023.
+Printed December 26, 2023.
Published by the Free Software Foundation, Inc.
Author: Bob Weiner
@@ -2983,7 +2983,7 @@ Key is pressed:
<li> If on an Org todo keyword, cycle through the keywords in
that set or if final done keyword, remove it.
-</li><li> If on an Org agenda item, jump to the item for editing.
+</li><li> If on an Org agenda view item, jump to the item for editing.
</li><li> Within a radio or internal target or a link to it, jump between
the target and the first link to it, allowing two-way navigation.
@@ -3015,7 +3015,7 @@ except in these contexts:
<li> If on an Org todo keyword, move to the first todo keyword in
the next set, if any.
-</li><li> If on an Org mode link or agenda item, display Hyperbole
+</li><li> If on an Org mode link or agenda view item, display Hyperbole
context-sensitive help.
</li><li> On a Hyperbole button, performs the Assist Key function, generally
@@ -7374,12 +7374,17 @@ simple parenthesis delimited prefix format is used with
the following
logical operators.
</p>
<div class="example">
-<pre class="example">Operator Name Number of Arguments Description
+<pre class="example">Operator Name Num of Args Description
=====================================================================
-and two or more Match entries with all args
-or two or more Match entries with any args
-xor two or more Match entries with 1 arg only
-not one Match entries without the arg
+and two or more Match entries with all str args
+or two or more Match entries with any str args
+xor two or more Match entries with exactly 1 str arg
+not one Match entries without the str arg
+
+r-and two or more Match entries with all regexp args
+r-or two or more Match entries with any regexp args
+r-xor two or more Match entries with exactly 1 regexp arg
+r-not one Match entries without the regexp arg
=====================================================================
</pre></div>
@@ -7400,10 +7405,22 @@ the 408 area code have been contacted and you want to
see who else
you should contact.
</p>
<div class="example">
-<pre class="example">(xor 408- client)
+<pre class="example">(xor client 408- )
</pre></div>
+<p>When using the regular expression operators, your operands are sent as
+regular expressions without the need to quote single words or
+special regular expression characters like ’*’ and
’?’. Use double
+quote marks to include a phrase or multi-word regular expression pattern
+to match. For example:
+</p>
+<div class="example">
+<pre class="example">(r-and HyRolo "Red Buttons?")
+</pre></div>
+<p>would match entries that contain both "HyRolo" and either
"Red Button" or
+"Red Buttons".
+</p>
<hr>
<a name="HyRolo-Keys"></a>
<div class="header">
@@ -7483,12 +7500,18 @@ will work.
<a name="index-rolo_002c-auto_002dexpanding-entries"></a>
<a name="index-rolo_002c-hiding-entries"></a>
<a name="index-rolo_002c-showing-entries"></a>
-<p>Press <kbd>{s}</kbd> to show (expand) the entry at point. Use
<kbd>{h}</kbd> to hide
-(collapse) the entry. Press <kbd>{a}</kbd> to expand all entries in the
-buffer. If an entry is collapsed/hidden, moving to any hidden part
-auto-expands it and then re-collapses it when point is moved to another
-entry (just like isearch). A side-effect of this is that the <kbd>{h}</kbd>
-hide entry subtree command now moves to the beginning of the entry.
+<p>Press <kbd>{s}</kbd> to show (expand) the entry at point if it is hidden
+(collapsed). If point is on a file header, this will expand the header
+and show the entire set of matched entries for the file. The <kbd>{h}</kbd>
+does the reverse and hides entries. Within file headers it hides the
+file from the end of the current line forward, so you can leave parts of
+the header displayed, if desired. Press <kbd>{a}</kbd> to expand all entries
+in the buffer across all matched files.
+</p>
+
+<p>Please note that to facilitate further use of movement by entry commands,
+the <kbd>{h}</kbd> hide entry subtree command leaves point at the beginning of
+the entry (does not apply in file headers).
</p>
<p>Other keys are defined to help you work with matching entries.
</p>
@@ -7567,6 +7590,7 @@ move to the end of the entire subtree.
<a name="index-rolo_002c-e"></a>
<a name="index-rolo_002c-editing"></a>
<a name="index-datestamps"></a>
+<a name="index-date-format"></a>
<a name="index-rolo_002c-datestamps"></a>
<a name="index-customize_002c-rolo-datestamps"></a>
<a name="index-menu-item_002c-Rolo_002fToggle_002dRolo_002dDates"></a>
@@ -7574,14 +7598,15 @@ move to the end of the entire subtree.
<a name="index-customize_002c-rolo-additions"></a>
<a name="index-hyrolo_002dedit_002dhook"></a>
<a name="index-hyrolo_002dadd_002dhook"></a>
-<p>Use the <kbd>{e}</kbd> key to edit the current entry within your personal
-rolo file. A datestamp will automatically be added or updated at the end
-of the entry, unless this feature has been turned off via the
+<a name="index-hyrolo_002ddate_002dformat"></a>
+<p>Use the <kbd>{e}</kbd> key to jump to and edit the current line in its
original
+source file. If on a rolo entry and it contains a datestamp at its end,
+update the datestamp, unless this feature has been turned off via the
Cust/Toggle-Rolo-Dates menu item. The variable, <code>hyrolo-edit-hook</code>,
-is evaluated after the update of the entry datestamp. This allows
-programmed modification of the way rolo edits work. The variable,
-<code>hyrolo-add-hook</code>, works the same way but is evaluated when a new
-entry is first added.
+performs this update. This allows programmed modification of the way
+rolo edits work. The variable, <code>hyrolo-add-hook</code>, works the same
+way but is evaluated when a new entry is first added. The format of the
+datestamp is specified by <code>hyrolo-date-format</code>.
</p>
<a name="index-rolo_002c-q"></a>
<a name="index-rolo_002c-quitting"></a>
@@ -11662,7 +11687,7 @@ Next: <a href="#Smart-Key-_002d-Ivy" accesskey="n"
rel="next">Smart Key - Ivy</a
(1) If on an Org todo keyword, cycle through the keywords in
that set or if final done keyword, remove it.
- (2) If on an Org agenda item, jump to the item for editing.
+ (2) If on an Org agenda view item, jump to the item for editing.
(3) Within a radio or internal target or a link to it, jump between
the target and the first link to it, allowing two-way navigation.
@@ -11694,8 +11719,8 @@ Next: <a href="#Smart-Key-_002d-Ivy" accesskey="n"
rel="next">Smart Key - Ivy</a
(1) If on an Org todo keyword, move to the first todo keyword in
the next set, if any.
- (2) If on an Org mode link, ID reference or agenda item, display Hyperbole
- context-sensitive help.
+ (2) If on an Org mode link, ID reference or agenda view item, display
+ Hyperbole context-sensitive help.
(3) On a Hyperbole button, perform the Assist Key function, generally
showing help for the button.
@@ -14563,6 +14588,7 @@ Next: <a href="#Concept-Index" accesskey="n"
rel="next">Concept Index</a>, Previ
<tr><td></td><td valign="top"><a
href="#index-hyrolo_002dadd_002dhook">hyrolo-add-hook</a>:</td><td> </td><td
valign="top"><a href="#HyRolo-Keys">HyRolo Keys</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hyrolo_002dadd_002dhook-1">hyrolo-add-hook</a>:</td><td> </td><td
valign="top"><a href="#Hook-Variables">Hook Variables</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hyrolo_002dconsult_002dgrep"><code>hyrolo-consult-grep</code></a>:</td><td> </td><td
valign="top"><a href="#HyRolo-Menu">HyRolo Menu</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-hyrolo_002ddate_002dformat">hyrolo-date-format</a>:</td><td> </td><td
valign="top"><a href="#HyRolo-Keys">HyRolo Keys</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hyrolo_002ddisplay_002dformat_002dfunction">hyrolo-display-format-function</a>:</td><td> </td><td
valign="top"><a href="#HyRolo-Settings">HyRolo Settings</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hyrolo_002ddisplay_002dhook">hyrolo-display-hook</a>:</td><td> </td><td
valign="top"><a href="#Hook-Variables">Hook Variables</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hyrolo_002ddisplay_002dmatches"><code>hyrolo-display-matches</code></a>:</td><td> </td><td
valign="top"><a href="#HyRolo-Menu">HyRolo Menu</a></td></tr>
@@ -15206,6 +15232,7 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function</a>, Up: <a href
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Concept-Index_cp_letter-D">D</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a
href="#index-database">database</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-_002d-RDB-Mode">Smart Key - RDB Mode</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-date-format">date
format</a>:</td><td> </td><td valign="top"><a href="#HyRolo-Keys">HyRolo
Keys</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-datestamps">datestamps</a>:</td><td> </td><td valign="top"><a
href="#HyRolo-Keys">HyRolo Keys</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-dbx">dbx</a>:</td><td> </td><td valign="top"><a
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-debugging-Smart-Keys">debugging
Smart Keys</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-Debugging">Smart Key Debugging</a></td></tr>
diff --git a/man/hyperbole.info b/man/hyperbole.info
index 8d541e8b06..bee0e06c60 100644
Binary files a/man/hyperbole.info and b/man/hyperbole.info differ
diff --git a/man/hyperbole.pdf b/man/hyperbole.pdf
index 607290901b..8ce9cace0f 100644
Binary files a/man/hyperbole.pdf and b/man/hyperbole.pdf differ
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index e94569e7f2..1c763c438c 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -7,7 +7,7 @@
@c Author: Bob Weiner
@c
@c Orig-Date: 6-Nov-91 at 11:18:03
-@c Last-Mod: 25-Dec-23 at 22:39:22 by Bob Weiner
+@c Last-Mod: 26-Dec-23 at 20:39:20 by Bob Weiner
@c %**start of header (This is for running Texinfo on a region.)
@setfilename hyperbole.info
@@ -156,7 +156,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
<PRE>
Edition 9.0.0
-Printed December 25, 2023.
+Printed December 26, 2023.
Published by the Free Software Foundation, Inc.
Author: Bob Weiner
@@ -198,7 +198,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@example
Edition 9.0.0
-December 25, 2023
+December 26, 2023
Published by the Free Software Foundation, Inc.
Author: Bob Weiner
@@ -2302,7 +2302,7 @@ If on an Org todo keyword, cycle through the keywords in
that set or if final done keyword, remove it.
@item
-If on an Org agenda item, jump to the item for editing.
+If on an Org agenda view item, jump to the item for editing.
@item
Within a radio or internal target or a link to it, jump between
@@ -2345,7 +2345,7 @@ If on an Org todo keyword, move to the first todo keyword
in
the next set, if any.
@item
-If on an Org mode link or agenda item, display Hyperbole
+If on an Org mode link or agenda view item, display Hyperbole
context-sensitive help.
@item
@@ -6183,12 +6183,17 @@ logical operators.
@example
@group
-Operator Name Number of Arguments Description
+Operator Name Num of Args Description
=====================================================================
-and two or more Match entries with all args
-or two or more Match entries with any args
-xor two or more Match entries with 1 arg only
-not one Match entries without the arg
+and two or more Match entries with all str args
+or two or more Match entries with any str args
+xor two or more Match entries with exactly 1 str arg
+not one Match entries without the str arg
+
+r-and two or more Match entries with all regexp args
+r-or two or more Match entries with any regexp args
+r-xor two or more Match entries with exactly 1 regexp arg
+r-not one Match entries without the regexp arg
=====================================================================
@end group
@end example
@@ -6212,9 +6217,22 @@ the 408 area code have been contacted and you want to
see who else
you should contact.
@example
-(xor 408- client)
+(xor client 408- )
@end example
+When using the regular expression operators, your operands are sent as
+regular expressions without the need to quote single words or
+special regular expression characters like '*' and '?'. Use double
+quote marks to include a phrase or multi-word regular expression pattern
+to match. For example:
+
+@example
+(r-and HyRolo "Red Buttons?")
+@end example
+
+@noindent
+would match entries that contain both "HyRolo" and either "Red Button" or
+"Red Buttons".
@node HyRolo Keys, HyRolo Settings, HyRolo Searching, HyRolo
@section HyRolo Keys
@@ -6289,12 +6307,21 @@ will work.
@cindex rolo, auto-expanding entries
@cindex rolo, hiding entries
@cindex rolo, showing entries
-Press @bkbd{s} to show (expand) the entry at point. Use @bkbd{h} to hide
-(collapse) the entry. Press @bkbd{a} to expand all entries in the
-buffer. If an entry is collapsed/hidden, moving to any hidden part
-auto-expands it and then re-collapses it when point is moved to another
-entry (just like isearch). A side-effect of this is that the @bkbd{h}
-hide entry subtree command now moves to the beginning of the entry.
+Press @bkbd{s} to show (expand) the entry at point if it is hidden
+(collapsed). If point is on a file header, this will expand the header
+and show the entire set of matched entries for the file. The @bkbd{h}
+does the reverse and hides entries. Within file headers it hides the
+file from the end of the current line forward, so you can leave parts of
+the header displayed, if desired. Press @bkbd{a} to expand all entries
+in the buffer across all matched files.
+
+@c If an entry is collapsed/hidden, moving to any hidden part auto-expands
+@c it and then re-collapses it when point is moved to another entry (just
+@c like isearch).
+
+Please note that to facilitate further use of movement by entry commands,
+the @bkbd{h} hide entry subtree command leaves point at the beginning of
+the entry (does not apply in file headers).
@noindent
Other keys are defined to help you work with matching entries.
@@ -6347,6 +6374,7 @@ Scroll forward a windowful.
@kindex rolo, e
@cindex rolo, editing
@cindex datestamps
+@cindex date format
@cindex rolo, datestamps
@cindex customize, rolo datestamps
@cindex menu item, Rolo/Toggle-Rolo-Dates
@@ -6354,14 +6382,15 @@ Scroll forward a windowful.
@cindex customize, rolo additions
@vindex hyrolo-edit-hook
@vindex hyrolo-add-hook
-Use the @bkbd{e} key to edit the current entry within your personal
-rolo file. A datestamp will automatically be added or updated at the end
-of the entry, unless this feature has been turned off via the
+@vindex hyrolo-date-format
+Use the @bkbd{e} key to jump to and edit the current line in its original
+source file. If on a rolo entry and it contains a datestamp at its end,
+update the datestamp, unless this feature has been turned off via the
Cust/Toggle-Rolo-Dates menu item. The variable, @code{hyrolo-edit-hook},
-is evaluated after the update of the entry datestamp. This allows
-programmed modification of the way rolo edits work. The variable,
-@code{hyrolo-add-hook}, works the same way but is evaluated when a new
-entry is first added.
+performs this update. This allows programmed modification of the way
+rolo edits work. The variable, @code{hyrolo-add-hook}, works the same
+way but is evaluated when a new entry is first added. The format of the
+datestamp is specified by @code{hyrolo-date-format}.
@kindex rolo, q
@cindex rolo, quitting
@@ -9834,7 +9863,7 @@ When in an Org mode context and
@code{hsys-org-enable-smart-keys} is non-nil:
(1) If on an Org todo keyword, cycle through the keywords in
that set or if final done keyword, remove it.
- (2) If on an Org agenda item, jump to the item for editing.
+ (2) If on an Org agenda view item, jump to the item for editing.
(3) Within a radio or internal target or a link to it, jump between
the target and the first link to it, allowing two-way navigation.
@@ -9868,8 +9897,8 @@ When in an Org mode context and
@code{hsys-org-enable-smart-keys} is non-nil:
(1) If on an Org todo keyword, move to the first todo keyword in
the next set, if any.
- (2) If on an Org mode link, ID reference or agenda item, display Hyperbole
- context-sensitive help.
+ (2) If on an Org mode link, ID reference or agenda view item, display
+ Hyperbole context-sensitive help.
(3) On a Hyperbole button, perform the Assist Key function, generally
showing help for the button.