Subject: bug#77969: [PATCH] Add buttons to manuals in some commentary sections

From: Morgan Smith <[email-masked]>
Date: Mon, 21 Apr 2025 13:54:47 -0400

Tags: patch

This patch will affect how a lot of packages get presented to the user.

Run `M-x package-list-packages'.

Now go down to 'use-package' and press the button (RET) to pull up the
package summary.

At the bottom of that summary it says "See the `use-package' info manual
for more information.".  The "`use-package'" bit is a button will take
you to a Help buffer describing the macro.  This is not ideal as the
sentence is talking about the Info manual.

After my change the sentence will change too "See Info node
`(use-package)' for more information." where the "`(use-package)'" part
is a button that takes you to the info manual.

>From 70b377159ba525f65a626980fbf8bbfb789159a3 Mon Sep 17 00:00:00 2001
From: Morgan Smith <[email-masked]>
Date: Mon, 21 Apr 2025 13:10:35 -0400
Subject: [PATCH] Add buttons to manuals in some commentary sections

* lisp/align.el:
* lisp/apropos.el:
* lisp/arc-mode.el:
* lisp/auth-source.el:
* lisp/autorevert.el:
* lisp/bind-key.el:
* lisp/calculator.el:
* lisp/calendar/calendar.el:
* lisp/calendar/icalendar.el:
* lisp/calendar/todo-mode.el:
* lisp/dired-x.el:
* lisp/emacs-lisp/ert.el:
* lisp/emacs-lisp/package.el:
* lisp/gnus/gnus.el:
* lisp/progmodes/cc-mode.el:
* lisp/textmodes/texnfo-upd.el:
* lisp/use-package/use-package-bind-key.el:
* lisp/use-package/use-package-core.el:
* lisp/use-package/use-package-delight.el:
* lisp/use-package/use-package-diminish.el:
* lisp/use-package/use-package-ensure-system-package.el:
* lisp/use-package/use-package-ensure.el:
* lisp/use-package/use-package-jump.el:
* lisp/use-package/use-package-lint.el:
* lisp/use-package/use-package.el:
* test/lisp/emacs-lisp/ert-tests.el:
* test/lisp/emacs-lisp/ert-x-tests.el:
Add button to Info manual in commentary section of file.

It is rendered as a button when the commentary is rendered in
help mode.  Like when a package is viewed using
`package-menu-describe-package'.

It is not rendered as a button by finder as that feature still
needs to be added to finder.
---
 lisp/align.el                                         |  2 ++
 lisp/apropos.el                                       |  2 ++
 lisp/arc-mode.el                                      |  2 ++
 lisp/auth-source.el                                   |  2 +-
 lisp/autorevert.el                                    |  2 ++
 lisp/bind-key.el                                      |  2 +-
 lisp/calculator.el                                    |  2 ++
 lisp/calendar/calendar.el                             |  2 ++
 lisp/calendar/icalendar.el                            |  2 +-
 lisp/calendar/todo-mode.el                            |  2 ++
 lisp/dired-x.el                                       |  4 ++--
 lisp/emacs-lisp/ert.el                                |  2 +-
 lisp/emacs-lisp/package.el                            |  2 ++
 lisp/gnus/gnus.el                                     |  2 ++
 lisp/progmodes/cc-mode.el                             |  4 ++--
 lisp/textmodes/texnfo-upd.el                          | 10 +++++-----
 lisp/use-package/use-package-bind-key.el              |  2 +-
 lisp/use-package/use-package-core.el                  |  2 +-
 lisp/use-package/use-package-delight.el               |  2 +-
 lisp/use-package/use-package-diminish.el              |  2 +-
 lisp/use-package/use-package-ensure-system-package.el |  2 +-
 lisp/use-package/use-package-ensure.el                |  2 +-
 lisp/use-package/use-package-jump.el                  |  2 +-
 lisp/use-package/use-package-lint.el                  |  2 +-
 lisp/use-package/use-package.el                       |  2 +-
 test/lisp/emacs-lisp/ert-tests.el                     |  2 +-
 test/lisp/emacs-lisp/ert-x-tests.el                   |  2 +-
 27 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/lisp/align.el b/lisp/align.el
index 4263dfe0fa0..9db684ec572 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -23,6 +23,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(emacs) Code Alignment'.
+;;
 ;; This mode allows you to align regions in a context-sensitive fashion.
 ;; The classic use is to align assignments:
 ;;
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 0d642bcdab6..fcf09f46446 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -24,6 +24,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(emacs) Apropos'.
+;;
 ;; The ideas for this package were derived from the C code in
 ;; src/keymap.c and elsewhere.
 
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 28be1e9c617..583bd6181e9 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -24,6 +24,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(emacs) File Archives'.
+;;
 ;; NAMING: "arc" is short for "archive" and does not refer specifically
 ;; to files whose name end in ".arc"
 ;;
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 946debca95e..6c22ffecb9e 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -27,7 +27,7 @@
 ;; of providing 5000 options, we'll stick to simple, easy to
 ;; understand options.
 
-;; See the auth.info Info documentation for details.
+;; See the Info node `(auth)' for details.
 
 ;; TODO:
 
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index e6a12d37ad1..da65fe0c164 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -24,6 +24,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(emacs)Auto Revert'.
+;;
 ;; Introduction:
 ;;
 ;; Whenever a file that Emacs is editing has been changed by another
