I'm trying to create a .emacs
file that works on multiple platforms. Therefore, I declare a variable with a path for each platform
(defvar macosx-p (string-match "darwin" (symbol-name system-type)))
(defvar gnulinux-p (string-match "linux" (symbol-name system-type)))
(defvar mswindows-p (string-match "windows" (symbol-name system-type)))
(defconst macosx-ps "/Users/xxx/")
(defconst gnulinux-ps "/home/xxx")
(defconst mswindows-ps "D:/xxx")
How can I pass one of the -ps
variables to a function like this?
(if macosx-p
(progn
(setq org-capture-templates
'(("t" "TODO" entry (file+headline (concat macosx-ps "file.org") "Inbox")
"* TODO %?")))))
(if gnulinux-p
(progn
(setq org-agenda-files (quote
((concat gnulinux-ps "file.org")
(concat gnulinux-ps "others/"))))))
I want macosx-ps
to output my path string.
string-match
andsymbol-name
? You could simply test(eq 'darwin system-type)
.