emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 104e90d: Prefer locate-user-emacs-file


From: Stefan Kangas
Subject: master 104e90d: Prefer locate-user-emacs-file
Date: Tue, 9 Nov 2021 01:52:16 -0500 (EST)

branch: master
commit 104e90d93664892ed1a7a1631c5b0141d0552a60
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Prefer locate-user-emacs-file
    
    * lisp/cmuscheme.el (scheme-start-file):
    * lisp/erc/erc.el (erc-startup-file-list):
    * lisp/net/nsm.el (nsm-settings-file):
    * lisp/net/tramp-crypt.el (tramp-crypt-config-file-name):
    * lisp/org/org-clock.el (org-clock-persist-file):
    * lisp/org/org-id.el (org-id-locations-file)
    * lisp/shell.el (shell): Prefer 'locate-user-emacs-file' to fiddling
    with 'user-emacs-directory' directly.
---
 lisp/cmuscheme.el       | 3 ++-
 lisp/erc/erc.el         | 4 ++--
 lisp/net/nsm.el         | 3 +--
 lisp/net/tramp-crypt.el | 5 ++---
 lisp/org/org-clock.el   | 3 +--
 lisp/org/org-id.el      | 3 +--
 lisp/shell.el           | 3 ++-
 7 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index e197069..47113ad 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -245,7 +245,8 @@ Search in the directories \"~\" and `user-emacs-directory',
 in this order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
         (start-file (concat "~/.emacs_" progname))
-        (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
+         (alt-start-file (locate-user-emacs-file
+                          (concat "init_" progname ".scm"))))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 8e2bb83..3028568 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -872,8 +872,8 @@ See `erc-server-flood-margin' for other flood-related 
parameters.")
 ;; Script parameters
 
 (defcustom erc-startup-file-list
-  (list (concat user-emacs-directory ".ercrc.el")
-        (concat user-emacs-directory ".ercrc")
+  (list (locate-user-emacs-file ".ercrc.el")
+        (locate-user-emacs-file ".ercrc")
         "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
   "List of files to try for a startup script.
 The first existent and readable one will get executed.
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index 2ac1df1..b067b23 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -79,8 +79,7 @@ option."
                  (const :tag "Off" nil)
                  (function :tag "Custom function")))
 
-(defcustom nsm-settings-file (expand-file-name "network-security.data"
-                                                user-emacs-directory)
+(defcustom nsm-settings-file (locate-user-emacs-file "network-security.data")
   "The file the security manager settings will be stored in."
   :version "25.1"
   :type 'file)
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 5def3a4..269560b 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -293,9 +293,8 @@ arguments to pass to the OPERATION."
 
 (defun tramp-crypt-config-file-name (vec)
   "Return the encfs config file name for VEC."
-  (expand-file-name
-   (concat "tramp-" (tramp-file-name-host vec) tramp-crypt-encfs-config)
-   user-emacs-directory))
+  (locate-user-emacs-file
+   (concat "tramp-" (tramp-file-name-host vec) tramp-crypt-encfs-config)))
 
 (defun tramp-crypt-maybe-open-connection (vec)
   "Maybe open a connection VEC.
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 143ed4f..12a4c2b 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -219,8 +219,7 @@ Emacs initialization file."
          (const :tag "Clock and history" t)
          (const :tag "No persistence" nil)))
 
-(defcustom org-clock-persist-file (convert-standard-filename
-                                  (concat user-emacs-directory 
"org-clock-save.el"))
+(defcustom org-clock-persist-file (locate-user-emacs-file "org-clock-save.el")
   "File to save clock data to."
   :group 'org-clock
   :type 'string)
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 56783d1..bd7e739 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -196,8 +196,7 @@ the link."
   :group 'org-id
   :type 'boolean)
 
-(defcustom org-id-locations-file (convert-standard-filename
-                                 (concat user-emacs-directory 
".org-id-locations"))
+(defcustom org-id-locations-file (locate-user-emacs-file ".org-id-locations")
   "The file for remembering in which file an ID was defined.
 This variable is only relevant when `org-id-track-globally' is set."
   :group 'org-id
diff --git a/lisp/shell.el b/lisp/shell.el
index cb4afe6..370532e 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -785,7 +785,8 @@ Make the shell buffer the current buffer, and return it.
             (startfile (concat "~/.emacs_" name))
             (xargs-name (intern-soft (concat "explicit-" name "-args"))))
        (unless (file-exists-p startfile)
-         (setq startfile (concat user-emacs-directory "init_" name ".sh")))
+         (setq startfile (locate-user-emacs-file
+                          (concat "init_" name ".sh"))))
        (setq-local shell--start-prog (file-name-nondirectory prog))
        (apply #'make-comint-in-buffer "shell" buffer prog
               (if (file-exists-p startfile) startfile)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]