I'm using emacs on both Mac OS X and Ubuntu. My .emacs is mostly the same for both platforms, with a couple of lines concerning local fonts and other OS-related stuff. As I usually do additions to my .emacs files, I would like to sync them in a quasi-automatic manner. My question is---is there a way in Lisp to add a conditional procedure to detect the running OS? Something like (pseudo-code):
If OS X:
run this and that command;
If Linux:
run that other command;
Fi
Thanks in advance.
Following bmeric's advice, this solution worked for me:
(cond
((string-equal system-type "gnu/linux")
;; window size
(add-to-list 'default-frame-alist '(left . 0))
(add-to-list 'default-frame-alist '(top . 0))
(add-to-list 'default-frame-alist '(height . 32))
(add-to-list 'default-frame-alist '(width . 70))
)
((string-equal system-type "darwin")
;; window size
(add-to-list 'default-frame-alist '(left . 0))
(add-to-list 'default-frame-alist '(top . 0))
(add-to-list 'default-frame-alist '(height . 63))
(add-to-list 'default-frame-alist '(width . 100))
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With