[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 7e7b3296d2 1/2: smart-org - Add Org tag suppo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 7e7b3296d2 1/2: smart-org - Add Org tag support via agenda and consult-grep searches |
Date: |
Sun, 7 Jul 2024 09:58:29 -0400 (EDT) |
branch: externals/hyperbole
commit 7e7b3296d24d23e5a7c637dbaeadfb7fecb8143d
Author: bw <rsw@gnu.org>
Commit: bw <rsw@gnu.org>
smart-org - Add Org tag support via agenda and consult-grep searches
When hsys-org-enable-smart-keys is t:
The Action Key does an Org Agenda search on the tag at point or all
tags on the line if on a colon separator character. This uses Org tag
inheritance.
The Assist Key works the same way put performs an interactive
consult-grep search which matches only the tags on each line and does
not use tag inheritance.
---
ChangeLog | 70 ++++++++++++++
HY-ANNOUNCE | 125 +-----------------------
HY-NEWS | 3 +
MANIFEST | 1 +
Makefile | 5 +-
README.md.html | 8 +-
README.toc.md | 20 +++-
hbut.el | 7 +-
hibtypes.el | 16 ++--
hsys-consult.el | 274 +++++++++++++++++++++++++++++++++++++++++++++++++++++
hsys-org-roam.el | 38 +++++++-
hsys-org.el | 151 ++++++++++++++++++++++++-----
hui-mouse.el | 58 ++++++++----
hyrolo.el | 156 ++----------------------------
hywiki.el | 43 ++++++---
man/hyperbole.html | 72 ++++++++++----
man/hyperbole.info | Bin 635267 -> 637528 bytes
man/hyperbole.pdf | Bin 1380829 -> 1382421 bytes
man/hyperbole.texi | 50 +++++++---
19 files changed, 722 insertions(+), 375 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ef6f1a2f86..3e56959192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,73 @@
+2024-07-06 Bob Weiner <rsw@gnu.org>
+
+* hibtypes.el (org-id): Fix bug in older versions of Org where where
+ 'org-uuid-regexp' was not bound.
+
+* hbut.el (ibut:create): Improved when err occurs in type to print the err
before
+ triggering a backtrace when in batch mode.
+
+* man/hyperbole.texi (Implicit Button Types): smart-org add new Org tags view
+ handling and improve index entries.
+
+2024-07-05 Bob Weiner <rsw@gnu.org>
+
+* hui-mouse.el (smart-org): Update to handle when point is on Org tags and
+ then search for matching Org tags with 'hsys-org-agenda-tags-p'.
+ With Assist Key, instead prompt and search with consult grep functions
+ for appropriate tag matches via 'hsys-org-consult-grep-tags-p'.
+ hsys-org-roam.el (hsys-org-roam-tags-view): Add.
+ hsys-org.el (hsys-org--agenda-tags-string, hsys-org-agenda-tags-p,
+ hsys-org-get-agenda-tags, hsys-org-hywiki-agenda-tags,
+ hsys-org-agenda-tags, hsys-org-roam-agenda-tags,
+ hsys-org-tags-view):
+ Add to match to display matching Org tags, including inheritance, using Org
+ agendas.
+
+* hsys-org.el (hsys-org-directory-at-tags-p,
+ hsys-org-at-tags-p): Add.
+ hsys-org-roam.el (hsys-org-roam-directory-at-tags-p): Add.
+ hywiki.el (hywiki-at-tags-p): Add.
+ hsys-consult.el (hsys-consult--grep-paths): Change to use "[ \t]*" instead of
+ "[ \t]+" so handles space afterwards included to support Orderless.
+ (hsys-consult--org-match-tags-string,
+ hsys-consult-org-grep-tags-p, hsys-consult-grep-tags,
+ hsys-consult-hywiki-grep-tags, hsys-consult-org-grep-tags,
+ hsys-consult-org-roam-grep-tags): Add to consult-grep based
+ on dir and buffer name. Use in 'smart-org'.
+ hui-mouse.el (smart-org): Update doc for above change.
+
+2024-07-04 Bob Weiner <rsw@gnu.org>
+
+* hsys-consult.el: Add and move/rename hyrolo consult support functions to
+ hsys-consult functions in here so they can be used in other parts
+ of Hyperbole.
+ hyrolo.el (hyrolo-org-roam-call-function): Rename to
+ 'hsys-consult-org-roam-call-function'.
+ (hyrolo-consult-org-roam-title): Rename to
'hsys-consult-org-roam-title'.
+ (hyrolo-consult-org-roam-grep): Rename to
'hsys-consult-org-roam-grep'.
+ And move all to "hsys-consult.el".
+ hywiki.el (hywiki-consult-grep): Rewrite to use 'hsys-consult-grep'.
+ and add optional arguments to allow more flexibility in usage.
+ hsys-org.el (hsys-org-consult-grep): Rewrite to use 'hsys-consult-grep'.
+ and add optional arguments to allow more flexibility in usage.
+ (hsys-org-consult-grep-func): Remove this customization;
+ 'hsys-consult-grep' automatically selects the grep function to use.
+
+2024-07-03 Bob Weiner <rsw@gnu.org>
+
+* hywiki.el (hywiki-grep-tags): Rename to 'hywiki-tags-view' to align with
+ Org command with similar name.
+
+2024-07-02 Bob Weiner <rsw@gnu.org>
+
+* hsys-org.el (hsys-org-meta-return): Trigger an error if called in an Org
+ read-only buffer.
+
+* hibtypes.el (org-id): Tighten match to uuids only to prevent false matches,
e.g.
+ if matching to any custom id, my-list-function-name would match as an id.
+
+* hywiki.el (require 'thingatpt): Add.
+
2024-06-30 Bob Weiner <rsw@gnu.org>
* hpath.el (hpath:find-line): Allow line-num and col-num to be strings.
diff --git a/HY-ANNOUNCE b/HY-ANNOUNCE
index 157da4e72f..0d9071429f 100644
--- a/HY-ANNOUNCE
+++ b/HY-ANNOUNCE
@@ -1,130 +1,9 @@
From: Bob Weiner <rsw@gnu.org>
To: gnu-emacs-sources@gnu.org, emacs-tangents@gnu.org,
hyperbole-users@gnu.org, hyperbole-announce@gnu.org
-Subject: GNU Hyperbole Major Release 9 (V9.0.1)
+Subject: GNU Hyperbole Major Release 9 (V9.0.2pre)
--text follows this line--
========================================================================
* Overview
========================================================================
-GNU Hyperbole 9.0.1, the Rhapsody release, is now available on GNU
-ELPA. And oh what a release it is: extensive new features, new video
-demos, org and org roam integration, Markdown and Org file support in
-HyRolo, recursive directory and wildcard file scanning in HyRolo, and
-much more.
-
-What's new in this release is extensively described here:
-
- www.gnu.org/s/hyperbole/HY-NEWS.html
-
- Everything back until release 8.0.0 is new since the last major release
- announcement (almost a year and a half ago), so updates are extensive.
-
-Hyperbole is like Markdown for hypertext. Hyperbole automatically
-recognizes dozens of common patterns in any buffer regardless of mode
-and transparently turns them into hyperbuttons you can instantly
-activate with a single key. Email addresses, URLs, grep -n outputs,
-programming backtraces, sequences of Emacs keys, programming
-identifiers, Texinfo and Info cross-references, Org links, Markdown
-links and on and on. All you do is load Hyperbole and then your text
-comes to life with no extra effort or complex formatting.
-
-But Hyperbole is also a personal information manager with built-in
-capabilities of contact management/hierarchical record lookup,
-legal-numbered outlines with hyperlinkable views and a unique window
-and frame manager. It is even Org-compatible so you can use all of
-Org's capabilities together with Hyperbole.
-
-Hyperbole stays out of your way but is always a key press away when
-you need it. Like Emacs, Org, Counsel and Helm, Hyperbole has many
-different uses, all based around the theme of reducing cognitive load
-and improving your everyday information management. It reduces
-cognitive load by using a single Action Key, {M-RET}, across many
-different contexts to perform the best default action in each.
-
-Hyperbole has always been one of the best documented Emacs packages.
-With Version 9 comes excellent test coverage: over 400 automated tests
-are run with every update against every major version of Emacs since
-version 27, to ensure quality. We hope you'll give it a try.
-
-========================================================================
-* Videos
-========================================================================
-
-If you prefer video introductions, visit the videos linked to below;
-otherwise, skip to the next section.
-
-
|--------------------------------------------------+------------------------------|
- | GNU Hyperbole Videos | Web Link
|
-
|--------------------------------------------------+------------------------------|
-
|--------------------------------------------------+------------------------------|
- | Overview and Demo |
https://youtu.be/WKwZHSbHmPg |
- | Covers all of Hyperbole |
|
- | Hyperlink timestamps to watch each section |
|
-
|--------------------------------------------------+------------------------------|
- | Quick Introduction |
https://youtu.be/K1MNUctggwI |
-
|--------------------------------------------------+------------------------------|
- | Top 10 ways Hyperbole amps up Emacs |
https://youtu.be/BysjfL25Nlc |
-
|--------------------------------------------------+------------------------------|
- | Introduction to Buttons |
https://youtu.be/zoEht66N2PI |
-
|--------------------------------------------------+------------------------------|
- | Linking Personal Info with Implicit Buttons |
https://youtu.be/TQ_fG7b1iHI |
-
|--------------------------------------------------+------------------------------|
- | Powerful Productivity with Hyperbole and Org |
https://youtu.be/BrTpTNEXMyY |
-
|--------------------------------------------------+------------------------------|
- | HyRolo, fast contact/hierarchical record viewer |
https://youtu.be/xdJGFdgKPFY |
-
|--------------------------------------------------+------------------------------|
- | Using Koutline for stream of thought journaling |
https://youtu.be/dO-gv898Vmg |
-
|--------------------------------------------------+------------------------------|
- | Build a Zettelkasten with HyRolo |
https://youtu.be/HdlCK9w-LyQ |
-
|--------------------------------------------------+------------------------------|
- | HyControl, fast Emacs frame and window manager |
https://youtu.be/M3-aMh1ccJk |
-
|--------------------------------------------------+------------------------------|
- | Writing test cases for GNU Hyperbole |
https://youtu.be/maNQSKxXIzI |
-
|--------------------------------------------------+------------------------------|
- | Find/Web Search |
https://youtu.be/8lMlJed0-OM |
-
|--------------------------------------------------+------------------------------|
-
-========================================================================
-* Installing and Using Hyperbole
-========================================================================
-
-To install within GNU Emacs, use:
-
- {M-x package-install RET hyperbole RET}
-
- Hyperbole installs in less than a minute and can be uninstalled even
- faster if ever need be. Give it a try.
-
-Then to invoke its minibuffer menu, use:
-
- {C-h h} or {M-x hyperbole RET}
-
-The best way to get a feel for many of its capabilities is to invoke the
-all new, interactive FAST-DEMO and explore sections of interest:
-
- {C-h h d d}
-
-To permanently activate Hyperbole in your Emacs initialization file, add
-the line:
-
- (hyperbole-mode 1)
-
-Hyperbole is a minor mode that may be disabled at any time with:
-
- {C-u 0 hyperbole-mode RET}
-
-The Hyperbole home page with screenshots is here:
-
- www.gnu.org/s/hyperbole
-
-For use cases, see:
-
- www.gnu.org/s/hyperbole/HY-WHY.html
-
-For what users think about Hyperbole, see:
-
- www.gnu.org/s/hyperbole/hyperbole.html#user-quotes
-
-Enjoy,
-
-The Hyperbole Team
+Still in development.
diff --git a/HY-NEWS b/HY-NEWS
index 9cf6fd230d..6d9191e713 100644
--- a/HY-NEWS
+++ b/HY-NEWS
@@ -1,6 +1,9 @@
* What's New in GNU Hyperbole
by Bob Weiner
+===========================================================================
+* V9.0.2pre
+===========================================================================
===========================================================================
* V9.0.1
===========================================================================
diff --git a/MANIFEST b/MANIFEST
index 99d3a9ed0c..ba7c8b4016 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -106,6 +106,7 @@ topwin.py - Python script to find the topmost
macOS app window at a s
.hypb & _hypb - Button data files used by the GNU Hyperbole DEMO file
* --- EXTERNAL SYSTEM ENCAPSULATIONS ---
+hsys-consult.el - Hyperbole interactive consult-grep convenience functions
hsys-flymake.el - Add missing source buffer keymap to flymake linter
hsys-org.el - GNU Hyperbole support functions for Org mode
hsys-org-roam.el - GNU Hyperbole support functions for Org Roam
diff --git a/Makefile b/Makefile
index cbab6d3721..e01dfefac8 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
# Author: Bob Weiner
#
# Orig-Date: 15-Jun-94 at 03:42:38
-# Last-Mod: 30-Jun-24 at 19:08:27 by Mats Lidell
+# Last-Mod: 4-Jul-24 at 11:26:09 by Bob Weiner
#
# Copyright (C) 1994-2023 Free Software Foundation, Inc.
# See the file HY-COPY for license information.
@@ -203,7 +203,8 @@ EL_COMPILE = hact.el hactypes.el hargs.el hbdata.el
hbmap.el hbut.el \
hib-social.el hibtypes.el \
hinit.el hload-path.el hmail.el hmh.el hmoccur.el hmouse-info.el \
hmouse-drv.el hmouse-key.el hmouse-mod.el hmouse-sh.el
hmouse-tag.el \
- hpath.el hproperty.el hrmail.el hsettings.el hsmail.el
hsys-flymake.el \
+ hpath.el hproperty.el hrmail.el hsettings.el hsmail.el
hsys-consult.el \
+ hsys-flymake.el \
hsys-org.el hsys-org-roam.el hsys-www.el hsys-xref.el
hsys-youtube.el htz.el \
hycontrol.el hui-jmenu.el hui-menu.el hui-mini.el hui-mouse.el
hui-select.el \
hui-treemacs.el hui-window.el hui.el hvar.el hversion.el hynote.el
hypb.el hyperbole.el \
diff --git a/README.md.html b/README.md.html
index 0b69658645..822381a10e 100644
--- a/README.md.html
+++ b/README.md.html
@@ -1,14 +1,14 @@
<h1
-id="gnu-hyperbole-901---the-everyday-hypertextual-information-manager">GNU
-Hyperbole 9.0.1 - The Everyday Hypertextual Information Manager</h1>
+id="gnu-hyperbole-902pre---the-everyday-hypertextual-information-manager">GNU
+Hyperbole 9.0.2pre - The Everyday Hypertextual Information Manager</h1>
<p>[We work on Hyperbole as a gift to the Emacs community and request
you send us a thank you or a testimonial describing your usage if you
like Hyperbole (mailto:<a
href="mailto:rsw@gnu.org";>rsw@gnu.org</a>)].</p>
<ul>
<li><a
-href="#gnu-hyperbole-901---the-everyday-hypertextual-information-manager">GNU
-Hyperbole 9.0.1 - The Everyday Hypertextual Information Manager</a>
+href="#gnu-hyperbole-902pre---the-everyday-hypertextual-information-manager">GNU
+Hyperbole 9.0.2pre - The Everyday Hypertextual Information Manager</a>
<ul>
<li><a href="#videos">Videos</a></li>
<li><a href="#summary">Summary</a></li>
diff --git a/README.toc.md b/README.toc.md
index f7358550b6..2cd5312122 100644
--- a/README.toc.md
+++ b/README.toc.md
@@ -4,7 +4,25 @@
send us a thank you or a testimonial describing your usage if you like
Hyperbole (mailto:rsw@gnu.org)].
-[TOC]
+
+
+- [GNU Hyperbole 9.0.2pre - The Everyday Hypertextual Information
Manager](#gnu-hyperbole-902pre---the-everyday-hypertextual-information-manager)
+ - [Videos](#videos)
+ - [Summary](#summary)
+ - [Mailing Lists](#mailing-lists)
+ - [Ftp and Git Repository Downloads](#ftp-and-git-repository-downloads)
+ - [Installation](#installation)
+ - [Invocation](#invocation)
+ - [Hyperbole Components](#hyperbole-components)
+ - [Hyperbole Buttons](#hyperbole-buttons)
+ - [Important Features](#important-features)
+ - [Hyperbole Uses](#hyperbole-uses)
+ - [Files](#files)
+ - [Programmer Quick Reference](#programmer-quick-reference)
+ - [User Quotes](#user-quotes)
+ - [Why was Hyperbole developed?](#why-was-hyperbole-developed)
+
+

diff --git a/hbut.el b/hbut.el
index 93b26098c0..2a2902c547 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: 30-Jun-24 at 10:01:50 by Bob Weiner
+;; Last-Mod: 6-Jul-24 at 01:31:19 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1957,14 +1957,15 @@ If a new button is created, store its attributes in the
symbol,
(setq ibtype-point (point))
(while (and (not is-type) types)
(setq itype (car types))
- (when (condition-case ()
+ (when (condition-case err
(and itype (setq args (funcall itype)))
;; Purposely trigger another error
;; here by sending a symbol
;; argument to the message call
;; below so can see the value of
;; itype whose funcall failed above.
- (error (message itype)))
+ (error (progn (message "%S" err)
+ (message itype))))
(setq is-type itype)
;; Any implicit button type check should leave
point
;; unchanged. Trigger an error if not.
diff --git a/hibtypes.el b/hibtypes.el
index 48d9d7dba3..58597e66ae 100644
--- a/hibtypes.el
+++ b/hibtypes.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Sep-91 at 20:45:31
-;; Last-Mod: 30-Jun-24 at 17:22:40 by Bob Weiner
+;; Last-Mod: 6-Jul-24 at 01:43:04 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -42,7 +42,8 @@
(eval-when-compile (require 'hversion))
(require 'hactypes)
(require 'hypb)
-(require 'subr-x) ;; For string-trim
+(require 'org-macs) ;; for org-uuid-regexp
+(require 'subr-x) ;; for string-trim
(require 'thingatpt)
;;; ************************************************************************
@@ -134,9 +135,10 @@ line and check for a source reference line again."
;;; ========================================================================
(defib org-id ()
- "Display Org roam or Org node referenced by id at point, if any.
-If on the :ID: definition line, display a message about how to copy the id.
-If the referenced location is found, return non-nil."
+ "Display Org roam or Org node referenced by uuid at point, if any.
+If on the :ID: definition line, display a message about how to copy the uuid.
+If the referenced location is found, return non-nil. Match to uuids
+only to prevent false matches."
(when (featurep 'org-id)
(let* ((id (thing-at-point 'symbol t)) ;; Could be a uuid or some other
form of id
(bounds (when id (bounds-of-thing-at-point 'symbol)))
@@ -144,7 +146,9 @@ If the referenced location is found, return non-nil."
(end (when bounds (cdr bounds)))
m)
;; Ignore ID definitions or when not on a possible ID
- (when (and id (string-match "\\`[:alnum:][-[:alnum:]:.@]+\\'" id))
+ (when (and id (if (fboundp 'org-uuidgen-p)
+ (org-uuidgen-p id)
+ (string-match org-uuid-regexp (downcase id))))
(when (and start end)
(ibut:label-set id start end))
(if (and (not assist-flag)
diff --git a/hsys-consult.el b/hsys-consult.el
new file mode 100644
index 0000000000..ed19e27281
--- /dev/null
+++ b/hsys-consult.el
@@ -0,0 +1,274 @@
+;;; hsys-consult.el --- Hyperbole interactive consult-grep convenience
functions -*- lexical-binding: t; -*-
+;; Author: Bob Weiner
+;;
+;; Orig-Date: 4-Jul-24 at 09:57:18
+;; Last-Mod: 6-Jul-24 at 00:24:36 by Bob Weiner
+;;
+;; SPDX-License-Identifier: GPL-3.0-or-later
+;;
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+;; Licensed under the GNU General Public License, version 3.
+;;
+;; This file is part of GNU Hyperbole.
+
+;;; Commentary:
+;;
+;; This library automatically installs the `consult' package for its
+;; `consult-grep' command only when one of the functions in here is
+;; called. At that time, if `consult' has not been installed, it will
+;; be automatically downloaded and installed via the Emacs package system.
+
+;;; Code:
+
+;;; ************************************************************************
+;;; Requirements
+;;; ************************************************************************
+
+;; Don't (require 'consult) here since want to create that dependency only
+;; when a function within this library is called.
+
+;;; ************************************************************************
+;;; Public declarations
+;;; ************************************************************************
+
+(declare-function consult-grep "ext:consult")
+(declare-function consult-ripgrep "ext:consult")
+(declare-function org-roam-db-autosync-mode "ext:org-roam")
+(declare-function org-roam-node-find "ext:org-roam")
+(declare-function org-roam-node-level "ext:org-roam")
+
+;; Forward declarations
+(defvar consult-grep-args)
+(defvar consult-ripgrep-args)
+(defvar consult-async-split-style)
+(defvar org-roam-db-autosync-mode)
+(defvar org-roam-directory)
+
+;;; ************************************************************************
+;;; Public variables
+;;; ************************************************************************
+
+;;; ************************************************************************
+;;; Private variables
+;;; ************************************************************************
+
+;;; ************************************************************************
+;;; Public functions
+;;; ************************************************************************
+
+;;;###autoload
+(defun hsys-consult-get-version ()
+ "Return the string version of the installed consult package or nil."
+ (let* ((consult-file (find-library-name "consult"))
+ (buffer-existed (get-file-buffer consult-file))
+ (buffer-modified (when buffer-existed (buffer-modified-p
buffer-existed)))
+ (buf (or buffer-existed (find-file-noselect consult-file))))
+ (with-current-buffer buf
+ (prog1 (package-get-version)
+ (unless buffer-modified
+ (kill-buffer buf))))))
+
+(defun hsys-consult-grep (grep-includes ripgrep-globs &optional regexp
max-matches path-list)
+ "Interactively search PATH-LIST with a consult package grep command.
+
+With GREP-INCLUDES or RIPGREP-GLOBS file suffixes to include, search
+for optional REGEXP up to MAX-MATCHES in PATH-LIST.
+
+Use ripgrep (rg) if found, otherwise, plain grep. Initialize search with
+optional REGEXP and interactively prompt for changes. Limit matches
+per file to the absolute value of MAX-MATCHES, if given and not 0. If
+0, match to headlines only (lines that start with a '^[*#]+[ \t]+' regexp)."
+ (unless (package-installed-p 'consult)
+ (package-install 'consult))
+ (require 'consult)
+ (let ((consult-version (hsys-consult-get-version)))
+ ;; Multi-file support added after consult version "0.32"
+ (when (not (and consult-version (string-greaterp consult-version "0.32")))
+ (error "(hsys-consult-grep): consult package version is %s; update
required"
+ consult-version)))
+ (let* ((consult-grep-args
+ (if (listp consult-grep-args)
+ (append consult-grep-args (list grep-includes))
+ (concat consult-grep-args " " grep-includes)))
+ (consult-ripgrep-args
+ (if (listp consult-ripgrep-args)
+ (append consult-ripgrep-args (list ripgrep-globs))
+ (concat consult-ripgrep-args " " ripgrep-globs)))
+ (paths (if find-file-wildcards
+ ;; Use only the directory of paths with wildcards
+ ;; since the grep command filters to desired file
+ ;; types much more efficiently.
+ (mapcar (lambda (path)
+ (if (string-match
"[\\/]?\\([^*?\\/]*[*?][^\\/]+\\'\\)" path)
+ (substring path 0 (match-beginning 1))
+ path))
+ path-list)
+ path-list)))
+ (hsys-consult--grep-paths paths regexp max-matches)))
+
+;;;###autoload
+(defun hsys-consult-org-grep-tags-p ()
+ "When on an Org tag, return appropriate `consult-grep' function.
+Use `default-directory' and buffer name to determine which function to
+call."
+ (when (hsys-org-at-tags-p)
+ (cond ((hsys-org-directory-at-tags-p t)
+ #'hsys-consult-org-grep-tags)
+ ((hsys-org-roam-directory-at-tags-p t)
+ #'hsys-consult-org-roam-grep-tags)
+ ((hywiki-at-tags-p t)
+ #'hsys-consult-hywiki-grep-tags))))
+
+(defun hsys-consult-grep-tags (org-consult-grep-function)
+ "When on an Org tag, call ORG-CONSULT-GREP-FUNCTION to find matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point.
+
+The function determines the org files searched for matches and is
+given two arguments when called: a regexp of tags to match and a 0
+max-count which finds all matches within headlines only."
+ (interactive)
+ (when (hsys-org-at-tags-p)
+ (funcall org-consult-grep-function (hsys-consult--org-grep-tags-string)
0)))
+
+(defun hsys-consult-hywiki-grep-tags ()
+ "When on a HyWiki tag, use `consult-grep' to list all HyWiki tag matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point."
+ (interactive)
+ (hsys-consult-grep-tags #'hywiki-consult-grep))
+
+(defun hsys-consult-org-grep-tags ()
+ "When on an `org-directory' tag, use `consult-grep' to list dir tag matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point."
+ (interactive)
+ (hsys-consult-grep-tags #'hsys-org-consult-grep))
+
+(defun hsys-consult-org-roam-grep-tags ()
+ "When on an `org-roam-directory' tag, use `consult-grep' to list tag matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point."
+ (interactive)
+ (hsys-consult-grep-tags #'hsys-org-roam-consult-grep))
+
+;;;###autoload
+(defun hsys-consult-org-roam-grep (&optional regexp max-matches)
+ "Interactively narrow and select Org Roam nodes by line.
+Use ripgrep (rg) if found, otherwise, plain grep to search Org
+files within `org-roam-directory'. Initialize search with
+optional REGEXP and interactively prompt for changes. Limit
+matches per file to the absolute value of MAX-MATCHES, if given
+and not 0. If 0, match to the start of headline text only (lines
+that start with the '^[*#]+[ \t]*' regexp)."
+ (interactive "i\nP")
+ (hsys-consult--org-roam-call-function
+ (lambda ()
+ (let ((consult-grep-args
+ (if (listp consult-grep-args)
+ (append consult-grep-args (list "--include *.org"))
+ (concat consult-grep-args " --include *.org")))
+ (consult-ripgrep-args
+ (if (listp consult-ripgrep-args)
+ (append consult-ripgrep-args (list "--glob *.org"))
+ (concat consult-ripgrep-args " --glob *.org"))))
+ (hsys-consult--grep-paths (list org-roam-directory) regexp
max-matches)))))
+
+;;;###autoload
+(defun hsys-consult-org-roam-title ()
+ "Interactively narrow and select Org Roam nodes by title."
+ (interactive)
+ (hsys-consult--org-roam-call-function
+ (lambda ()
+ (org-roam-node-find nil nil (lambda (node) (zerop (org-roam-node-level
node)))))))
+
+;;; ************************************************************************
+;;; Private functions
+;;; ************************************************************************
+
+(defun hsys-consult--grep-paths (paths &optional regexp max-matches)
+ "Interactively search PATHS with a consult package grep command.
+Use ripgrep (rg) if found, otherwise, plain grep. Interactively
+show all matches from PATHS; see the documentation for the `dir'
+argument in `consult-grep' for valid values of PATHS.
+
+Initialize search with optional REGEXP and interactively prompt
+for changes. Limit matches per file to the absolute value of
+MAX-MATCHES, if given and not 0. If 0, match to the start of
+headline text only (lines that start with a '^[*#]+[ \t]*' regexp)."
+ (unless (package-installed-p 'consult)
+ (package-install 'consult))
+ (require 'consult)
+ (let ((consult-version (hsys-consult-get-version)))
+ ;; Multi-file support added after consult version "0.32"
+ (when (not (and consult-version (string-greaterp consult-version "0.32")))
+ (error "(hsys-consult-grep): consult package version is %s; update
required"
+ consult-version)))
+ (when max-matches
+ (setq max-matches (prefix-numeric-value max-matches)))
+ (when (and (integerp max-matches) (zerop max-matches))
+ ;; Final space in leading regexp in next line makes it work with
+ ;; the Orderless package.
+ (setq regexp (concat "^[*#]+[ \t]* " (or regexp ""))))
+ (let ((consult-grep-args (if (and (integerp max-matches) (not (zerop
max-matches)))
+ (if (listp consult-grep-args)
+ (append consult-grep-args
+ (list (format "-m %d" (abs
max-matches))))
+ (concat consult-grep-args
+ (format " -m %d" (abs max-matches))))
+ consult-grep-args))
+ (consult-ripgrep-args (if (and (integerp max-matches) (not (zerop
max-matches)))
+ (if (listp consult-ripgrep-args)
+ (append consult-ripgrep-args
+ (list (format "-m %d" (abs
max-matches))))
+ (concat consult-ripgrep-args
+ (format " -m %d" (abs
max-matches))))
+ consult-ripgrep-args))
+ (grep-func (cond ((executable-find "rg")
+ #'consult-ripgrep)
+ (t #'consult-grep))))
+ ;; Consult split style usually uses '#' as a separator char but
+ ;; that interferes with matching to Markdown # chars at the start
+ ;; of a line in the regexp, so disable the separator char as it is
+ ;; not needed for simple regexp searches.
+ (let ((consult-async-split-style nil))
+ (funcall grep-func paths regexp))))
+
+(defun hsys-consult--org-grep-tags-string ()
+ "When on or between Org tags, return a `consult-grep' match string for them.
+If on a colon, match to headlines with all tags around point, in any order.
+e.g. \":tag1: :tag2: :tag3: \". Otherwise, just match to the single
+tag around point."
+ (let (range
+ tags)
+ (if (equal (char-after) ?:)
+ ;; On colon, search for HyWiki headings with all tags on line
+ (setq range (hproperty:char-property-range nil 'face 'org-tag)
+ tags (when range (buffer-substring-no-properties (car range) (cdr
range))))
+ ;; Else on a specific tag, search for HyWiki headings with that tag
only
+ (setq range (hargs:delimited ":" ":" nil nil t)
+ tags (nth 0 range)
+ range (cons (nth 1 range) (nth 2 range))))
+ (when (and tags range)
+ (ibut:label-set tags (car range) (cdr range))
+ (concat ".*" (string-join (mapcar (lambda (tag)
+ (concat ":" (regexp-quote tag) ":"))
+ (split-string tags ":" t))
+ " ")))))
+
+(defun hsys-consult--org-roam-call-function (func)
+ "Install Org Roam if necessary and then call an Org Roam FUNC."
+ (unless (package-installed-p 'org-roam)
+ (package-install 'org-roam))
+ (require 'org-roam)
+ (unless (file-readable-p org-roam-directory)
+ (make-directory org-roam-directory))
+ (unless org-roam-db-autosync-mode
+ (org-roam-db-autosync-mode))
+ (if (file-readable-p org-roam-directory)
+ (funcall func)
+ (error "`org-roam-directory', \"%s\", does not exist" org-roam-directory)))
+
+(provide 'hsys-consult)
+
+;;; hsys-consult.el ends here
diff --git a/hsys-org-roam.el b/hsys-org-roam.el
index 589edf6880..c77361fe14 100644
--- a/hsys-org-roam.el
+++ b/hsys-org-roam.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 26-Feb-23 at 11:20:15 by Bob Weiner
-;; Last-Mod: 20-Jan-24 at 15:39:49 by Mats Lidell
+;; Last-Mod: 6-Jul-24 at 00:11:29 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -57,6 +57,42 @@ Actual grep function used is given by the variable,
(error "(hsys-org-roam-consult-grep): `%s' is an invalid function"
consult-org-roam-grep-func))))
+(defun hsys-org-roam-directory-at-tags-p (&optional at-tag-flag)
+ "Return non-nil if point is in an `org-roam-directory' buffer and at Org
tags."
+ (and (featurep 'org-roam)
+ (or at-tag-flag (hsys-org-at-tags-p))
+ (and buffer-file-name
+ (string-prefix-p (expand-file-name org-roam-directory)
+ buffer-file-name))))
+
+;;;###autoload
+(defun hsys-org-roam-tags-view (&optional todo-only match view-buffer-name)
+ "Prompt for colon-separated Org Roam tags and display matching headlines.
+With optional prefix arg TODO-ONLY, limit matches to Org Roam
+todo items only. With optional VIEW-BUFFER-NAME, use that rather
+than the default, \"*Org Roam Tags*\"."
+ (interactive "P")
+ (require 'org-agenda)
+ (unless (package-installed-p 'org-roam)
+ (package-install 'org-roam))
+ (require 'org-roam)
+ (let* ((org-agenda-files (list org-roam-directory))
+ (org-agenda-buffer-name (or view-buffer-name "*Org Roam Tags*"))
+ ;; `org-tags-view' is mis-written to require setting this next
+ ;; tmp-name or it will not properly name the displayed buffer.
+ (org-agenda-buffer-tmp-name org-agenda-buffer-name))
+ ;; This prompts for the tags to match and uses `org-agenda-files'.
+ (org-tags-view todo-only match)
+ (when (equal (buffer-name) org-agenda-buffer-name)
+ ;; Set up {C-u r} redo cmd
+ (let (buffer-read-only)
+ (put-text-property (point-min) (point-max) 'org-redo-cmd
+ `(hsys-org-roam-tags-view
+ ,todo-only
+ nil
+ ,org-agenda-buffer-name)))
+ (forward-line 2))))
+
(provide 'hsys-org-roam)
;;; hsys-org-roam.el ends here
diff --git a/hsys-org.el b/hsys-org.el
index 259aa93760..3bb9c66777 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: 29-Jun-24 at 18:55:30 by Bob Weiner
+;; Last-Mod: 6-Jul-24 at 00:25:11 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -32,6 +32,7 @@
(eval-when-compile (require 'hmouse-drv))
(require 'hproperty) ;; requires 'hbut
+(require 'hsys-consult)
(require 'org)
(require 'org-element)
(require 'org-fold nil t)
@@ -44,17 +45,6 @@
;;; Public declarations
;;; ************************************************************************
-(declare-function consult-grep "ext:consult")
-(declare-function consult-ripgrep "ext:consult")
-
-(defcustom hsys-org-consult-grep-func
- (cond ((executable-find "rg")
- #'consult-ripgrep)
- (t #'consult-grep))
- "Function for consult grep searching over files."
- :type 'function
- :group 'org)
-
(defvar hyperbole-mode-map) ; "hyperbole.el"
(defvar org--inhibit-version-check) ; "org-macs.el"
(defvar hywiki-org-link-type-required) ; "hywiki.el"
@@ -162,6 +152,77 @@ an error."
;;; Public functions
;;; ************************************************************************
+;;;###autoload
+(defun hsys-org-agenda-tags-p ()
+ "When on an Org tag, return appropriate `org-tags-view' function.
+Use `default-directory' and buffer name to determine which function to
+call."
+ (when (hsys-org-at-tags-p)
+ (cond ((hsys-org-directory-at-tags-p t)
+ #'hsys-org-agenda-tags)
+ ((hsys-org-roam-directory-at-tags-p t)
+ #'hsys-org-roam-agenda-tags)
+ ((hywiki-at-tags-p t)
+ #'hsys-org-hywiki-agenda-tags))))
+
+(defun hsys-org-get-agenda-tags (org-consult-agenda-function)
+ "When on an Org tag, call ORG-CONSULT-AGENDA-FUNCTION to find matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point.
+
+The function determines the org files searched for matches and is
+given two arguments when called: a regexp of tags to match and a 0
+max-count which finds all matches within headlines only."
+ (interactive)
+ (when (hsys-org-at-tags-p)
+ (funcall org-consult-agenda-function nil (hsys-org--agenda-tags-string))))
+
+(defun hsys-org-hywiki-agenda-tags ()
+ "When on a HyWiki tag, use `hywiki-tags-view' to list all HyWiki tag matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point."
+ (interactive)
+ (hsys-org-get-agenda-tags #'hywiki-tags-view))
+
+(defun hsys-org-agenda-tags ()
+ "When on an `org-directory' tag, use `hsys-org-tags-view' to list dir tag
matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point."
+ (interactive)
+ (hsys-org-get-agenda-tags #'hsys-org-tags-view))
+
+(defun hsys-org-roam-agenda-tags ()
+ "When on an `org-roam-directory' tag, use `hsys-org-roam-tags-view' to list
tag matches.
+If on a colon, match to sections with all tags around point;
+otherwise, just match to the single tag around point."
+ (interactive)
+ (hsys-org-get-agenda-tags #'hsys-org-roam-tags-view))
+
+;;;###autoload
+(defun hsys-org-tags-view (&optional todo-only match view-buffer-name)
+ "Prompt for colon-separated Org tags and display matching Org headlines.
+With optional prefix arg TODO-ONLY, limit matches to Org todo
+items only. With optional VIEW-BUFFER-NAME, use that rather than
+the default, \"*Org Tags*\"."
+ (interactive "P")
+ (require 'org-agenda)
+ (let* ((org-agenda-files (list org-directory))
+ (org-agenda-buffer-name (or view-buffer-name "*Org Tags*"))
+ ;; `org-tags-view' is mis-written to require setting this next
+ ;; tmp-name or it will not properly name the displayed buffer.
+ (org-agenda-buffer-tmp-name org-agenda-buffer-name))
+ ;; This prompts for the tags to match and uses `org-agenda-files'.
+ (org-tags-view todo-only match)
+ (when (equal (buffer-name) org-agenda-buffer-name)
+ ;; Set up {C-u r} redo cmd
+ (let (buffer-read-only)
+ (put-text-property (point-min) (point-max) 'org-redo-cmd
+ `(hsys-org-tags-view
+ ,todo-only
+ nil
+ ,org-agenda-buffer-name)))
+ (forward-line 2))))
+
;;;###autoload
(defun hsys-org-fix-version ()
"If multiple Org versions are loaded, use the one first on `load-path'.
@@ -276,24 +337,28 @@ Return t if Org is reloaded, else nil."
Do nothing if called outside of `org-mode'."
(interactive "P")
(when (apply #'derived-mode-p '(org-mode))
- (if current-prefix-arg
+ (when buffer-read-only
+ (error "(hsys-org-meta-return): \"%s\" must not be read-only; toggle
with {%s}"
+ (buffer-name)
+ (key-description (car (where-is-internal #'read-only-mode)))))
+ (if current-prefix-arg
(org-meta-return (prefix-numeric-value current-prefix-arg))
(org-meta-return))))
;;;###autoload
-(defun hsys-org-consult-grep ()
- "Prompt for search terms and run consult grep over `org-directory'.
-Actual grep function used is given by the variable,
-`hsys-org-consult-grep-func'."
- (interactive)
- (require 'org)
- (let ((grep-func (when (and (boundp 'hsys-org-consult-grep-func)
- (fboundp hsys-org-consult-grep-func))
- hsys-org-consult-grep-func)))
- (if grep-func
- (funcall grep-func org-directory)
- (error "(hsys-org-consult-grep): `%s' is an invalid function"
- hsys-org-consult-grep-func))))
+(defun hsys-org-consult-grep (&optional regexp max-matches path-list)
+ "Interactively search `org-directory' with a consult package grep command.
+Search for optional REGEXP up to MAX-MATCHES in PATH-LIST or `org-directory'.
+
+Use ripgrep (rg) if found, otherwise, plain grep. Initialize search with
+optional REGEXP and interactively prompt for changes. Limit matches
+per file to the absolute value of MAX-MATCHES, if given and not 0. If
+0, match to headlines only (lines that start with a '^[*#]+[ \t]+' regexp)."
+ (interactive "i\nP")
+ (let* ((grep-includes "--include *.org")
+ (ripgrep-globs "--glob *.org"))
+ (hsys-consult-grep grep-includes ripgrep-globs
+ regexp max-matches (or path-list (list org-directory)))))
;;;###autoload
(defun hsys-org-mode-p ()
@@ -323,6 +388,10 @@ Actual grep function used is given by the variable,
:tags
:todo-keyword))))))))
+(defun hsys-org-at-tags-p ()
+ "Return non-nil if point is within a fontified set of Org tags."
+ (hproperty:char-property-contains-p (point) 'face 'org-tag))
+
(defun hsys-org-cycle ()
"Call `org-cycle' and set as `this-command' to cycle through all states."
(setq this-command 'org-cycle)
@@ -330,6 +399,15 @@ Actual grep function used is given by the variable,
(org-back-to-heading)
(org-cycle)))
+(defun hsys-org-directory-at-tags-p (&optional at-tag-flag)
+ "Return non-nil if point is in an `org-directory' buffer and at Org tags."
+ (and (featurep 'org)
+ (or at-tag-flag (hsys-org-at-tags-p))
+ (or (and buffer-file-name
+ (string-prefix-p (expand-file-name org-directory)
+ buffer-file-name))
+ (string-prefix-p "*Org Agenda*" (buffer-name)))))
+
(defun hsys-org-get-value (attribute)
"Within the current Org context, return the ATTRIBUTE value."
(let ((src-block-info (org-babel-get-src-block-info)))
@@ -569,6 +647,27 @@ TARGET must be a string."
;;; Private functions
;;; ************************************************************************
+(defun hsys-org--agenda-tags-string ()
+ "When on or between Org tags, return an agenda match string for them.
+If on a colon, match to headlines with all tags around point, in any order.
+e.g. \":tag1: :tag2: :tag3: \". Otherwise, just match to the single
+tag around point."
+ (let (range
+ tags)
+ (if (equal (char-after) ?:)
+ ;; On colon, search for HyWiki headings with all tags on line
+ (setq range (hproperty:char-property-range nil 'face 'org-tag)
+ tags (when range (buffer-substring-no-properties (car range) (cdr
range))))
+ ;; Else on a specific tag, search for HyWiki headings with that tag
only
+ (setq range (hargs:delimited ":" ":" nil nil t)
+ tags (nth 0 range)
+ range (cons (nth 1 range) (nth 2 range))))
+ (when (and tags range)
+ (ibut:label-set tags (car range) (cdr range))
+ (concat ":" (string-join (mapcar (lambda (tag) (regexp-quote tag))
+ (split-string tags ":" t))
+ ":")))))
+
(defun hsys-org--set-fold-style ()
"Set `org-fold-core-style' to \\='overlays for `reveal-mode' compatibility.
This must be called before Org mode is loaded."
diff --git a/hui-mouse.el b/hui-mouse.el
index 42f80cbfc4..8bfafaa794 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-89
-;; Last-Mod: 2-Jun-24 at 11:40:22 by Bob Weiner
+;; Last-Mod: 6-Jul-24 at 00:38:17 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1801,54 +1801,67 @@ On Action Key press, invoke Agenda's <return> key
binding, typically
"Follow Org mode references, cycle outline visibility and execute code
blocks.
Active when `hsys-org-enable-smart-keys' is non-nil,
-When the Action Key is pressed:
+When the Action Key is pressed and `hsys-org-enable-smart-keys' is t:
- 1. On an Org todo keyword, cycle through the keywords in that
+ 1. On an Org tag, call `hsys-org-agenda-tags-p' and an
+ appropriate view tags function based on current directory or
+ buffer name, matching to the tag. If on a colon between
+ tags, match to all tags on the line.
+
+ 2. On an Org todo keyword, cycle through the keywords in that
set or if final done keyword, remove it.
- 2. On an Org agenda view item, jump to the item for editing.
+ 3. On an Org agenda view item, jump to the item for editing.
+
+When the Action Key is pressed and `hsys-org-enable-smart-keys' is
+either t or 'buttons:
- 3. Within a radio or internal target or a link to it, jump between
+ 4. 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.
- 4. On another internal link in an Org mode file, jump to its referent.
+ 5. On another internal link in an Org mode file, jump to its referent.
- 5. On an Org mode external link, jump to its referent.
+ 6. On an Org mode external link, jump to its referent.
- 6. On a Hyperbole button, activate the button.
+ 7. On a Hyperbole button, activate the button.
- 7. With point on the :dir path of a code block definition, display the
+ 8. With point on the :dir path of a code block definition, display the
directory given by the path.
- 8. With point on any #+BEGIN_SRC, #+END_SRC, #+RESULTS, #+begin_example
+ 9. With point on any #+BEGIN_SRC, #+END_SRC, #+RESULTS, #+begin_example
or #+end_example header, execute the code block via the Org mode
standard binding of {\\`C-c' \\`C-c'}, (org-ctrl-c-ctrl-c).
- 9. With point on an Org mode heading, cycle the view of the subtree at
+ 10. With point on an Org mode heading, cycle the view of the subtree at
point.
- 10. In any other context besides the end of a line, invoke the Org mode
- standard binding of {M-RET}, (org-meta-return).
+ 11. In any other context besides the end of a line, invoke the Org mode
+ standard binding of {M-RET}, (org-meta-return).
When the Assist Key is pressed, it behaves just like the Action Key except
in these contexts:
- 1. On an Org todo keyword, move to the first todo keyword in the next
+ 1. On an Org tag, call `hsys-consult-org-grep-tags-p' and an
+ appropriate consult grep function based on current directory
+ or buffer name, prompting with and matching to the tag. If on a
+ colon between tags, prompt and match to all tags on the line.
+
+ 2. On an Org todo keyword, move to the first todo keyword in the next
set, if any.
- 2. On an Org mode link or agenda view item, display Hyperbole
+ 3. 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
+ 4. On a Hyperbole button, perform the Assist Key function, generally
showing help for the button.
- 4. With point on the :dir value of a code block definition, display
+ 5. With point on the :dir value of a code block definition, display
a help summary of this implicit directory button.
- 5. With point on any #+BEGIN_SRC, #+END_SRC, #+RESULTS, #+begin_example
+ 6. With point on any #+BEGIN_SRC, #+END_SRC, #+RESULTS, #+begin_example
or #+end_example header, remove source block results.
- 6. Not on a Hyperbole button but on an Org mode heading, cycle
+ 7. Not on a Hyperbole button but on an Org mode heading, cycle
through views of the whole buffer outline.
To disable ALL Hyperbole support within Org major and minor modes, set the
@@ -1865,7 +1878,12 @@ handled by the separate implicit button type,
`org-link-outside-org-mode'."
;; Ignore any further Smart Key non-Org contexts
t)
((eq hsys-org-enable-smart-keys t)
- (cond ((or (hsys-org-todo-at-p)
+ (cond ((setq hkey-value
+ (if (not assist-flag)
+ (hsys-org-agenda-tags-p)
+ (hsys-consult-org-grep-tags-p)))
+ (hact hkey-value))
+ ((or (hsys-org-todo-at-p)
(eq last-command #'org-todo))
(if (not assist-flag)
(hact 'hsys-org-todo-cycle)
diff --git a/hyrolo.el b/hyrolo.el
index de5e3a9321..1e91397c5a 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: 22-Jun-24 at 22:19:36 by Bob Weiner
+;; Last-Mod: 4-Jul-24 at 13:40:35 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -35,6 +35,7 @@
(require 'custom) ;; For `defface'
(require 'hversion)
(require 'hmail)
+(require 'hsys-consult)
(require 'hsys-org) ;; For `hsys-org-cycle-bob-file-list'
(require 'hypb) ;; For `hypb:mail-address-regexp' and
`hypb:add-to-invisibility-spec'
(eval-when-compile
@@ -60,8 +61,6 @@
;;; Public declarations
;;; ************************************************************************
-(declare-function consult-grep "ext:consult")
-(declare-function consult-ripgrep "ext:consult")
(declare-function google-contacts "ext:google-contacts")
(declare-function google-contacts-add-margin-to-text "ext:google-contacts")
(declare-function google-contacts-build-node-list "ext:google-contacts")
@@ -76,10 +75,6 @@
(declare-function org-fold-initialize "org-fold")
(declare-function org-fold-core-set-folding-spec-property "org-fold")
-(declare-function org-roam-db-autosync-mode "ext:org-roam")
-(declare-function org-roam-node-find "ext:org-roam")
-(declare-function org-roam-node-level "ext:org-roam")
-
(declare-function outline-apply-default-state "outline")
(declare-function xml-node-child-string "ext:google-contacts")
(declare-function xml-node-get-attribute-type "ext:google-contacts")
@@ -132,10 +127,6 @@
(declare-function markdown-pipe-at-bol-p "ext:markdown-mode")
(declare-function markdown-remove-gfm-checkbox-overlays "ext:markdown-mode")
-;; Forward declarations
-(defvar consult-grep-args)
-(defvar consult-ripgrep-args)
-(defvar consult-async-split-style)
(defvar google-contacts-expire-time)
(defvar google-contacts-history)
(defvar google-contacts-query-string)
@@ -144,7 +135,6 @@
(defvar hproperty:but-emphasize-flag)
(defvar org-fold-core-style)
(defvar org-link--link-folding-spec)
-(defvar org-roam-db-autosync-mode)
(defvar org-roam-directory)
(defvar plstore-cache-passphrase-for-symmetric-encryption)
(defvar reveal-auto-hide)
@@ -528,74 +518,20 @@ entry which begins with the parent string."
;;;###autoload
(defun hyrolo-consult-grep (&optional regexp max-matches path-list)
- "Interactively search `hyrolo-file-list' with a consult package grep command.
-Use ripgrep (rg) if found, otherwise, plain grep. Interactively
-show all matches from `hyrolo-file-list'. Initialize search with
+ "Interactively search paths with a consult package grep command.
+Search for optional REGEXP up to MAX-MATCHES in PATH-LIST or
`hyrolo-file-list'.
+
+Use ripgrep (rg) if found, otherwise, plain grep. Initialize search with
optional REGEXP and interactively prompt for changes. Limit matches
per file to the absolute value of MAX-MATCHES, if given and not 0. If
0, match to headlines only (lines that start with a '^[*#]+[ \t]+' regexp)."
(interactive "i\nP")
- (unless (package-installed-p 'consult)
- (package-install 'consult))
- (require 'consult)
- (let ((consult-version (hyrolo-get-consult-version)))
- ;; Multi-file support added after consult version "0.32"
- (when (not (and consult-version (string-greaterp consult-version "0.32")))
- (error "(hyrolo-consult-grep): consult package version is %s; update
required"
- consult-version)))
(let* ((grep-includes (concat "--include *.kot --include *.kotl"
" --include *.md --include *.markdown --include
*.mkd --include *.mdown --include *.mkdn --include *.mdwn"
" --include *.org --include *.otl --include
*.outl"))
- (ripgrep-globs "--glob
*.{kot,kotl,md,markdown,mkd,mdown,mkdn,mdwn,org,otl,outl}")
- (consult-grep-args
- (if (listp consult-grep-args)
- (append consult-grep-args (list grep-includes))
- (concat consult-grep-args " " grep-includes)))
- (consult-ripgrep-args
- (if (listp consult-ripgrep-args)
- (append consult-ripgrep-args (list ripgrep-globs))
- (concat consult-ripgrep-args " " ripgrep-globs)))
- (paths (if find-file-wildcards
- ;; Use only the directory of paths with wildcards
- ;; since the grep command filters to desired file
- ;; types much more efficiently.
- (mapcar (lambda (path)
- (if (string-match
"[\\/]?\\([^*?\\/]*[*?][^\\/]+\\'\\)" path)
- (substring path 0 (match-beginning 1))
- path))
- (or path-list hyrolo-file-list))
- (or path-list hyrolo-file-list))))
- (hyrolo-consult-grep-paths paths regexp max-matches)))
-
-;;;###autoload
-(defun hyrolo-consult-org-roam-grep (&optional regexp max-matches)
- "Interactively narrow and select Org Roam nodes by line.
-Use ripgrep (rg) if found, otherwise, plain grep to search Org
-files within `org-roam-directory'. Initialize search with
-optional REGEXP and interactively prompt for changes. Limit
-matches per file to the absolute value of MAX-MATCHES, if given
-and not 0. If 0, match to headlines only (lines that start with
-a '^[*#]+[ \t]+' regexp)."
- (interactive "i\nP")
- (hyrolo-org-roam-call-function
- (lambda ()
- (let ((consult-grep-args
- (if (listp consult-grep-args)
- (append consult-grep-args (list "--include *.org"))
- (concat consult-grep-args " --include *.org")))
- (consult-ripgrep-args
- (if (listp consult-ripgrep-args)
- (append consult-ripgrep-args (list "--glob *.org"))
- (concat consult-ripgrep-args " --glob *.org"))))
- (hyrolo-consult-grep-paths (list org-roam-directory) regexp
max-matches)))))
-
-;;;###autoload
-(defun hyrolo-consult-org-roam-title ()
- "Interactively narrow and select Org Roam nodes by title."
- (interactive)
- (hyrolo-org-roam-call-function
- (lambda ()
- (org-roam-node-find nil nil (lambda (node) (zerop (org-roam-node-level
node)))))))
+ (ripgrep-globs "--glob
*.{kot,kotl,md,markdown,mkd,mdown,mkdn,mdwn,org,otl,outl}"))
+ (hsys-consult-grep grep-includes ripgrep-globs
+ regexp max-matches (or path-list hyrolo-file-list))))
;;;###autoload
(defun hyrolo-display-matches (&optional display-buf return-to-buffer)
@@ -1866,7 +1802,7 @@ returned to the number given."
OPTIONAL prefix arg, MAX-MATCHES, limits the number of matches
returned to the number given."
(interactive "sFind Org Roam directory string (or logical sexpression): \nP")
- (hyrolo-org-roam-call-function
+ (hsys-consult--org-roam-call-function
(lambda ()
(let ((hyrolo-file-list (directory-files org-roam-directory t "\\.org$")))
(hyrolo-fgrep string max-matches)))))
@@ -2913,67 +2849,6 @@ HYROLO-BUF may be a file-name, `buffer-name', or buffer."
hyrolo-buf))
(buffer-list))))
-(defun hyrolo-consult-grep-paths (paths &optional regexp max-matches)
- "Interactively search PATHS with a consult package grep command.
-Use ripgrep (rg) if found, otherwise, plain grep. Interactively
-show all matches from PATHS; see the documentation for the `dir'
-argument in `consult-grep' for valid values of PATHS.
-
-Initialize search with optional REGEXP and interactively prompt
-for changes. Limit matches per file to the absolute value of
-MAX-MATCHES, if given and not 0. If 0, match to headlines
-only (lines that start with a '^[*#]+[ ]t]+' regexp)."
- (unless (package-installed-p 'consult)
- (package-install 'consult))
- (require 'consult)
- (let ((consult-version (hyrolo-get-consult-version)))
- ;; Multi-file support added after consult version "0.32"
- (when (not (and consult-version (string-greaterp consult-version "0.32")))
- (error "(hyrolo-consult-grep): consult package version is %s; update
required"
- consult-version)))
- (when max-matches
- (setq max-matches (prefix-numeric-value max-matches)))
- (when (and (integerp max-matches) (zerop max-matches))
- ;; Final space in leading regexp in next line makes it work with
- ;; the Orderless package.
- (setq regexp (concat "^[*#]+[ \t]+ " (or regexp ""))))
- (let ((consult-grep-args (if (and (integerp max-matches) (not (zerop
max-matches)))
- (if (listp consult-grep-args)
- (append consult-grep-args
- (list (format "-m %d" (abs
max-matches))))
- (concat consult-grep-args
- (format " -m %d" (abs max-matches))))
- consult-grep-args))
- (consult-ripgrep-args (if (and (integerp max-matches) (not (zerop
max-matches)))
- (if (listp consult-ripgrep-args)
- (append consult-ripgrep-args
- (list (format "-m %d" (abs
max-matches))))
- (concat consult-ripgrep-args
- (format " -m %d" (abs
max-matches))))
- consult-ripgrep-args))
- (grep-func (cond ((executable-find "rg")
- #'consult-ripgrep)
- (t #'consult-grep))))
- ;; Consult split style usually uses '#' as a separator char but
- ;; that interferes with matching to Markdown # chars at the start
- ;; of a line in the regexp, so disable the separator char as it is
- ;; not needed for simple regexp searches.
- (let ((consult-async-split-style nil))
- (funcall grep-func paths regexp))))
-
-(defun hyrolo-org-roam-call-function (func)
- "Install Org Roam and then call an Org Roam FUNC."
- (unless (package-installed-p 'org-roam)
- (package-install 'org-roam))
- (require 'org-roam)
- (unless (file-readable-p org-roam-directory)
- (make-directory org-roam-directory))
- (unless org-roam-db-autosync-mode
- (org-roam-db-autosync-mode))
- (if (file-readable-p org-roam-directory)
- (funcall func)
- (error "`org-roam-directory', \"%s\", does not exist" org-roam-directory)))
-
(defun hyrolo-current-date ()
"Return the current date (a string) in a form used for rolo entry insertion."
(format-time-string hyrolo-date-format))
@@ -3000,17 +2875,6 @@ a default of MM/DD/YYYY."
", "
(substring name-str (match-beginning first) (match-end first)))))
-(defun hyrolo-get-consult-version ()
- "Return the string version of the installed consult package or nil."
- (let* ((consult-file (find-library-name "consult"))
- (buffer-existed (get-file-buffer consult-file))
- (buffer-modified (when buffer-existed (buffer-modified-p
buffer-existed)))
- (buf (or buffer-existed (find-file-noselect consult-file))))
- (with-current-buffer buf
- (prog1 (package-get-version)
- (unless buffer-modified
- (kill-buffer buf))))))
-
(defun hyrolo-highlight-matches (regexp start end)
"Highlight matches for REGEXP in region from START to END."
(when (fboundp 'hproperty:but-add)
diff --git a/hywiki.el b/hywiki.el
index d0fdda29fd..aff46bfa75 100644
--- a/hywiki.el
+++ b/hywiki.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Apr-24 at 22:41:13
-;; Last-Mod: 29-Jun-24 at 18:56:47 by Bob Weiner
+;; Last-Mod: 6-Jul-24 at 00:05:17 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -106,7 +106,9 @@
(require 'hpath)
(require 'hypb)
(require 'hproperty)
+(require 'hsys-consult)
(require 'outline) ;; For `outline-mode-syntax-table'
+(require 'thingatpt)
(eval-and-compile
'(when (require 'company nil t)
@@ -470,15 +472,25 @@ nil, else return the file name of the page."
(goto-char (if start-flag (point-min) (point-max)))
page-file))))))
+(defun hywiki-at-tags-p (&optional at-tag-flag)
+ "Return non-nil if point is in a HyWiki buffer and at Org tags."
+ (and (or at-tag-flag (hsys-org-at-tags-p))
+ (or (hywiki-in-page-p) (string-prefix-p "*HyWiki Tags*"
(buffer-name)))))
+
;;;###autoload
-(defun hywiki-consult-grep ()
- "Prompt for search terms and run consult grep over `hywiki-directory'.
-Actual grep function used is given by the variable,
-`hsys-org-consult-grep-func'."
- (interactive)
- (require 'hsys-org)
- (let ((org-directory hywiki-directory))
- (hsys-org-consult-grep)))
+(defun hywiki-consult-grep (&optional regexp max-matches path-list)
+ "Interactively search `hywiki-directory' with a consult package grep command.
+Search for optional REGEXP up to MAX-MATCHES in PATH-LIST or
`hywiki-directory'.
+
+Use ripgrep (rg) if found, otherwise, plain grep. Initialize search with
+optional REGEXP and interactively prompt for changes. Limit matches
+per file to the absolute value of MAX-MATCHES, if given and not 0. If
+0, match to headlines only (lines that start with a '^[*#]+[ \t]+' regexp)."
+ (interactive "i\nP")
+ (let* ((grep-includes "--include *.org")
+ (ripgrep-globs "--glob *.org"))
+ (hsys-consult-grep grep-includes ripgrep-globs
+ regexp max-matches (or path-list (list
hywiki-directory)))))
(defun hywiki-maybe-at-wikiword-beginning ()
"Return non-nil if previous character is one preceding a HyWiki word.
@@ -557,26 +569,27 @@ interactively), limit dehighlighting to the region."
(/= hywiki--directory-mod-time (hywiki-directory-get-mod-time))))
;;;###autoload
-(defun hywiki-grep-tags (&optional todo-only grep-buffer-name)
+(defun hywiki-tags-view (&optional todo-only match view-buffer-name)
"Prompt for colon-separated Org tags and display matching HyWiki page
sections.
With optional prefix arg TODO-ONLY, limit matches to HyWiki Org
-todo items only. With optional GREP-BUFFER-NAME, use that rather
+todo items only. With optional VIEW-BUFFER-NAME, use that rather
than the default, \"*HyWiki Tags*\"."
(interactive "P")
(require 'org-agenda)
(let* ((org-agenda-files (list hywiki-directory))
- (org-agenda-buffer-name (or grep-buffer-name "*HyWiki Tags*"))
+ (org-agenda-buffer-name (or view-buffer-name "*HyWiki Tags*"))
;; `org-tags-view' is mis-written to require setting this next
;; tmp-name or it will not properly name the displayed buffer.
(org-agenda-buffer-tmp-name org-agenda-buffer-name))
;; This prompts for the tags to match and uses `org-agenda-files'.
- (org-tags-view todo-only)
+ (org-tags-view todo-only match)
(when (equal (buffer-name) org-agenda-buffer-name)
;; Set up {C-u r} redo cmd
(let (buffer-read-only)
(put-text-property (point-min) (point-max) 'org-redo-cmd
- `(hywiki-grep-tags
+ `(hywiki-tags-view
,todo-only
+ nil
,org-agenda-buffer-name)))
(forward-line 2))))
@@ -1035,3 +1048,5 @@ Highlight/dehighlight HyWiki page names across all frames
on change."
#'hywiki-maybe-highlight-page-names-in-frame nil 'eq)
(provide 'hywiki)
+
+;;; hywiki.el ends here
diff --git a/man/hyperbole.html b/man/hyperbole.html
index 1f06d5b58f..f6f298a05c 100644
--- a/man/hyperbole.html
+++ b/man/hyperbole.html
@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for GNU Hyperbole
-(Edition 9.0.2pre, Published June, 2024).
+(Edition 9.0.2pre, Published July, 2024).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
@@ -108,7 +108,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
<PRE>
Edition 9.0.2pre
-Printed June 30, 2024.
+Printed July 6, 2024.
Published by the Free Software Foundation, Inc.
Author: Bob Weiner
@@ -2191,6 +2191,7 @@ Next: <a href="#Action-Buttons" accesskey="n"
rel="next">Action Buttons</a>, Pre
<span id="index-ibtypes_002c-list-of"></span>
<span id="index-implicit-button-types"></span>
+<span id="index-file_002c-hibtypes_002eel-1"></span>
<p>Below is a list of standard implicit button types in the order in
which Hyperbole tries to match to the types when looking for an
implicit button (decreasing priority order). <kbd>{C-h h i t
@@ -2211,6 +2212,9 @@ priority).
<span id="index-org_002dmeta_002dreturn"></span>
<span id="index-hsys_002dorg_002dmode_002dp"></span>
<span id="index-file_002c-hsys_002dorg_002eel"></span>
+<span id="index-smart-org"></span>
+<span id="index-Action-Key_002c-Org-Mode"></span>
+<span id="index-Assist-Key_002c-Org-Mode"></span>
</dd>
<dt><span><code>smart-org</code></span></dt>
<dd><p><code>smart-org</code> is not an actual implicit button type, just an
Elisp function,
@@ -2220,15 +2224,27 @@ but it behaves similarly, so it is documented here.
<code>org-mode</code>, <code>org-agenda-mode</code>, <code>outshine-mode</code>
or <code>poporg-mode</code>. (See the function <code>hsys-org-mode-p</code>).
</p>
+<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys"></span>
<p>Hyperbole does quite a few things for Org mode users. When the Action
-Key is pressed:
+Key is pressed and <code>hsys-org-enable-smart-keys</code> is
‘<samp>t</samp>’:
</p>
<ol>
-<li> If on an Org todo keyword, cycle through the keywords in
+<li> <span id="index-org-view-tags"></span>
+<span id="index-org-tags"></span>
+<span id="index-hsys_002dorg_002dagenda_002dtags_002dp"></span>
+On an Org tag, call <code>hsys-org-agenda-tags-p</code> and an
+appropriate view tags function based on current directory or buffer
+name, matching to the tag. If on a colon between tags, match to all
+tags on the line.
+
+</li><li> 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 view item, jump to the item for editing.
+</li><li> On an Org agenda view item, jump to the item for editing.
+<p>When the Action Key is pressed and <code>hsys-org-enable-smart-keys</code>
+is either ‘<samp>t</samp>’ or ‘<samp>'buttons</samp>’:
+</p>
</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.
@@ -2256,7 +2272,15 @@ standard binding of <kbd>{M-<span
class="key">RET</span>}</kbd>, <code>org-meta-
except in these contexts:
</p>
<ol>
-<li> On an Org todo keyword, move to the first todo keyword in the next
+<li> <span id="index-org-tags_002c-consult-grep"></span>
+<span id="index-consult-grep-org-tags"></span>
+<span id="index-hsys_002dconsult_002dorg_002dgrep_002dtags_002dp"></span>
+On an Org tag, call <code>hsys-consult-org-grep-tags-p</code> and an
+appropriate consult grep function based on current directory or buffer
+name, prompting with and matching to the tag. If on a colon between
+tags, prompt and match to all tags on the line.
+
+</li><li> On an Org todo keyword, move to the first todo keyword in the next
set, if any.
</li><li> On an Org mode link or agenda view item, display Hyperbole
@@ -2275,7 +2299,7 @@ or #+end_example header, remove any associated results.
through views of the whole buffer outline.
</li></ol>
-<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys"></span>
+<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys-1"></span>
<span id="index-enable-org_002dmode-support"></span>
<span id="index-disable-org_002dmode-support"></span>
<span id="index-inhibit-org_002dmode-support"></span>
@@ -3541,7 +3565,7 @@ implicit button, only the explicit button will be
selected. Explicit
button labels are not allowed to overlap; Hyperbole’s behavior in such
cases is undefined.
</p>
-<span id="index-ibtype_002c-evaluation-order"></span>
+<span id="index-ibtype-priority"></span>
<p>If there is no explicit button at point during a selection request,
then each implicit button type predicate is tested in turn until one
returns non-nil or all are exhausted. Since two implicit button types
@@ -7328,7 +7352,7 @@ use <kbd>{C-x C-e}</kbd> <code>(eval-last-sexp)</code>
(works in most modes).
Hyperbole types, if needed.
</p>
<span id="index-file_002c-hactypes_002eel"></span>
-<span id="index-file_002c-hibtypes_002eel-1"></span>
+<span id="index-file_002c-hibtypes_002eel-2"></span>
<p>The following subsections explain the specifics of Hyperbole type
definitions which are beyond standard practice for Emacs Lisp programming.
See the definitions of the standard types in <samp>hactypes.el</samp>
@@ -8174,14 +8198,15 @@ abstraction.
wrappers around common search commands like grep, ripgrep, find and
locate.
</p>
-<p>Hyperbole uses this package to provide convenience commands for
line-oriented searches.
+<p>Hyperbole uses this package to provide convenience commands for interactive,
+line-oriented searches.
</p><dl compact="compact">
<dt><span><kbd>{M-x hsys-org-roam-consult-grep <span
class="key">RET</span>}</kbd></span></dt>
-<dd><p>Searches Org Roam notes in <code>org-roam-directory</code> with consult.
+<dd><p>Interactively searches Org Roam notes in
<code>org-roam-directory</code> with consult.
</p>
</dd>
<dt><span><kbd>{M-x hsys-org-consult-grep <span
class="key">RET</span>}</kbd></span></dt>
-<dd><p>Searches Org notes in <code>org-directory</code> with consult.
+<dd><p>Interactively searches Org notes in <code>org-directory</code> with
consult.
</p></dd>
</dl>
@@ -10831,7 +10856,7 @@ Next: <a href="#Smart-Key-_002d-Ivy" accesskey="n"
rel="next">Smart Key - Ivy</a
</div>
<span id="Smart-Key-_002d-Org-Mode-1"></span><h4 class="subsection">E.2.2
Smart Key - Org Mode</h4>
-<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys-1"></span>
+<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys-2"></span>
<span id="index-Org-mode-1"></span>
<div class="format">
<pre class="format">When in an Org mode context and
<code>hsys-org-enable-smart-keys</code> is non-nil:
@@ -12620,7 +12645,7 @@ Hyperbole does. For a list of some differences, see:
agenda and diary management, so it is very complementary to Hyperbole.
It did not exist when Hyperbole was first developed.
</p>
-<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys-2"></span>
+<span id="index-hsys_002dorg_002denable_002dsmart_002dkeys-3"></span>
<p>Smart Key support for Org-mode is already in Hyperbole. Use the
<code>hsys-org-enable-smart-keys</code> customization variable to control
the Smart Keys and <kbd>{M-<span class="key">RET</span>}</kbd> when in
Org-mode with
@@ -13753,7 +13778,8 @@ Next: <a href="#Concept-Index" accesskey="n"
rel="next">Concept Index</a>, Previ
<tr><td></td><td valign="top"><a
href="#index-file_002c-hib_002ddebbugs_002eel">file,
hib-debbugs.el</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-file_002c-hib_002dkbd_002eel">file,
hib-kbd.el</a>:</td><td> </td><td valign="top"><a
href="#Programmatic-Implicit-Button-Types">Programmatic Implicit Button
Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file_002c-hibtypes_002eel">file,
hibtypes.el</a>:</td><td> </td><td valign="top"><a
href="#Implicit-Buttons">Implicit Buttons</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-file_002c-hibtypes_002eel-1">file,
hibtypes.el</a>:</td><td> </td><td valign="top"><a
href="#Creating-Types">Creating Types</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-file_002c-hibtypes_002eel-1">file,
hibtypes.el</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-file_002c-hibtypes_002eel-2">file,
hibtypes.el</a>:</td><td> </td><td valign="top"><a
href="#Creating-Types">Creating Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file_002c-hmail_002eel">file,
hmail.el</a>:</td><td> </td><td valign="top"><a
href="#Buttons-in-Mail">Buttons in Mail</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-file_002c-hmouse_002dkey_002eel">file,
hmouse-key.el</a>:</td><td> </td><td valign="top"><a
href="#Questions-and-Answers">Questions and Answers</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-file_002c-hmouse_002dsh_002eel">file,
hmouse-sh.el</a>:</td><td> </td><td valign="top"><a
href="#Questions-and-Answers">Questions and Answers</a></td></tr>
@@ -13857,14 +13883,17 @@ Next: <a href="#Concept-Index" accesskey="n"
rel="next">Concept Index</a>, Previ
<tr><td></td><td valign="top"><a
href="#index-hproperty_003abut_002dflash_002dtime_002dseconds">hproperty:but-flash-time-seconds</a>:</td><td> </td><td
valign="top"><a href="#Button-Colors">Button Colors</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hproperty_003abut_002dhighlight_002dflag">hproperty:but-highlight-flag</a>:</td><td> </td><td
valign="top"><a href="#Button-Colors">Button Colors</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hproperty_003acycle_002dbut_002dcolor"><code>hproperty:cycle-but-color</code></a>:</td><td> </td><td
valign="top"><a href="#Button-Colors">Button Colors</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-hsys_002dconsult_002dorg_002dgrep_002dtags_002dp"><code>hsys-consult-org-grep-tags-p</code></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-hsys_002dflymake_002ddisplay_002dthis_002dor_002dnext_002dissue"><code>hsys-flymake-display-this-or-next-issue</code></a>:</td><td> </td><td
valign="top"><a href="#Smart-Key-_002d-Flymake-Mode">Smart Key - Flymake
Mode</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hsys_002dflymake_002dinsert_002dissue_002dat_002dpoint_0029"><code>hsys-flymake-insert-issue-at-point)</code></a>:</td><td> </td><td
valign="top"><a href="#Smart-Key-_002d-Flymake-Mode">Smart Key - Flymake
Mode</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hsys_002dflymake_002dtoggle"><code>hsys-flymake-toggle</code></a>:</td><td> </td><td
valign="top"><a href="#Smart-Key-_002d-Flymake-Mode">Smart Key - Flymake
Mode</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hsys_002dflymake_002dtoggle_002dwraparound"><code>hsys-flymake-toggle-wraparound</code></a>:</td><td> </td><td
valign="top"><a href="#Smart-Key-_002d-Flymake-Mode">Smart Key - Flymake
Mode</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-hsys_002dorg_002dagenda_002dtags_002dp"><code>hsys-org-agenda-tags-p</code></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-hsys_002dorg_002dconsult_002dgrep"><code>hsys-org-consult-grep</code></a>:</td><td> </td><td
valign="top"><a href="#Glossary">Glossary</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hsys_002dorg_002denable_002dsmart_002dkeys">hsys-org-enable-smart-keys</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-hsys_002dorg_002denable_002dsmart_002dkeys-1">hsys-org-enable-smart-keys</a>:</td><td> </td><td
valign="top"><a href="#Smart-Key-_002d-Org-Mode">Smart Key - Org
Mode</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-hsys_002dorg_002denable_002dsmart_002dkeys-2">hsys-org-enable-smart-keys</a>:</td><td> </td><td
valign="top"><a href="#Questions-and-Answers">Questions and
Answers</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-hsys_002dorg_002denable_002dsmart_002dkeys-1">hsys-org-enable-smart-keys</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-hsys_002dorg_002denable_002dsmart_002dkeys-2">hsys-org-enable-smart-keys</a>:</td><td> </td><td
valign="top"><a href="#Smart-Key-_002d-Org-Mode">Smart Key - Org
Mode</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-hsys_002dorg_002denable_002dsmart_002dkeys-3">hsys-org-enable-smart-keys</a>:</td><td> </td><td
valign="top"><a href="#Questions-and-Answers">Questions and
Answers</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-hsys_002dorg_002dmode_002dp"><code>hsys-org-mode-p</code></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-hsys_002dorg_002droam_002dconsult_002dgrep"><code>hsys-org-roam-consult-grep</code></a>:</td><td> </td><td
valign="top"><a href="#Glossary">Glossary</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-htype_002dcreate_002dhook">htype-create-hook</a>:</td><td> </td><td
valign="top"><a href="#Hook-Variables">Hook Variables</a></td></tr>
@@ -14327,6 +14356,7 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function, Variable and Fi
<tr><td></td><td valign="top"><a
href="#index-Action-Key_002c-cell-argument">Action Key, cell
argument</a>:</td><td> </td><td valign="top"><a
href="#Relocating-and-Copying">Relocating and Copying</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-Action-Key_002c-hide-or-show-cell">Action Key, hide or show
cell</a>:</td><td> </td><td valign="top"><a
href="#Hiding-and-Showing">Hiding and Showing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Action-Key_002c-klink">Action
Key, klink</a>:</td><td> </td><td valign="top"><a
href="#Klinks">Klinks</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Action-Key_002c-Org-Mode">Action
Key, Org Mode</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-Action-Key_002c-web-browsing">Action Key, web
browsing</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-Action-Mouse-Key">Action Mouse
Key</a>:</td><td> </td><td valign="top"><a href="#Thing-Selection">Thing
Selection</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Action-Mouse-Key-1">Action Mouse
Key</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-_002d-Delimited-Things">Smart Key - Delimited
Things</a></td></tr>
@@ -14360,6 +14390,7 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function, Variable and Fi
<tr><td></td><td valign="top"><a href="#index-Assist-Key-drag">Assist Key
drag</a>:</td><td> </td><td valign="top"><a href="#By-Dragging">By
Dragging</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Assist-Key-in-minibuffer">Assist
Key in minibuffer</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-Argument-Selection">Smart Key Argument Selection</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-Assist-Key_002c-listing-attributes">Assist Key, listing
attributes</a>:</td><td> </td><td valign="top"><a
href="#Cell-Attributes">Cell Attributes</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Assist-Key_002c-Org-Mode">Assist
Key, Org Mode</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-Assist-Mouse-Key">Assist Mouse
Key</a>:</td><td> </td><td valign="top"><a href="#Thing-Selection">Thing
Selection</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Assist-Mouse-Key-1">Assist Mouse
Key</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-_002d-Delimited-Things">Smart Key - Delimited
Things</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Assist-Mouse-Key-drag">Assist
Mouse Key drag</a>:</td><td> </td><td valign="top"><a
href="#Smart-Mouse-Key-Drags">Smart Mouse Key Drags</a></td></tr>
@@ -14527,6 +14558,7 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function, Variable and Fi
<tr><td></td><td valign="top"><a href="#index-completion_002c-Ivy">completion,
Ivy</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-_002d-Ivy">Smart Key - Ivy</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-concepts">concepts</a>:</td><td> </td><td valign="top"><a
href="#Menus">Menus</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-configuration">configuration</a>:</td><td> </td><td
valign="top"><a href="#Customization">Customization</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-consult-grep-org-tags">consult
grep org tags</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-consult-package">consult
package</a>:</td><td> </td><td valign="top"><a
href="#Glossary">Glossary</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-consult_002dorg_002droam-package">consult-org-roam
package</a>:</td><td> </td><td valign="top"><a
href="#Glossary">Glossary</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-ConsultFind">ConsultFind</a>:</td><td> </td><td
valign="top"><a href="#HyRolo-Menu">HyRolo Menu</a></td></tr>
@@ -14858,8 +14890,8 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function, Variable and Fi
<tr><td></td><td valign="top"><a
href="#index-ibtype-ibut_003alabel_002dset">ibtype
ibut:label-set</a>:</td><td> </td><td valign="top"><a
href="#Programmatic-Implicit-Button-Types">Programmatic Implicit Button
Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ibtype-predicate">ibtype
predicate</a>:</td><td> </td><td valign="top"><a
href="#Programmatic-Implicit-Button-Types">Programmatic Implicit Button
Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ibtype-priorities">ibtype
priorities</a>:</td><td> </td><td valign="top"><a
href="#Programmatic-Implicit-Button-Types">Programmatic Implicit Button
Types</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-ibtype-priority">ibtype
priority</a>:</td><td> </td><td valign="top"><a
href="#Button-Type-Precedence">Button Type Precedence</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ibtype-return-val">ibtype return
val</a>:</td><td> </td><td valign="top"><a
href="#Programmatic-Implicit-Button-Types">Programmatic Implicit Button
Types</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-ibtype_002c-evaluation-order">ibtype, evaluation
order</a>:</td><td> </td><td valign="top"><a
href="#Button-Type-Precedence">Button Type Precedence</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ibtype_002c-help">ibtype,
help</a>:</td><td> </td><td valign="top"><a
href="#Programmatic-Implicit-Button-Types">Programmatic Implicit Button
Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ibtypes_002c-list-of">ibtypes,
list of</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-ibuffer-menu">ibuffer
menu</a>:</td><td> </td><td valign="top"><a
href="#Smart-Mouse-Key-Modeline-Clicks">Smart Mouse Key Modeline
Clicks</a></td></tr>
@@ -15234,6 +15266,9 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function, Variable and Fi
<tr><td></td><td valign="top"><a href="#index-Org-mode-1">Org
mode</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-_002d-Org-Mode">Smart Key - Org Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Org-Roam-IDs">Org Roam
IDs</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-Org-tables">Org
tables</a>:</td><td> </td><td valign="top"><a
href="#Promoting-and-Demoting">Promoting and Demoting</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-org-tags">org
tags</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-org-tags_002c-consult-grep">org
tags, consult grep</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-org-view-tags">org view
tags</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-org_002dmode">org-mode</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-Org_002dmode">Org-mode</a>:</td><td> </td><td valign="top"><a
href="#Questions-and-Answers">Questions and Answers</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002drifle-package">org-rifle
package</a>:</td><td> </td><td valign="top"><a
href="#Glossary">Glossary</a></td></tr>
@@ -15434,6 +15469,7 @@ Previous: <a href="#Function" accesskey="p"
rel="prev">Function, Variable and Fi
<tr><td></td><td valign="top"><a href="#index-Smart-Mouse-Key-drag">Smart
Mouse Key drag</a>:</td><td> </td><td valign="top"><a
href="#Editing">Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Smart-Mouse-Key-toggle">Smart
Mouse Key toggle</a>:</td><td> </td><td valign="top"><a
href="#Default-Hyperbole-Bindings">Default Hyperbole Bindings</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Smart-Mouse-Keys">Smart Mouse
Keys</a>:</td><td> </td><td valign="top"><a href="#Smart-Mouse-Keys">Smart
Mouse Keys</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-smart-org">smart
org</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-smart-selection">smart
selection</a>:</td><td> </td><td valign="top"><a
href="#Smart-Key-Thing-Selection">Smart Key Thing Selection</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-social-media">social
media</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-social-reference">social
reference</a>:</td><td> </td><td valign="top"><a
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
diff --git a/man/hyperbole.info b/man/hyperbole.info
index 944cc021dd..4db590115f 100644
Binary files a/man/hyperbole.info and b/man/hyperbole.info differ
diff --git a/man/hyperbole.pdf b/man/hyperbole.pdf
index fb159a9fd6..abd09ac500 100644
Binary files a/man/hyperbole.pdf and b/man/hyperbole.pdf differ
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index c2aab2c203..7aeacaba88 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: 30-Jun-24 at 12:04:15 by Bob Weiner
+@c Last-Mod: 6-Jul-24 at 00:42:11 by Bob Weiner
@c %**start of header (This is for running Texinfo on a region.)
@setfilename hyperbole.info
@@ -25,8 +25,8 @@
@set txicodequoteundirected
@set txicodequotebacktick
-@set UPDATED June, 2024
-@set UPDATED-MONTH June 2024
+@set UPDATED July, 2024
+@set UPDATED-MONTH July 2024
@set EDITION 9.0.2pre
@set VERSION 9.0.2pre
@@ -159,7 +159,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
<PRE>
Edition 9.0.2pre
-Printed June 30, 2024.
+Printed July 6, 2024.
Published by the Free Software Foundation, Inc.
Author: Bob Weiner
@@ -201,7 +201,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@example
Edition 9.0.2pre
-June 30, 2024
+July 6, 2024
Published by the Free Software Foundation, Inc.
Author: Bob Weiner
@@ -2281,6 +2281,7 @@ by any number of :, - or = separator characters,
including none.
@cindex ibtypes, list of
@cindex implicit button types
+@vindex file, hibtypes.el
Below is a list of standard implicit button types in the order in
which Hyperbole tries to match to the types when looking for an
implicit button (decreasing priority order). @bkbd{C-h h i t
@@ -2301,6 +2302,9 @@ priority).
@findex org-meta-return
@findex hsys-org-mode-p
@vindex file, hsys-org.el
+@cindex smart org
+@cindex Action Key, Org Mode
+@cindex Assist Key, Org Mode
@item smart-org
@code{smart-org} is not an actual implicit button type, just an Elisp function,
but it behaves similarly, so it is documented here.
@@ -2309,17 +2313,31 @@ Hyperbole recognizes Org mode constructs in any of
these modes:
@code{org-mode}, @code{org-agenda-mode}, @code{outshine-mode}
or @code{poporg-mode}. (See the function @code{hsys-org-mode-p}).
+@vindex hsys-org-enable-smart-keys
@noindent
Hyperbole does quite a few things for Org mode users. When the Action
-Key is pressed:
+Key is pressed and @code{hsys-org-enable-smart-keys} is @samp{t}:
@enumerate
+@cindex org view tags
+@cindex org tags
+@findex hsys-org-agenda-tags-p
+@item
+On an Org tag, call @code{hsys-org-agenda-tags-p} and an
+appropriate view tags function based on current directory or buffer
+name, matching to the tag. If on a colon between tags, match to all
+tags on the line.
+
@item
-If on an Org todo keyword, cycle through the keywords in
+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 view item, jump to the item for editing.
+On an Org agenda view item, jump to the item for editing.
+
+@noindent
+When the Action Key is pressed and @code{hsys-org-enable-smart-keys}
+is either @samp{t} or @samp{'buttons}:
@item
Within a radio or internal target or a link to it, jump between
@@ -2357,6 +2375,15 @@ When the Assist Key is pressed, it behaves just like the
Action Key
except in these contexts:
@enumerate
+@cindex org tags, consult grep
+@cindex consult grep org tags
+@findex hsys-consult-org-grep-tags-p
+@item
+On an Org tag, call @code{hsys-consult-org-grep-tags-p} and an
+appropriate consult grep function based on current directory or buffer
+name, prompting with and matching to the tag. If on a colon between
+tags, prompt and match to all tags on the line.
+
@item
On an Org todo keyword, move to the first todo keyword in the next
set, if any.
@@ -7631,13 +7658,14 @@ An Emacs extension package that provides asynchronous
search and narrow
wrappers around common search commands like grep, ripgrep, find and
locate.
-Hyperbole uses this package to provide convenience commands for line-oriented
searches.
+Hyperbole uses this package to provide convenience commands for interactive,
+line-oriented searches.
@table @kbd
@item @{M-x hsys-org-roam-consult-grep @key{RET}@}
-Searches Org Roam notes in @code{org-roam-directory} with consult.
+Interactively searches Org Roam notes in @code{org-roam-directory} with
consult.
@item @{M-x hsys-org-consult-grep @key{RET}@}
-Searches Org notes in @code{org-directory} with consult.
+Interactively searches Org notes in @code{org-directory} with consult.
@end table
@item Context
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/hyperbole 7e7b3296d2 1/2: smart-org - Add Org tag support via agenda and consult-grep searches,
ELPA Syncer <=