Skip to content

Commit 4921570

Browse files
authored
Merge pull request #871 from rswgnu/rsw
HyWiki reference in-buffer completion with company-mode or Corfu, as well as standard Emacs completion. hywiki-insert-link - Handle both page#section and wikiword refs
2 parents 6ffe7e7 + 65f9270 commit 4921570

8 files changed

Lines changed: 325 additions & 179 deletions

File tree

ChangeLog

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
2026-02-27 Mats Lidell <matsl@gnu.org>
2+
3+
* test/hywiki-yki-tests.el (hywiki-test--insert-with-point): Remove. Reuse
4+
similar function from hywiki-tests.el instead.
5+
(hywiki-test--get-buffer-text-with-point-and-highlight): Change to a
6+
more lifelike test that behaves the same in batch as interactively to
7+
solve the issue with the failing test for now. Use
8+
hywiki-tests--insert-by-char and remove not needed hywiki-mode calls.
9+
10+
2026-02-26 Bob Weiner <rsw@gnu.org>
11+
12+
* hywiki.el (hywiki-word-strip-suffix): Fix to strip any leading or trailing #
13+
and whitespace chars.
14+
(hywiki-format-grep-to-reference): Don't add double quotes so when used
15+
with completions, don't fail because the double quote is not included in
16+
the matched prefix.
17+
(hywiki-insert-link): Add double-quotes if link contains a space.
18+
(hywiki-completion-exit-function): Add.
19+
(hywiki-word-add-completion-at-point): Add call to above function in
20+
completion exit hooks that support normal completion, company and corfu.
21+
(hywiki-maybe-at-wikiword-beginning): Change when non-nil return value to
22+
be the preceding char or if at bol, then 0.
23+
(hywiki-word-add-completion-at-point, hywiki-completion-at-point):
24+
Add support for Corfu with :exit-function.
25+
126
2026-02-25 Mats Lidell <matsl@gnu.org>
227

328
* .github/workflows/docs.yml: New workflow
@@ -6,8 +31,50 @@
631
(doc-clean): Use make foreach for removing doc build artifacts. (Avoid
732
bash brace expansion.) Remove README.md.html and README.toc.md.
833

34+
2026-02-25 Bob Weiner <rsw@gnu.org>
35+
36+
* hbut.el (hbut:modify-syntax): Treat # as a symbol constituent to support
37+
'company-mode' completion in for 'hbut:syntax-table' and
38+
'help-mode-syntax-table'.
39+
40+
2026-02-22 Bob Weiner <rsw@gnu.org>
41+
42+
* README.md: Add "The Emacs Hyperbole" great article by Mike Hostetler.
43+
44+
* hywiki.el (hywiki-format-reference): Rename to 'hywiki-format-grep-to-reference';
45+
remove autoload.
46+
(hywiki-format-reference-to-grep): Add.
47+
(hywiki-completion-at-point): Rewrite and simplify.
48+
(hywiki-word-highlight-in-buffers): Add call to
49+
'hywiki-word-add-completion-at-point' to ensure has completion hook independent
50+
of whether the buffer's major mode changes.
51+
(hywiki-word-remove-completion-at-point): Add and call in
52+
'hywiki-word-dehighlight-in-buffers'.
53+
(hywiki-display-referent): Interactively, call 'hywiki-word-read'
54+
rather than 'hwyiki-page-read-reference'.
55+
(hywiki-read-page-reference): Rename to 'hywiki-page-read-reference'
56+
and return a HyWiki completion alist of pages when completing to pages only.
57+
(hywiki-format-reference-to-consult-grep): Add.
58+
59+
2026-02-21 Bob Weiner <rsw@gnu.org>
60+
61+
* hywiki.el (hywiki-consult-page-and-line): Change output from a list to the
62+
unparsed string returned as the selection by 'consult-grep'.
63+
(hywiki-consult-page-and-line): Rename to
64+
'hywiki-consult-page-and-headline)'.
65+
(hywiki-format-reference): Change arg 'page-and-line' to be
66+
an unparsed string returned from the above function.
67+
(hywiki-consult-page-and-headline, hywiki-read-page-reference,
68+
hywiki-word-read, hywiki-word-read-new, hywiki-page-read,
69+
hywiki-page-read-new): Add 'prompt' and 'initial' input arguments.
70+
971
2026-02-19 Bob Weiner <rsw@gnu.org>
1072

