Carbon emacs (OSX) & /usr/bin/emacs using the same .emacs

Carbon emacs (OSX) & /usr/bin/emacs using the same .emacs

Post by jOHn wON » Wed, 27 Aug 2008 04:27:04

Hi all,

in my .emac file, I want to load different things onto different emacs
by a structure such as the followings:

(if (or (eq window-system 'w32) (eq window-system 'win32))
(print "we are in windows!")
;; making Emacs to work with Cygwin
(setenv "PATH" (concat "C:/cygwin/bin;" (getenv "PATH")))
(setq exec-path (cons "C:/cygwin/bin/" exec-path))
(require 'setup-cygwin)
;; For subprocesses invoked via the shell
;; (e.g., "shell -c command")
(setq shell-file-name explicit-shell-file-name)))

Of course the above is for detecting windows, is there any parameter
that can let me tell the difference between Carbon Emacs and /usr/bin/
emacs Emacs (in darwin shell)?

mac-carbon-version-string is present in Carbon Emacs, and /usr/bin/
emacs is lacking such a variable. However, I do not know how to make
use of this to write the .emacs file (evaluating mac-carbon-version-
string will give me a "void-variable" error in /usr/bin/emacs)

Please suggest! Thanks in advance.

Carbon emacs (OSX) & /usr/bin/emacs using the same .emacs

Post by Paul Donne » Wed, 27 Aug 2008 06:22:41

jOHn wONg < XXXX@XXXXX.COM > writes:

I think WINDOW-SYSTEM will be NIL if you're running in a
terminal. That's how it is under Linux, anyway. Or at least the
variable should have some unique value that you can check.


Carbon emacs (OSX) & /usr/bin/emacs using the same .emacs

Post by Rupert Swa » Wed, 27 Aug 2008 06:26:21

jOHn wONg < XXXX@XXXXX.COM > writes:

I don't know anything about Carbon Emacs, so I'll have to trust you on
the variable name :) But in lisp there is a function called boundp,
which tells you whether a symbol is bound or not


(boundp 'somethingreallysilly)
=> nil


(boundp 'emacs-major-version)
=> t

Hope this helps,


Version: GnuPG v1.4.9 (GNU/Linux)


Carbon emacs (OSX) & /usr/bin/emacs using the same .emacs

Post by Barry Marg » Wed, 27 Aug 2008 10:26:07

In article

window-system is mac in Carbon Emacs, nil when /usr/bin/emacs is run in
a shell.

Barry Margolin, XXXX@XXXXX.COM
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***