Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
2026-07-23 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki-get-entry): Strip file header when returning
definition as a string, as that is all should be desired.
(hywiki-get-definition, hywiki-get-entry): Change so just
returns nil if first arg is sent as a non-string or an empty string
rather than triggering an error.
(hywiki-display-glossary-entry): Don't display the entry if in
the middle of a 'hywiki-create-referent-and-display' call since that
displays the entry source buffer already.

* hmouse-drv.el (hkey-help): Conditionalize HyWikiWord glossary entry
definition output on a non-nil 'lbl-key', i.e. non-nil reference.

2026-07-22 Bob Weiner <rsw@gnu.org>

* test/hy-string-tests.el: Add to start 'hypb:in-string-p' testing.

* man/hyperbole.texi (HyWiki Menu, HyWiki Glossary): Document the ways
to use HyWiki glossary entries.

* hywiki.el (hywiki-get-term-variant-regexp): Allow the term to be
surrounded by Org emphasis characters.
(hywiki-get-term-variant-regexp): Fix to make case sensitive
so wikiwords are always split on capital letters properly.
hpath.el (hpath:org-normalize-title): Strip any Org emphasis characters.
(hywiki-get-entry): Obey 'regexp-flag' when calling
'hyrolo-grep-file'.
(hydef): Add macro to use as an Action Button to display HyWiki
glossary definitions.

2026-07-22 Mats Lidell <matsl@gnu.org>

* test/hywiki-tests.el (hywiki-tests--potential-buffer-p): New test.
Expand Down
41 changes: 21 additions & 20 deletions hmouse-drv.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-90
;; Last-Mod: 20-Jul-26 at 01:47:30 by Bob Weiner
;; Last-Mod: 23-Jul-26 at 00:17:46 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1185,15 +1185,15 @@ documentation is found."

