Subject: bug#77493: 30.1.50; Obsolete documentation of desktop library

From: Stephen Berman <[email-masked]>
Date: Thu, 03 Apr 2025 16:50:06 +0200

In the Emacs manual, node "(emacs) Saving Emacs Sessions" refers to a
no longer existing variable; the following patch corrects this:

diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 5896dc83fe1..fbcb7294505 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2907,8 +2907,8 @@ Saving Emacs Sessions
 command kills all buffers except for internal ones, and clears the
 global variables listed in @code{desktop-globals-to-clear}.  If you
 want it to preserve certain buffers, customize the variable
-@code{desktop-clear-preserve-buffers-regexp}, whose value is a regular
-expression matching the names of buffers not to kill.
+@code{desktop-clear-preserve-buffers}, whose value is a list of regular
+expressions matching the names of buffers not to kill.

 @vindex desktop-globals-to-save
   If you want to save minibuffer history from one session to

I'll push this to emacs-30 when I get a bug number.  While such a
straightforward doc fix would normally be committed without a bug
report, after looking into the history of the code related to this piece
of documentation, I found it interesting and perhaps instructive enough
to share here (but not appropriate for the ChangeLog).

The user option `desktop-clear-preserve-buffers-regexp' was added in
April 2003 (in commit 4a2fce7a9fdff3ede6f945e19e13154042dcb471) and was
intended to replace the existing user option
`desktop-clear-preserve-buffers' (added in 1997 in commit
21f521c0db6b683a2407a02d8a1706df8c9a7baf).  The latter was consequently
made obsolete in September 2003 (in commit
c5b31c4d7923a82a2937877f891a5e67f7ea6511) and also at that time
`desktop-clear-preserve-buffers-regexp' was documented in the Emacs
manual.  However, in September 2004 `desktop-clear-preserve-buffers' was
unobsoleted (in commit 340db502fa63af19824db898fec3fd7c6ba5ce0c).  Then
in August 2005 `desktop-clear-preserve-buffers-regexp' was deleted
(without having been previously obsoleted) and its functionality was
incorporated into `desktop-clear-preserve-buffers', but the
corresponding documentation in the Emacs manual was not updated and has
remained unchanged since then (although that node of the manual was
substantially rewritten in January 2023 in reaction to bug#60600).

In GNU Emacs 30.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.49, cairo version 1.18.4) of 2025-04-03 built on strobelfs2
Repository revision: 1e865a2f2889ecbee06b9eefdd82a4cda04d6eee
Repository branch: emacs-30
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Linux From Scratch r12.3-10