Subject: igc [PATCH] ; Add documentation on major mode igc-roots-mode
From: Jeremy Bryant <[email-masked]>
To: [email-masked]
Date: Tue, 08 Apr 2025 22:56:16 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

This patch adds major mode documentation for igc-roots-mode,
mirrorring the approach taken in igc-stats-mode, commit 7c7cd05b532

From 226b5248c43b6257fc9d445bdbc6b561029f659a Mon Sep 17 00:00:00 2001
From: Jeremy Bryant <[email-masked]>
Date: Tue, 8 Apr 2025 22:47:11 +0100
Subject: [PATCH] ; Add documentation on major mode igc-roots-mode

* lisp/emacs-lisp/igc.el (igc-roots-mode): Add documentation,
essentially combining the docstrings of igc-roots-stats and igc--roots,
with minor adaptation.
(igc-roots-stats): Change message to guide user to type ? for help.
---
 lisp/emacs-lisp/igc.el | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/igc.el b/lisp/emacs-lisp/igc.el
index e9d897f9f64..18a76863e64 100644
--- a/lisp/emacs-lisp/igc.el
+++ b/lisp/emacs-lisp/igc.el
@@ -228,6 +228,22 @@ igc-roots-clear
   (igc-roots-stats))
 
 (define-derived-mode igc-roots-mode special-mode "Roots"
+    "Display root statistics from `igc--roots'.
+You can display two snapshots A and B containing the info from `igc--roots'
+at different times.  These can be displayed either as-is, or by showing the
+difference between them.  \\<igc-roots-mode-map>Type \\[igc-roots-display-a] to switch to snapshot A and \\[igc-roots-display-b] to switch to
+snapshot B.  To take a snapshot, type \\[igc--roots-snapshot].
+To reset the current snapshot, type \\[igc-roots-clear].
+To display the difference between A and B, type \\[igc-roots-display-diff].
+Type \\`g' to refresh the the difference view.
+Type \\`?' to see the mode's help.
+
+The list of IGC roots is a list of elements, one each for every
+root.  Each element has the form (LABEL TYPE START END), where
+- LABEL is the label of the root
+- TYPE is either 'ambig' or 'exact'
+- START is the start address
+- END is either the end address or nil."
   (keymap-local-set "a" #'igc-roots-display-a)
   (keymap-local-set "b" #'igc-roots-display-b)
   (keymap-local-set "c" #'igc-collect)
@@ -274,7 +290,7 @@ igc-roots-stats
 	(sort-lines nil (point-min) (point-max)))
       (goto-char (point-min))))
   (display-buffer "*igc roots*")
-  (message "Type `C-h f igc-roots-stats RET' for instructions"))
+  (message "Type `?' in the *igc roots* buffer for help"))
 
 (defvar igc--collect-timer nil)
 (defvar igc--collect-file nil)
-- 
2.47.2