diff --git a/lisp/bind-key.el b/lisp/bind-key.el
index 12417106783..e5190c2cefa 100644
--- a/lisp/bind-key.el
+++ b/lisp/bind-key.el
@@ -99,7 +99,7 @@
 ;; what the default was.  Also, it will tell you if the key was rebound after
 ;; your binding it with `bind-key', and what it was rebound it to.
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/calculator.el b/lisp/calculator.el
index 337560d38c9..d2fb8b41c25 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -22,6 +22,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(calc)'.
+;;
 ;; A calculator for Emacs.
 ;; Why should you reach for your mouse to get xcalc (calc.exe, gcalc or
 ;; whatever), when you have Emacs running already?
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 08ecd586ec1..5234bfc3135 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -25,6 +25,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(emacs)Calendar/Diary'.
+;;
 ;; This collection of functions implements a calendar window.  It
 ;; generates a calendar for the current month, together with the
 ;; previous and coming months, or for any other three-month period.
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 9ad393cb061..298d6dd8bde 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This package is documented in the Emacs Manual.
+;; See Info node `(emacs) Importing Diary'.
 
 ;;   Please note:
 ;; - Diary entries which have a start time but no end time are assumed to
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 445f37287c3..5c293ca1b6b 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -24,6 +24,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(todo-mode)'.
+;;
 ;; This package provides facilities for making and maintaining
 ;; prioritized lists of things to do.  These todo lists are identified
 ;; with named categories, so you can group together thematically
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 89390a482f0..d93c594772a 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -26,7 +26,7 @@
 ;;; Commentary:
 
 ;; This is based on Sebastian Kremer's excellent dired-x.el (Dired Extra),
-;; version 1.191, adapted for GNU Emacs.  See the `dired-x' Info manual.
+;; version 1.191, adapted for GNU Emacs.  See the Info node `(dired-x)'.
 
 ;; At load time dired-x.el will install itself and bind some Dired keys.
 ;; Some dired.el and dired-aux.el functions have extra features if
@@ -34,7 +34,7 @@
 
 ;; User customization: M-x customize-group RET dired-x RET.
 
-;; *Please* see the `dired-x' Info manual for more details.
+;; *Please* see the Info node `(dired-x)' for more details.
 
 
 ;;; Code:
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index b021c4d704c..1f482d754c1 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -47,7 +47,7 @@
 ;; checking the test environment (like availability of features,
 ;; external binaries, etc).
 ;;
-;; See ERT's Info manual `(ert) Top' as well as the docstrings for
+;; See ERT's Info node `(ert) Top' as well as the docstrings for
 ;; more details.  To see some examples of tests written in ERT, see
 ;; the test suite distributed with the Emacs source distribution (in
 ;; the "test" directory).
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index a255778af64..a9de0c15e5e 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -26,6 +26,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(emacs) Packages'.
+;;
 ;; The idea behind package.el is to be able to download packages and
 ;; install them.  Packages are versioned and have versioned
 ;; dependencies.  Furthermore, this supports built-in packages which
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 53b7c332ded..7a018360cb0 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -25,6 +25,8 @@
 
 ;;; Commentary:
 
+;; See Info node `(gnus)'.
+
 ;;; Code:
 
 (run-hooks 'gnus-load-hook)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index fa3788ba383..a2474977275 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -32,7 +32,7 @@
 ;;; Commentary:
 
 ;; NOTE: Read the commentary below for the right way to submit bug reports!
-;; NOTE: See the accompanying texinfo manual for details on using this mode!
+;; NOTE: See the accompanying Info node `(ccmode)' for usage details!
 ;; Note: The version string is in cc-defs.
 
 ;; This package provides GNU Emacs major modes for editing C, C++,
@@ -46,7 +46,7 @@
 ;; across all modes.  This indentation model is intuitive and very
 ;; flexible, so that almost any desired style of indentation can be
 ;; supported.  Installation, usage, and programming details are
