diff --git a/ChangeLog b/ChangeLog index 5dadc63c..3151612d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2026-03-23 Bob Weiner + +* 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. + 2026-03-22 Mats Lidell * test/hibtypes-tests.el (ibtypes-tests--grep-msg): diff --git a/hui-mouse.el b/hui-mouse.el index b7146870..5e9ccd14 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 04-Feb-89 -;; Last-Mod: 1-Jan-26 at 18:18:24 by Mats Lidell +;; Last-Mod: 23-Mar-26 at 18:49:48 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -429,6 +429,11 @@ The button's attributes are stored in the symbol, `hbut:current'.") ((eq major-mode 'flymake-diagnostics-buffer-mode) . ((flymake-goto-diagnostic (point)) . (flymake-show-diagnostic (point) t))) ;; + ;; If in the CPU and memory profile report mode, jump to or expand/contract + ;; the entry at point. + ((eq major-mode 'profiler-report-mode) + . ((smart-profiler-report) . (smart-profiler-report-assist))) + ;; ;; Rdb-mode supports direct selection and viewing of in-memory relational ;; databases. Rdb-mode is available as a part of InfoDock. ;; It is not included with Hyperbole. @@ -695,7 +700,7 @@ and has moved the cursor there. If key is pressed: (1) on the first column of an entry, the selected buffer is marked for - display; + display; (2) on the second column of an entry, the selected buffer is marked to be saved; (3) anywhere else within an entry line, all saves and deletes are done, and @@ -724,7 +729,7 @@ buffer and has moved the cursor there. If assist key is pressed: (1) on the first or second column of an entry, the selected buffer is unmarked - for display and for saving or deletion; + for display and for saving or deletion; (2) anywhere else within an entry line, the selected buffer is marked for deletion; (3) on or after the last line in the buffer, all display, save, and delete @@ -792,7 +797,7 @@ appropriate buffer and has moved the cursor there. If assist key is pressed: (1) on the first or second column of an entry, the selected buffer is unmarked - for display or deletion; + for display or deletion; (2) anywhere else within an entry line, the selected buffer is marked for deletion; (3) on the first or last line in the buffer, all display, save, and delete @@ -1412,7 +1417,7 @@ If key is pressed within: the next undeleted message is displayed; (2) a msg buffer within the first line of an Info cross reference, the reference is followed; - (3) anywhere else in a msg buffer, the window is scrolled up a windowful; + (3) anywhere else in a msg buffer, the window is scrolled up a windowful; (4) a msg summary buffer on a header entry, the message corresponding to the header is displayed in the msg window; (5) a msg summary buffer, on or after the last line, the messages marked @@ -1883,7 +1888,7 @@ either t or `:buttons': 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'). - + 10. With point on an Org mode heading, cycle the view of the subtree at point. @@ -2195,6 +2200,52 @@ mouse-action to action property." (describe-function action) (hkey-help t)))) +;;; ************************************************************************ +;;; smart-profiler-report functions +;;; ************************************************************************ + +(defun smart-profiler-report () + "Use a single key or mouse key to jump to call tree items with links. + +Invoked via a key press when in ``profiler-report-mode'. It assumes that its +caller has already checked that the key was pressed in an appropriate buffer +and has moved the cursor there. + +If key is pressed: + (1) on the text of a linked call tree item, jumps to the definition of the item; + (2) on or after the last line in the buffer, quits from the profiler report." + (interactive) + (cond + ;; If on last line, quit from mode + ((last-line-p) + (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))) + +(defun smart-profiler-report-assist () + "Use a single assist key or mouse assist key to toggle profiler call trees. + +Invoked via an assist key press when in `profiler-report-mode'. It assumes +that its caller has already checked that the assist key was pressed in an +appropriate buffer and has moved the cursor there. + +If assist key is pressed: + (1) on an item line, toggles exposure of the item's call tree. + (2) on or after the last line in the buffer, quits from the profiler report." + (interactive) + ;; If on last line, quit from mode + (if (last-line-p) + (quit-window) + ;; Otherwise, toggle exposing the entry's call tree + (profiler-report-toggle-entry t))) + ;;; ************************************************************************ ;;; smart-tar functions ;;; ************************************************************************ diff --git a/man/hyperbole.texi b/man/hyperbole.texi index 9d620d7d..d1f20a38 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: 22-Mar-26 at 23:39:23 by Bob Weiner +@c Last-Mod: 23-Mar-26 at 19:00:37 by Bob Weiner @c %**start of header (This is for running Texinfo on a region.) @setfilename hyperbole.info @@ -30,7 +30,7 @@ @set txicodequoteundirected @set txicodequotebacktick -@set UPDATED March 22, 2026 +@set UPDATED March 23, 2026 @set UPDATED-MONTH March 2026 @set EDITION 9.0.2pre @set VERSION 9.0.2pre @@ -171,7 +171,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 Edition 9.0.2pre
-Printed March 22, 2026.
+Printed March 23, 2026.
 
   Published by the Free Software Foundation, Inc.
   Author:    Bob Weiner
@@ -213,7 +213,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 @example
 Edition 9.0.2pre
-March 22, 2026 @c AUTO-REPLACE-ON-SAVE
+March 23, 2026 @c AUTO-REPLACE-ON-SAVE
 
 
   Published by the Free Software Foundation, Inc.
@@ -491,14 +491,16 @@ Smart Keyboard Keys
 * Smart Key - Smart Scrolling::
 * Smart Key - Smart Menus::
 * Smart Key - Dired Mode::
+* Smart Key - Magit Mode::
+* Smart Key - Delimited Things::
 * Smart Key - Hyperbole Buttons::
 * Smart Key - View Mode::
 * Smart Key - Helm Mode::
 * Smart Key - ERT Results Mode::
-* Smart Key - Delimited Things::
 * Smart Key - Occurrence Matches::
 * Smart Key - The Koutliner::
 * Smart Key - Flymake Mode::
+* Smart Key - Profiler Report Mode::
 * Smart Key - RDB Mode::
 * Smart Key - Help Buffers::
 * Smart Key - Custom Mode::
@@ -527,7 +529,6 @@ Smart Keyboard Keys
 * Smart Key - HyRolo Match Buffers::
 * Smart Key - Image Thumbnails::
 * Smart Key - Gomoku Game::
-* Smart Key - Magit Mode::
 * Smart Key - The OO-Browser::
 * Smart Key - Todotxt Mode::
 * Smart Key - Default Context::
@@ -10554,14 +10555,16 @@ If dragged from an Emacs window to outside of Emacs:
 * Smart Key - Smart Scrolling::
 * Smart Key - Smart Menus::
 * Smart Key - Dired Mode::
+* Smart Key - Magit Mode::
+* Smart Key - Delimited Things::
 * Smart Key - Hyperbole Buttons::
 * Smart Key - View Mode::
 * Smart Key - Helm Mode::
 * Smart Key - ERT Results Mode::
-* Smart Key - Delimited Things::
 * Smart Key - Occurrence Matches::
 * Smart Key - The Koutliner::
 * Smart Key - Flymake Mode::
+* Smart Key - Profiler Report Mode::
 * Smart Key - RDB Mode::
 * Smart Key - Help Buffers::
 * Smart Key - Custom Mode::
@@ -10590,7 +10593,6 @@ If dragged from an Emacs window to outside of Emacs:
 * Smart Key - HyRolo Match Buffers::
 * Smart Key - Image Thumbnails::
 * Smart Key - Gomoku Game::
-* Smart Key - Magit Mode::
 * Smart Key - The OO-Browser::
 * Smart Key - Todotxt Mode::
 * Smart Key - Default Context::
@@ -10892,7 +10894,7 @@ If the Smart Menu package (part of InfoDock) has been loaded and
 @end group
 @end format
 
-@node Smart Key - Dired Mode, Smart Key - Hyperbole Buttons, Smart Key - Smart Menus, Smart Keyboard Keys
+@node Smart Key - Dired Mode, Smart Key - Magit Mode, Smart Key - Smart Menus, Smart Keyboard Keys
 @subsection Smart Key - Dired Mode
 @cindex click, dired
 @cindex drag, dired
@@ -10929,7 +10931,7 @@ If pressed within a dired-mode (directory editor) buffer:
 @end group
 @end format
 
-@node Smart Key - Magit Mode, Smart Key - The OO-Browser, Smart Key - Gomoku Game, Smart Keyboard Keys
+@node Smart Key - Magit Mode, Smart Key - Delimited Things, Smart Key - Dired Mode, Smart Keyboard Keys
 @subsection Smart Key - Magit Mode
 @cindex git
 @cindex magit
@@ -10960,7 +10962,7 @@ If pressed within a Magit buffer and not on a button:
 @end group
 @end format
 
-@node Smart Key - Delimited Things, Smart Key - Occurrence Matches, Smart Key - ERT Results Mode, Smart Keyboard Keys
+@node Smart Key - Delimited Things, Smart Key - Hyperbole Buttons, Smart Key - Magit Mode, Smart Keyboard Keys
 @subsection Smart Key - Delimited Things
 
 @cindex thing
@@ -10987,7 +10989,7 @@ the thing.
 @end group
 @end format
 
-@node Smart Key - Hyperbole Buttons, Smart Key - View Mode, Smart Key - Dired Mode, Smart Keyboard Keys
+@node Smart Key - Hyperbole Buttons, Smart Key - View Mode, Smart Key - Delimited Things, Smart Keyboard Keys
 @subsection Smart Key - Hyperbole Buttons
 
 @cindex click, button
@@ -11060,7 +11062,7 @@ If pressed within a buffer in helm major mode:
 @end group
 @end format
 
-@node Smart Key - ERT Results Mode, Smart Key - Delimited Things, Smart Key - Helm Mode, Smart Keyboard Keys
+@node Smart Key - ERT Results Mode, Smart Key - Occurrence Matches, Smart Key - Helm Mode, Smart Keyboard Keys
 @subsection Smart Key - ERT Results Mode
 
 @cindex ert-results-mode
@@ -11106,7 +11108,7 @@ original location and yanks it at the new location.
 @end group
 @end format
 
-@node Smart Key - Occurrence Matches, Smart Key - The Koutliner, Smart Key - Delimited Things, Smart Keyboard Keys
+@node Smart Key - Occurrence Matches, Smart Key - The Koutliner, Smart Key - ERT Results Mode, Smart Keyboard Keys
 @subsection Smart Key - Occurrence Matches
 
 @format
@@ -11150,7 +11152,7 @@ When pressed within a Hyperbole Koutliner buffer (kotl-mode):
 @end group
 @end format
 
-@node Smart Key - Flymake Mode, Smart Key - RDB Mode, Smart Key - The Koutliner, Smart Keyboard Keys
+@node Smart Key - Flymake Mode, Smart Key - Profiler Report Mode, Smart Key - The Koutliner, Smart Keyboard Keys
 @subsection Smart Key - Flymake Mode
 
 @cindex linter
@@ -11239,7 +11241,32 @@ current buffer.
 wrap around at the end and beginning of the buffer.  Repeat with @bkbd{w}.
 @end table
 
-@node Smart Key - RDB Mode, Smart Key - Help Buffers, Smart Key - Flymake Mode, Smart Keyboard Keys
+@node Smart Key - Profiler Report Mode, Smart Key - RDB Mode, Smart Key - Flymake Mode, Smart Keyboard Keys
+@subsection Smart Key - Profiler Report Mode
+@cindex profiling
+@cindex code profiling
+@cindex report, profiler
+@format
+@group
+If pressed within a profiler-report buffer which displays Emacs Lisp
+percentage CPU time and memory usage across a recorded period:
+  ACTION KEY
+    (1) on the text of a linked call tree item, jumps to the definition
+        of the item;
+    (2) on or after the last line in the buffer, quits from the profiler
+        report.
+@end group
+@end format
+@format
+@group
+  ASSIST KEY
+    (1) on an item line, toggles exposure of the item's call tree.
+    (2) on or after the last line in the buffer, quits from the profiler
+        report.
+@end group
+@end format
+
+@node Smart Key - RDB Mode, Smart Key - Help Buffers, Smart Key - Profiler Report Mode, Smart Keyboard Keys
 @subsection Smart Key - RDB Mode
 @cindex rdb-mode
 @cindex database
@@ -12014,7 +12041,7 @@ If pressed within a Dired Image Thumbnail buffer:
 @end group
 @end format
 
-@node Smart Key - Gomoku Game, Smart Key - Magit Mode, Smart Key - Image Thumbnails, Smart Keyboard Keys
+@node Smart Key - Gomoku Game, Smart Key - The OO-Browser, Smart Key - Image Thumbnails, Smart Keyboard Keys
 @subsection Smart Key - Gomoku Game
 @cindex game, gomoku
 @cindex gomoku
@@ -12028,7 +12055,7 @@ If pressed within a Gomoku game buffer:
 @end group
 @end format
 
-@node Smart Key - The OO-Browser, Smart Key - Todotxt Mode, Smart Key - Magit Mode, Smart Keyboard Keys
+@node Smart Key - The OO-Browser, Smart Key - Todotxt Mode, Smart Key - Gomoku Game, Smart Keyboard Keys
 @subsection Smart Key - The OO-Browser
 
 @cindex OO-Browser