3

How can I tell (from inside of .emacs) whether or not the Emacs version is Cocoa? I only want some configuration options to apply when they are loaded in Cocoa Emacs and not in the command-line version.

4

2 に答える 2

5

(featurep 'ns)NextStepemacs機能を確認してみてください。も参照してください。C-h v window-systemその変数がであるかどうかを確認できます'ns

于 2011-09-07T22:16:02.053 に答える
1

It's sufficient to do something similar to the following:

To see if you're on a Mac and not running in the command-line version:

(when (and (eq system-type 'darwin) window-system)
  (setq my-option "cocoa"))

To see if you're on a Mac and are running in the command-line version:

(when (and (eq system-type 'darwin) (not window-system))
  (setq my-option "command-line"))

EDIT: I edited my answer to check for both Mac (system-type) and not command-line (window-system).

于 2011-09-07T22:38:49.483 に答える