-;; contained in an accompanying texinfo manual.
+;; contained in an accompanying Info node `(ccmode)'.
 
 ;; CC Mode's immediate ancestors were, c++-mode.el, cplus-md.el, and
 ;; cplus-md1.el..
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 51505faa03d..6bbac89df9c 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -43,11 +43,11 @@
 ;; the `Next', `Previous' and `Up' pointers on @node lines.  Most
 ;; manuals, including those whose Texinfo files adhere to the structure
 ;; described below, don't need these pointers, because makeinfo will
-;; generate them automatically (see the node "makeinfo Pointer
-;; Creation" in the Texinfo manual).  By contrast, due to known bugs
-;; described above, texinfo-update-node etc. could produce incorrect
-;; pointers, and thus make a perfectly valid Texinfo file into an
-;; invalid one.  You _have_ been warned!
+;; generate them automatically (see the Info node `(texinfo) Writing a
+;; Node').  By contrast, due to known bugs described above,
+;; texinfo-update-node etc. could produce incorrect pointers, and thus
+;; make a perfectly valid Texinfo file into an invalid one.  You _have_
+;; been warned!
 ;;
 ;; In brief, the functions for creating or updating nodes and menus, are:
 ;;
diff --git a/lisp/use-package/use-package-bind-key.el b/lisp/use-package/use-package-bind-key.el
index 19dc7e71f7a..9d361be32ee 100644
--- a/lisp/use-package/use-package-bind-key.el
+++ b/lisp/use-package/use-package-bind-key.el
@@ -29,7 +29,7 @@
 ;;
 ;; These keywords are made available by default by requiring `use-package'.
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index 630ee83601c..b9764dd4d54 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -25,7 +25,7 @@
 ;; This file contains the core implementation of the `use-package'
 ;; macro.
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-delight.el b/lisp/use-package/use-package-delight.el
index c3796da3217..bad2b3cf241 100644
--- a/lisp/use-package/use-package-delight.el
+++ b/lisp/use-package/use-package-delight.el
@@ -26,7 +26,7 @@
 ;; by default by requiring `use-package'.  Using it requires the
 ;; `delight' package to be installed (available on GNU ELPA).
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-diminish.el b/lisp/use-package/use-package-diminish.el
index 20efa498cd9..3579670c8b7 100644
--- a/lisp/use-package/use-package-diminish.el
+++ b/lisp/use-package/use-package-diminish.el
@@ -26,7 +26,7 @@
 ;; by default by requiring `use-package'.  Using it requires the
 ;; `diminish' package to be installed (available on GNU ELPA).
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-ensure-system-package.el b/lisp/use-package/use-package-ensure-system-package.el
index 05f6992f995..4fb3309387c 100644
--- a/lisp/use-package/use-package-ensure-system-package.el
+++ b/lisp/use-package/use-package-ensure-system-package.el
@@ -29,7 +29,7 @@
 ;; requires the `system-packages' package to be installed (available
 ;; on GNU ELPA).
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
index 6e698218c7c..24263fee25e 100644
--- a/lisp/use-package/use-package-ensure.el
+++ b/lisp/use-package/use-package-ensure.el
@@ -25,7 +25,7 @@
 ;; Provides support for the :ensure and :pin keywords, which are made
 ;; available by default by requiring `use-package'.
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-jump.el b/lisp/use-package/use-package-jump.el
index f82d1629281..323a11bfa88 100644
--- a/lisp/use-package/use-package-jump.el
+++ b/lisp/use-package/use-package-jump.el
@@ -27,7 +27,7 @@
 ;; initialization.  If it was autoloaded, it will not work.
 ;; Improvements are needed.
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package-lint.el b/lisp/use-package/use-package-lint.el
index 8494440474c..9a4de70becc 100644
--- a/lisp/use-package/use-package-lint.el
+++ b/lisp/use-package/use-package-lint.el
@@ -24,7 +24,7 @@
 
 ;; Provides the command `M-x use-package-lint'.
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el
index 439ca814f0a..4a0168bbf2a 100644
--- a/lisp/use-package/use-package.el
+++ b/lisp/use-package/use-package.el
@@ -37,7 +37,7 @@
 ;; difficult to manage.  Yet with this utility my total load time is
 ;; just under 1 second, with no loss of functionality!
 ;;
-;; See the `use-package' info manual for more information.
+;; See Info node `(use-package)' for more information.
 
 ;;; Code:
 
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index d138240b0f8..45b4e7bd002 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -22,7 +22,7 @@
 ;;; Commentary:
 
 ;; This file is part of ERT, the Emacs Lisp Regression Testing tool.
-;; See ert.el or the texinfo manual for more details.
+;; See ert.el or the Info node `(ert)' for more details.
 
 ;;; Code:
 
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el
index 7b7abf1ba7e..c6e67828878 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -23,7 +23,7 @@
 ;;; Commentary:
 
 ;; This file is part of ERT, the Emacs Lisp Regression Testing tool.
-;; See ert.el or the texinfo manual for more details.
+;; See ert.el or the Info node `(ert)' for more details.
 
 ;;; Code:
 
-- 
2.49.0