Вы можете сделать это:
(if (equal system-type 'windows-nt)
(progn
(... various windows-nt stuff ...)))
(if (equal system-type 'darwin)
(progn
(... various mac stuff ...)))
То, что я делаю в моем .emacs - это установка переменной (я называю это this-config) в зависимости от типа и имени машины.Затем я везде использую одни и те же .emacs.
Используя этот код, я могу вытащить имя машины:
(defvar this-machine "default")
(if (getenv "HOST")
(setq this-machine (getenv "HOST")))
(if (string-match "default" this-machine)
(if (getenv "HOSTNAME")
(setq this-machine (getenv "HOSTNAME"))))
(if (string-match "default" this-machine)
(setq this-machine system-name))
Затем вы можете установить этот-config на основе типа системы и /или имя машины.
Затем я использую этот код:
(cond ((or (equal this-machine "machineX")
(equal this-machine "machineY"))
(do some setup for machineX and machineY))
Редактировать: system-type
возвращает символ, а не строку