Skip to content
Open
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
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
2026-03-24 Bob Weiner <rsw@gnu.org>

* hibtypes.el (hib-link-to-file-line): Add missing 'let' for 'ext' variable,
fix indentation and change 'and' to 'when' for clarity.

2026-03-23 Bob Weiner <rsw@gnu.org>

* hypb.el (hypb:in-string-p): Limit searches to a max of 9000 chars for speed.

* hui-mouse.el (hkey-alist): Add 'profiler-report-mode' support for jumping
to call tree items or expanding/collapsing their call trees.
(smart-profiler-report, smart-profiler-report-assist): Add.
man/hyperbole.texi (Smart Key - Profiler Report Mode): Add doc.
(smart-profiler-report): Fix display of found buffer.

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

Expand Down
21 changes: 11 additions & 10 deletions hibtypes.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Sep-91 at 20:45:31
;; Last-Mod: 22-Mar-26 at 18:18:45 by Bob Weiner
;; Last-Mod: 24-Mar-26 at 19:04:59 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1027,15 +1027,16 @@ LINE-NUM may be an integer or string."
((stringp source-loc)
(setq file (expand-file-name file (file-name-directory source-loc))))
(t (setq file (or (hpath:prepend-shell-directory file)
;; find-library-name will strip file
;; suffixes, so use it only when the file
;; either doesn't have a suffix or has a
;; library suffix.
(and (or (null (setq ext (file-name-extension file)))
(member (concat "." ext) (get-load-suffixes)))
(ignore-errors (find-library-name file)))
(hpath:is-p (expand-file-name file))
(hywiki-get-existing-page-file file)))))
;; find-library-name will strip file
;; suffixes, so use it only when the file
;; either doesn't have a suffix or has a
;; library suffix.
(let ((ext (file-name-extension file)))
(when (or (null ext)
(member (concat "." ext) (get-load-suffixes)))
(ignore-errors (find-library-name file))))
(hpath:is-p (expand-file-name file))
(hywiki-get-existing-page-file file)))))
(when (file-exists-p (hpath:normalize file))
(actypes::link-to-file-line file line-num))))

Expand Down
15 changes: 7 additions & 8 deletions hui-mouse.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-89
;; Last-Mod: 23-Mar-26 at 18:49:48 by Bob Weiner
;; Last-Mod: 23-Mar-26 at 21:47:31 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -2221,13 +2221,12 @@ If key is pressed:
(quit-window))
;; If on the text of an entry, jump to its definition if is a link
((text-property-any (point) (1+ (point)) 'face 'link)
(let* ((curr-buffer)
(find-function-after-hook '((lambda ()
(setq curr-buffer (current-buffer))))))
(hpath:display-buffer (save-window-excursion
(profiler-report-find-entry)
curr-buffer)))
t)))
(let* ((dbuf)
(obuf (current-buffer)))
(profiler-report-find-entry)
(setq dbuf (window-buffer (selected-window)))
(switch-to-buffer obuf)
(hpath:display-buffer dbuf)))))

(defun smart-profiler-report-assist ()
"Use a single assist key or mouse assist key to toggle profiler call trees.
Expand Down
24 changes: 18 additions & 6 deletions hypb.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 6-Oct-91 at 03:42:38
;; Last-Mod: 22-Mar-26 at 01:29:41 by Bob Weiner
;; Last-Mod: 24-Mar-26 at 19:07:46 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -713,6 +713,8 @@ This will this install the Emacs helm package when needed."
(error "(hypb:hkey-help-file): Non-existent file: \"%s\""
help-file))))))

(defvar hypb:in-string-and-tick (cons nil 0))

(defun hypb:in-string-p (&optional max-lines range-flag)
"Return non-nil iff point is within a string and not on the closing quote.

Expand All @@ -724,7 +726,8 @@ the positions exclude the delimiters.
To prevent searching back to the buffer start and producing slow
performance, this limits its count of quotes found prior to point
to the beginning of the first line prior to point that contains a
non-backslashed quote mark.
non-backslashed quote mark and limits string length to a maximum
of 9000 characters.

Quoting conventions recognized are:
double-quotes: \"str\";
Expand All @@ -733,7 +736,10 @@ Quoting conventions recognized are:
Python triple single-quotes: '''str''';
Python triple double-quotes: \"\"\"str\"\"\";
Texinfo open and close quotes: ``str''."

(let ((list-of-unformatted-open-close-regexps (eval hypb:in-string-mode-regexps))
;; search limit length
(limit 9000)
list-of-open-close-regexps)
(if (and list-of-unformatted-open-close-regexps
(listp list-of-unformatted-open-close-regexps)
Expand Down Expand Up @@ -783,12 +789,12 @@ Quoting conventions recognized are:
(looking-at orig-close-regexp)))
(/= (or (char-before) 0) ?\\)
(setq open-match-string (match-string 2)))
(while (and (setq possible-delim (search-backward open-match-string nil t))
(while (and (setq possible-delim (search-backward open-match-string (max (point-min) (- (point) limit)) t))
(if (= (or (char-before) 0) ?\\)
(goto-char (1- (point)))
(progn (setq str-start (match-end 0))
nil))))
(when (setq possible-delim (re-search-backward open-regexp nil t))
(when (setq possible-delim (re-search-backward open-regexp (max (point-min) (- (point) limit)) t))
(setq open-match-string (match-string 2))
(setq str-start (match-end 2))))

Expand Down Expand Up @@ -823,7 +829,10 @@ Quoting conventions recognized are:
(regexp-quote texinfo-close-quote))
start (point))))

(progn (while (and (setq possible-delim (search-forward texinfo-close-quote nil t))
(progn (while (and (setq possible-delim (search-forward
texinfo-close-quote
(min (point-max) (+ (point) limit))
t))
(= (or (char-before (match-beginning 0)) 0) ?\\)))
possible-delim)
(setq str-end (match-beginning 0)
Expand All @@ -839,7 +848,10 @@ Quoting conventions recognized are:
;; closing delimiter char to ensure it is not
;; backslash quoted and so the right delimiter is matched.
;; Find the matching closing delimiter
(progn (while (and (setq possible-delim (search-forward open-match-string nil t))
(progn (while (and (setq possible-delim
(search-forward open-match-string
(min (point-max) (+ (point) limit))
t))
(= (or (char-before (match-beginning 0)) 0) ?\\)))
possible-delim)
(setq str-end (match-beginning 0))
Expand Down
Loading