;; Print Hyperbole button attributes
(when (memq cmd-sym '(hui:hbut-act hui:hbut-help))
(let* ;; (lbl-key (hattr:get 'hbut:current 'lbl-key))
((categ (hattr:get 'hbut:current 'categ))
(attributes (nthcdr 2 (hattr:list 'hbut:current)))
(but-def-symbol (htype:def-symbol
(if (eq categ 'explicit) actype categ)))
(wikiword-referent
(when (eq (htype:def-symbol actype) 'link-to-wikiword)
(hywiki-get-referent
(hattr:get 'hbut:current 'lbl-key)))))
(let* ((lbl-key (hattr:get 'hbut:current 'lbl-key))
(categ (hattr:get 'hbut:current 'categ))
(attributes (nthcdr 2 (hattr:list 'hbut:current)))
(but-def-symbol (htype:def-symbol
(if (eq categ 'explicit) actype categ)))
(wikiword-referent
(when (eq (htype:def-symbol actype) 'link-to-wikiword)
(hywiki-get-referent
(hattr:get 'hbut:current 'lbl-key)))))

(when wikiword-referent
(hattr:set 'hbut:current 'referent-type
Expand All @@ -1219,16 +1219,17 @@ documentation is found."
;; (hypb:remove-from-plist attributes 'action))
(hattr:report attributes)

;; Need to save and restore 'hbut:current here since
;; hywiki-get-definition overwrites it
(unwind-protect
(progn (hattr:copy 'hbut:current 'saved-but)
(setq def (hywiki-get-definition
(ibut:key-to-label (hattr:get 'hbut:current 'lbl-key))))
(when def
(terpri)
(princ def)))
(hattr:copy 'saved-but 'hbut:current))
(when lbl-key
(unwind-protect
;; Need to save and restore 'hbut:current here
;; since hywiki-get-definition overwrites it
(progn (hattr:copy 'hbut:current 'saved-but)
(setq def (hywiki-get-definition
(ibut:key-to-label lbl-key)))
(when (stringp def)
(terpri)
(princ def)))
(hattr:copy 'saved-but 'hbut:current)))

(unless (or assisting
(eq categ 'explicit)
Expand Down
15 changes: 11 additions & 4 deletions hpath.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 1-Nov-91 at 00:44:23
;; Last-Mod: 16-Jul-26 at 16:57:49 by Bob Weiner
;; Last-Mod: 22-Jul-26 at 15:13:47 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1754,7 +1754,9 @@ but locational suffixes within the file are utilized."
"Ignore HASH when ANCHOR is non-null and move point to ANCHOR string if found.
Move point to beginning of buffer if HASH is non-nil and ANCHOR is null.
With optional INSTANCE-NUM, go to that instance of ANCHOR from the start
of the buffer."
of the buffer.

Trigger an error if the instance of the non-null anchor requested is not found."
(let ((omin (point-min))
(omax (point-max)))
(unwind-protect
Expand Down Expand Up @@ -2026,7 +2028,8 @@ form is what is returned for PATH."

(defun hpath:org-normalize-title (title)
"Return title in normalized form.
Strip all priority, leading ':' or '-' separators, and stats from TITLE."
Strip all priority, leading ':' or '-' separators, stats and Org emphasis
characters from TITLE."
(when title
(let ((clean (copy-sequence title)))
;; Strip leading priority: [#B] or [#2} followed by ':' or '-' surrounded by any whitespace
Expand All @@ -2035,7 +2038,11 @@ Strip all priority, leading ':' or '-' separators, and stats from TITLE."
;; Matches: "- Title", ": Title", " - Title"
(setq clean (string-trim (replace-regexp-in-string "\\`[ \t]*[-:][ \t]+" "" clean)))
;; Strip trailing statistics cookies [1/2] or [50%]
(setq clean (replace-regexp-in-string "\\(?: +\\[[0-9%+/]+\\]\\)+\\'" "" clean)))))
(setq clean (replace-regexp-in-string "\\(?: +\\[[0-9%+/]+\\]\\)+\\'" "" clean))
;; Strip *bold*’, ‘/italic/’, ‘_underlined_’, ‘=verbatim=’ and ‘~code~’
;; Org emphasis characters
(setq clean (replace-regexp-in-string "\\`[ \t]*[*/_=~]\\(.+\\)[*/_=~]"
"\\1" clean)))))

(defun hpath:org-normalize-titles ()
"Get all buffer Org titles in normalized form.
Expand Down
19 changes: 10 additions & 9 deletions hyperbole.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
;; Maintainer: Robert Weiner <rsw@gnu.org>
;; Maintainers: Robert Weiner <rsw@gnu.org>, Mats Lidell <matsl@gnu.org>
;; Created: 06-Oct-92 at 11:52:51
;; Last-Mod: 14-Jul-26 at 10:01:48 by Bob Weiner
;; Last-Mod: 22-Jul-26 at 11:15:05 by Bob Weiner
;; Released: 10-Mar-24
;; Version: 9.0.2pre
;; Keywords: comm, convenience, files, frames, hypermedia, languages, mail, matching, mouse, multimedia, outlines, tools, wp
Expand Down Expand Up @@ -354,20 +354,21 @@ of the commands."
;; f = SELECTED_FRAME ();
;; XSETFRAME (lispy_dummy, f);
;;
;; It seems like the XSETFRAME macro is not properly copying the value of f on initial frame selection under the macOS window system.
;; The problem occurs on other systems as well, e.g. Emacs 25.2 under Windows 7.
;; It seems like the XSETFRAME macro is not properly copying the value of f
;; on initial frame selection under the macOS window system. The problem
;; occurs on other systems as well, e.g. Emacs 25.2 under Windows 7.
;;
;; Hyperbole resolves this problem by setting the
;; `mouse-position-function' variable below to properly set the
;; newly selected frame.
(if (boundp 'mouse-position-function)
(setq mouse-position-function
(lambda (frame-x-dot-y)
"Make `mouse-position' and `mouse-pixel-position' return the selected frame.
(when (boundp 'mouse-position-function)
(setq mouse-position-function
(lambda (frame-x-dot-y)
"Make `mouse-position' and `mouse-pixel-position' return the selected frame.
Under macOS and Windows 7 at least, upon initial selection of a new
frame, those functions by default still return the prior frame."
(if (consp frame-x-dot-y) (setcar frame-x-dot-y (selected-frame)))
frame-x-dot-y)))
(if (consp frame-x-dot-y) (setcar frame-x-dot-y (selected-frame)))
frame-x-dot-y)))

;; hmouse-drv will load hui-mouse and hmouse-key
(mapc #'require '(hsettings hmouse-drv hmouse-sh))
Expand Down
Loading