73+
* hywiki.el (hywiki-insert-link): Add optional prefix arg to link to a
74+
an existing wikiword only.
75+
(hywiki-insert-reference): Remove and merge capability into
76+
above function when called with a prefix arg.
77+
1178
* hui.el (hui:link-possible-types): Fix to include link-to-wikiword only if
1279
an existing referent is found.
1380

@@ -1344,7 +1411,7 @@
13441411
hyrolo.el (hyrolo-match-regexp)
13451412
hhist.el (*hhist*): Use defvar for const variables that are set later
13461413
than at their definition.
1347-
1414+
13481415
2025-08-10 Bob Weiner <rsw@gnu.org>
13491416

13501417
* test/hywiki-tests.el (hywiki-tests--with-face-test): Make default value be

README.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ otherwise, skip to the next section.
3434
- [Quick Introduction](https://youtu.be/K1MNUctggwI)
3535

3636
- [Top 10 ways Hyperbole amps up Emacs](https://emacsconf.org/2023/talks/hyperamp/)
37-
37+
3838
- [Introduction to Buttons](https://youtu.be/zoEht66N2PI)
3939

4040
- [Linking Personal Info with Implicit Buttons](https://emacsconf.org/2022/talks/buttons/)
@@ -44,19 +44,21 @@ otherwise, skip to the next section.
4444
- [HyRolo, fast contact/hierarchical record viewer](https://youtu.be/xdJGFdgKPFY)
4545

4646
- [Using Koutline for stream of thought journaling](https://emacsconf.org/2023/talks/koutline/)
47-
47+
4848
- [Build a Zettelkasten with HyRolo](https://emacsconf.org/2022/talks/rolodex/)
4949

5050
- [HyControl, fast Emacs frame and window manager](https://youtu.be/M3-aMh1ccJk)
5151

5252
- [Writing test cases for GNU Hyperbole](https://emacsconf.org/2023/talks/test/)
53-
53+
5454
- [Find/Web Search](https://youtu.be/8lMlJed0-OM)
5555

5656
- [Linking personal info with implicit buttons](https://youtu.be/TQ_fG7b1iHI)
5757

5858
## Articles
5959

60+
- [The Emacs Hyperbole](https://mike.hostetlerhome.com/emacs-hyperbole)
61+
6062
- [HyWiki: My Favorite Part of Hyperbole](https://kirankp.com/blog/gnu-hyperbole/)
6163

6264
- [Hyperbole VisionQuest Part 1](https://github.com/termitereform/JunkPile/blob/master/HyperboleNotes.org)
@@ -191,7 +193,7 @@ start moving further, faster.
191193
Once you have Emacs set up at your site, GNU Hyperbole may be
192194
installed by using the Emacs Package Manager. If you are not
193195
familiar with it, see the Packages section of the GNU Emacs Manual,
194-
[Emacs Packages](https://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html).
196+
[Emacs Packages](https://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html).
195197

196198
If you have Hyperbole 5.10 or higher already installed and simply want to
197199
upgrade it, invoke the Emacs Package Manager with {M-x list-packages RET},
@@ -267,10 +269,10 @@ Hyperbole also includes the Hyperbole Manual, a full reference manual,
267269
not a simple introduction. It is included in the "man/" subdirectory
268270
of the Hyperbole package directory in four forms:
269271

270-
[hyperbole.info](man/hyperbole.info) - online Info browser version
271-
[hyperbole.html](man/hyperbole.html) - web version
272-
[hyperbole.pdf](man/hyperbole.pdf) - printable version
273-
[hyperbole.texi](man/hyperbole.texi) - source version
272+
[hyperbole.info](man/hyperbole.info) - online Info browser version
273+
[hyperbole.html](man/hyperbole.html) - web version
274+
[hyperbole.pdf](man/hyperbole.pdf) - printable version
275+
[hyperbole.texi](man/hyperbole.texi) - source version
274276

275277
The Hyperbole package installation places the Info version of this manual
276278
where needed and adds an entry for Hyperbole into the Info directory under
@@ -323,7 +325,7 @@ Hyperbole consists of six parts:
323325
automatically recognized within text that perform actions,
324326
e.g. bug#24568 displays the bug status information for that bug
325327
number.
326-
328+
327329
These actions may be links or arbitrary Lisp expressions. So
328330
for example, you could create your own button type of
329331
Wikipedia searches that jumped to the named Wikipedia page
@@ -403,7 +405,7 @@ to a file or executing a shell command.
403405
There are three categories of Hyperbole buttons:
404406

405407
1. *Explicit Buttons*
406-
created by Hyperbole, accessible from within a single document;
408+
created by Hyperbole, accessible from within a single document;
407409

408410
2. *Global Buttons*
409411
created by Hyperbole, accessible anywhere within a user's
@@ -457,15 +459,15 @@ Some of Hyperbole's most important features include:
457459

458460
Typical Hyperbole applications include:
459461

460-
- *Personal Information Management*
462+
- *Personal Information Management*
461463
Overlapping link paths provide a variety of views into an
462464
information space. A single key press activates buttons
463465
regardless of their types, making navigation easy.
464466

465467
A search facility locates buttons in context and permits quick
466468
selection.
467469

468-
- *Documentation Browsing*
470+
- *Documentation Browsing*
469471
Embedding cross-references in a favorite documentation format.
470472

471473
Addition of a point-and-click interface to existing documentation.
@@ -474,18 +476,18 @@ Typical Hyperbole applications include:
474476
of an identifier from its use within code or its reference within
475477
documentation.
476478

477-
- *Brainstorming*
479+
- *Brainstorming*
478480
Capture of ideas and then quick reorganization with the Hyperbole
479481
Koutliner. Link to related ideas, eliminating the need to copy
480482
and paste information into a single place.
481483

482-
- *Help/Training Systems*
484+
- *Help/Training Systems*
483485
Creation of tutorials with embedded buttons that show students how
484486
things work while explaining the concepts, e.g. an introduction
485487
to UNIX commands. This technique can be much more effective than
486488
descriptions alone.
487489

488-
- *Archive Managers*
490+
- *Archive Managers*
489491
Supplementation of programs that manage archives from incoming
490492
information stream, having them add topic-based buttons that
491493
link to the archive holdings. Users can then search and create
@@ -547,19 +549,19 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
547549
well-thought out, poised engineering. It may be from the 90s, but it
548550
feels like a breath of fresh air to me.
549551

550-
-- de_sonnaz on reddit
552+
-- de_sonnaz on reddit
551553

552554

553555
\*\*\* MAN I love Hyperbole!!! Wow! \*\*\*
554556

555-
-- Ken Olstad
557+
-- Ken Olstad
556558
Cheyenne Software, Inc.
557559

558560
-------
559561

560562
I *love* koutlines.
561563

562-
-- Bob Glickstein
564+
-- Bob Glickstein
563565
Z-Code Software Corporation
564566

565567
-------
@@ -580,7 +582,7 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
580582
but due to the ease of installation and the quality of the documentation,
581583
digging into it is actually fun.
582584

583-
-- Aditya Siram
585+
-- Aditya Siram
584586

585587
-------
586588

@@ -616,7 +618,7 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
616618
useful set of power tools. If Emacs is your preferred productivity
617619
environment, it's definitely worth getting familiar with it.
618620

619-
-- Chris Nuzum
621+
-- Chris Nuzum
620622
Co-founder, Traction Softwarea, Inc.
621623

622624
-------
@@ -633,7 +635,7 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
633635
perfect, but adequate), so I can put any aspect of development on
634636
our internal web for others to see.
635637

636-
-- Farzin Guilak
638+
-- Farzin Guilak
637639
Protocol Systems, Inc., Engineer
638640

639641
-------
@@ -656,7 +658,7 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
656658
4. The Hyperbole Koutliner, which I find a very useful tool. I've
657659
implemented Emacspeak extensions to support it.
658660

659-
-- TV Raman
661+
-- TV Raman
660662
Google Inc.
661663

662664
-------
@@ -679,7 +681,7 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
679681
that do various little things, and I index saved mail messages by putting
680682
explicit link-to-mail buttons in an outline file.
681683

682-
-- Ken Olstad
684+
-- Ken Olstad
683685
Cheyenne Software, Inc.
684686

685687
-------
@@ -711,12 +713,12 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
711713

712714
* Organizing and viewing online documentation: using Hyperbole along with
713715
Hyper-man and Info makes it truly easy to look up online documentation.
714-
716+
715717
* Other desktop organization tasks: including links to various mail
716718
folders, saved newsgroup conversation threads, online note-taker,
717719
emacs-command invocations, etc.
718720

719-
-- Dadong Wan
721+
-- Dadong Wan
720722
University of Hawaii
721723

722724
-------
@@ -729,23 +731,23 @@ default context-sensitive Hyperbole key bindings (Smart Keys).
729731
in it is a very powerful capability. Using ange-ftp mode, one can make
730732
file references "across the world" as easily as normal file references.
731733

732-
-- Mark Eichin
734+
-- Mark Eichin
733735
Cygnus Support
734736
-------
735737

736738
I just wanted to say how much I enjoy using the Hyperbole Koutliner.
737739
It is a great way to quickly construct very readable technical documents
738-
that I can pass around to others. Thanks for the great work.
740+
that I can pass around to others. Thanks for the great work.
739741

740-
-- Jeff Fried
742+
-- Jeff Fried
741743
Informix
742744

743745
-------
744746

745747
The Hyperbole system provides a nice interface to exploring corners of
746748
Unix that I didn't know existed before.
747749

748-
-- Craig Smith
750+
-- Craig Smith
749751

750752

751753
## Why was Hyperbole developed?

hbut.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 18-Sep-91 at 02:57:09
6-
;; Last-Mod: 18-Feb-26 at 23:49:33 by Bob Weiner
6+
;; Last-Mod: 25-Feb-26 at 22:31:30 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -1638,6 +1638,9 @@ to include {} only. For use with implicit button activations."
16381638
;; Treat angle brackets and braces as opening and closing delimiters
16391639
;; for ease of matching.
16401640
(mapc (lambda (syntax-table)
1641+
;; Treat # as a symbol constituent to support company-mode completion.
1642+
(modify-syntax-entry ?# "_" syntax-table)
1643+
;; Treat angle brackets as opening and closing delimiters for ease of matching.
16411644
(modify-syntax-entry ?\< "(>" syntax-table)
16421645
(modify-syntax-entry ?\> ")<" syntax-table)
16431646
;; Treat braces as opening and closing delimiters for ease of matching.

hsys-org.el

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 2-Jul-16 at 14:54:14
6-
;; Last-Mod: 14-Feb-26 at 23:40:17 by Bob Weiner
6+
;; Last-Mod: 22-Feb-26 at 23:14:50 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -314,6 +314,40 @@ Return t if Org is reloaded, else nil."
314314
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
315315
t)))))
316316

317+
;;; Derived from `org-get-heading' in "org.el"
318+
;;;###autoload
319+
(defun hsys-org-format-heading (heading &optional no-tags no-todo no-priority no-comment)
320+
"Return HEADING, without the leading asterisks.
321+
When NO-TAGS is non-nil, don't include tags.
322+
When NO-TODO is non-nil, don't include TODO keywords.
323+
When NO-PRIORITY is non-nil, don't include priority cookie.
324+
When NO-COMMENT is non-nil, don't include COMMENT string."
325+
(when (stringp heading)
326+
(let ((case-fold-search nil)
327+
(org-complex-heading-regexp
328+
"^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$"))
329+
(when (string-match org-complex-heading-regexp heading)
330+
;; When using `org-fold-core--optimise-for-huge-buffers',
331+
;; returned text will be invisible. Clear it up.
332+
(save-match-data
333+
(org-fold-core-remove-optimisation (match-beginning 0) (match-end 0)))
334+
(let ((todo (and (not no-todo) (match-string 2 heading)))
335+
(priority (and (not no-priority) (match-string 3 heading)))
336+
(headline (pcase (match-string 4 heading)
337+
(`nil "")
338+
((and (guard no-comment) h)
339+
(replace-regexp-in-string
340+
(eval-when-compile
341+
(format "\\`%s[ \t]+" org-comment-string))
342+
"" h))
343+
(h h)))
344+
(tags (and (not no-tags) (match-string 5))))
345+
;; Restore cleared optimization.
346+
(org-fold-core-update-optimisation (match-beginning 0) (match-end 0))
347+
(mapconcat #'identity
348+
(delq nil (list todo priority headline tags))
349+
" "))))))
350+
317351
(defun hsys-org-get-libraries-to-reload ()
318352
"Return all org libraries that need to be reloaded to avoid mixed versions."
319353
(interactive)

0 commit comments

Comments
 (0)