OpenSolaris2009.06のemacs環境の実行環境判別な設定
まあ、http://coderepos.org/share/browser/dotfiles/emacs/kentaro/のコピペです。
尚且つOpenSoalris以外で動かす予定なし><*1
で、OpenSolarisはどう判別するんだろう?
OS環境は、こんな感じ。
~$ uname -a
SunOS ionsolaris 5.11 snv_111b i86pc i386 i86pc Solaris
で、以下で調べてみた。
~/.emacsに以下を追加。
;; OSを判別、UNIX系? (defvar run-unix (or (equal system-type 'gnu/linux) (or (equal system-type 'usg-unix-v) (or (equal system-type 'berkeley-unix) (equal system-type 'cygwin))))) ; OSを判別、個別判別 (defvar run-linux (equal system-type 'gnu/linux)) (defvar run-system-v (equal system-type 'usg-unix-v)); OpenSolaris2090.06 (defvar run-bsd (equal system-type 'berkeley-unix)) (defvar run-cygwin ;; cygwinもunixグループにしておく (equal system-type 'cygwin)) (defvar run-w32 (and (null run-unix) (or (equal system-type 'windows-nt) (equal system-type 'ms-dos)))) (defvar run-darwin (equal system-type 'darwin)) ;; Emacsenの種類とVerを判別 (defvar run-emacs20 (and (equal emacs-major-version 20) (null (featurep 'xemacs)))) (defvar run-emacs21 (and (equal emacs-major-version 21) (null (featurep 'xemacs)))) (defvar run-emacs22 (and (equal emacs-major-version 22) (null (featurep 'xemacs)))); OpenSolaris2090.06 ;; meadowの種類とVerを判別 (defvar run-meadow (featurep 'meadow)) (defvar run-meadow1 (and run-meadow run-emacs20)) (defvar run-meadow2 (and run-meadow run-emacs21)) (defvar run-meadow3 (and run-meadow run-emacs22)) (defvar run-xemacs (featurep 'xemacs)) (defvar run-xemacs-no-mule (and run-xemacs (not (featurep 'mule)))) (defvar run-carbon-emacs (and run-darwin window-system))
結果は unix, system-v, emacs22 です。
で、だからどうした(`⌒´♯)って状態。