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

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

[elpa] externals/kiwix 6e6959b 045/192: improve custom options


From: Stefan Monnier
Subject: [elpa] externals/kiwix 6e6959b 045/192: improve custom options
Date: Sat, 19 Dec 2020 00:41:30 -0500 (EST)

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

    improve custom options
    
    Make them smarter depend on different cases.
---
 kiwix.el | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index d481fba..d302aac 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -35,17 +35,32 @@
   :type 'string
   :group 'kiwix)
 
-(defcustom kiwix-server-command "/usr/lib/kiwix/bin/kiwix-serve "
+(defcustom kiwix-server-command
+  (cond
+   ((string-equal system-type "gnu/linux")
+    "/usr/lib/kiwix/bin/kiwix-serve ")
+   ((string-equal system-type "darwin")
+    (warn "You need to specify Mac OS X Kiwix path. And send a PR to my 
repo."))
+   ((string-equal system-type "windows-nt")
+    (warn "You need to specify Windows Kiwix path. And send a PR to my 
repo.")))
   "Specify kiwix server command."
   :type 'string
   :group 'kiwix)
 
-(defcustom kiwix-default-data-profile-name "8ip89lik.default"
+(defcustom kiwix-default-data-profile-name
+  (car (directory-files
+        (concat
+         (getenv "HOME") "/.www.kiwix.org/kiwix")
+        nil
+        ".*\\.default"
+        ))
   "Specify the default Kiwix data profile path."
   :type 'string
   :group 'kiwix)
 
-(defcustom kiwix-default-data-path (concat (getenv "HOME") 
"/.www.kiwix.org/kiwix/" kiwix-default-data-profile-name)
+(defcustom kiwix-default-data-path
+  (concat
+   (getenv "HOME") "/.www.kiwix.org/kiwix/" kiwix-default-data-profile-name)
   "Specify the default Kiwix data path."
   :type 'string
   :group 'kiwix)



reply via email to

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