emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/kiwix 3e1275d 7/7: use better "~" to replace "$HOME" en


From: Stefan Monnier
Subject: [elpa] externals/kiwix 3e1275d 7/7: use better "~" to replace "$HOME" environment variable
Date: Mon, 28 Dec 2020 13:56:18 -0500 (EST)

branch: externals/kiwix
commit 3e1275df1a560b61ef1bf1aa3343f731c7cb8992
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    use better "~" to replace "$HOME" environment variable
    
    Actually, it's the other way around: HOME is just an env-var and its
    meaning is defined by the platform (it just happens to work fine with
    the currently supported platforms), whereas "~/" is defined by Emacs so
    we (Emacs maintainers) have to make sure it works on all platforms. ;-)
---
 kiwix.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index 17adbde..8d51af3 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -90,21 +90,20 @@
 
 (defun kiwix-dir-detect ()
   "Detect Kiwix profile directory exist."
-  (let ((kiwix-dir (concat (getenv "HOME") "/.www.kiwix.org/kiwix")))
+  (let ((kiwix-dir "~/.www.kiwix.org/kiwix"))
     (if (and (file-directory-p kiwix-dir) (file-readable-p kiwix-dir))
         kiwix-dir
       (warn "ERROR: Kiwix profile directory \"~/.www.kiwix.org/kiwix\" is not 
accessible."))))
 
 (defcustom kiwix-default-data-profile-name
   (when (kiwix-dir-detect)
-    (car (directory-files
-          (concat (getenv "HOME") "/.www.kiwix.org/kiwix") nil 
".*\\.default")))
+    (car (directory-files "~/.www.kiwix.org/kiwix" nil ".*\\.default")))
   "Specify the default Kiwix data profile path."
   :type 'string)
 
 (defcustom kiwix-default-data-path
   (when (kiwix-dir-detect)
-    (concat (getenv "HOME") "/.www.kiwix.org/kiwix/" 
kiwix-default-data-profile-name))
+    (concat "~/.www.kiwix.org/kiwix/" kiwix-default-data-profile-name))
   "Specify the default Kiwix data path."
   :type 'string
   :safe #'stringp)



reply via email to

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