From c7e29c1f000517b8efdad30002e1a0f75cb8e5aa Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sat, 8 Mar 2025 13:41:22 +0100
Subject: [PATCH] Use .eld for some relevant cache and data files

* lisp/bookmark.el (bookmark-default-file):
* lisp/net/nsm.el (nsm-settings-file):
* lisp/progmodes/project.el (project-list-file):
* lisp/saveplace.el (save-place-file): Rename files to have the file
suffix ".eld".  This change is backwards-compatible.

(cherry picked from commit 3396f0e5678cf1edb0056917182b30927a35335b)
---
 lisp/bookmark.el          | 5 +++--
 lisp/net/nsm.el           | 5 +++--
 lisp/progmodes/project.el | 5 +++--
 lisp/recentf.el           | 5 +++--
 lisp/saveplace.el         | 5 +++--
 5 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 53e8bf14fc4..76dcbd07fe4 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -81,12 +81,13 @@ To specify the file in which to save them, modify the variable
   'bookmark-default-file "27.1")
 (define-obsolete-variable-alias 'bookmark-file 'bookmark-default-file "27.1")
 (defcustom bookmark-default-file
-  (locate-user-emacs-file "bookmarks" ".emacs.bmk")
+  (locate-user-emacs-file '("bookmarks.eld" "bookmarks") ".emacs.bmk")
   "File in which to save bookmarks by default."
   ;; The current default file is defined via the internal variable
   ;; `bookmark-bookmarks-timestamp'.  This does not affect the value
   ;; of `bookmark-default-file'.
-  :type 'file)
+  :type 'file
+  :version "31.1")
 
 (defcustom bookmark-watch-bookmark-file t
   "If non-nil reload the default bookmark file if it was changed.
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index afc44dad061..226635fef11 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -79,9 +79,10 @@ option."
                  (const :tag "Off" nil)
                  (function :tag "Custom function")))
 
-(defcustom nsm-settings-file (locate-user-emacs-file "network-security.data")
+(defcustom nsm-settings-file
+  (locate-user-emacs-file '("network-security.eld" "network-security.data"))
   "The file the security manager settings will be stored in."
-  :version "25.1"
+  :version "31.1"
   :type 'file)
 
 (defcustom nsm-save-host-names nil
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 6f6fba81c4c..ffe6c36682d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1758,10 +1758,11 @@ Also see the `project-kill-buffers-display-buffer-list' variable."
 
 ;;; Project list
 
-(defcustom project-list-file (locate-user-emacs-file "projects")
+(defcustom project-list-file
+  (locate-user-emacs-file '("projects.eld" "projects"))
   "File in which to save the list of known projects."
   :type 'file
-  :version "28.1"
+  :version "31.1"
   :group 'project)
 
 (defcustom project-list-exclude nil
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 9ee576c5c99..ea2a066f920 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -82,10 +82,11 @@ See the command `recentf-save-list'."
 		 (const :tag "No Limit" nil))
   :version "31.1")
 
-(defcustom recentf-save-file (locate-user-emacs-file "recentf" ".recentf")
+(defcustom recentf-save-file
+  (locate-user-emacs-file '("recentf.eld" "recentf") ".recentf")
   "File to save the recent list into."
   :group 'recentf
-  :version "24.4"
+  :version "31.1"
   :type 'file
   :initialize 'custom-initialize-default
   :set (lambda (symbol value)
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index 1b99387ef5f..28b0e39af40 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -62,9 +62,10 @@ when the place in that buffer was recorded.
 
 This alist is saved between Emacs sessions.")
 
-(defcustom save-place-file (locate-user-emacs-file "places" ".emacs-places")
+(defcustom save-place-file
+  (locate-user-emacs-file '("places.eld" "places") ".emacs-places")
   "Name of the file that records `save-place-alist' value."
-  :version "24.4"                       ; added locate-user-emacs-file
+  :version "31.1"
   :type 'file)
 
 (defcustom save-place-version-control nil
-- 
2.39.5