How can I find out if I'm running emacs or aquamacs in a .emacs file?

I want to create a different environment between Cocoa emacs and Aquamacs. They both read ~ / .emacs, so I tried something like this.

(unless (symbolp 'aquamacs-version)
; code for emacs
)

But that does not work.

How can I find out if I'm running emacs or aquamacs?

+5
source share
5 answers

I would try (boundp 'aquamacs-version).

+8
source

I believe what you are looking for:

(when (featurep 'aquamacs)
   ...)
+3
source

aquamacs .emacs, aquamacs Preferences.el aquamacs:

Aquamacs Aquamacs Emacs, ( Carbon Emacsen) Emacs. (.emacs)

:

~/.emacs( - ' , - - Aquamacs OS X) , Aquamacs customizations.el /Library/Preferences/Emacs/Preferences.el /Library/Preferences/Aquamacs Emacs/Preferences.el ~/Library/Preferences/Emacs/Preferences.el ~/Library/Preferences/Aquamacs Emacs/Preferences.el

+2

(symbolp 'aquamacs-version) . (boundp 'aquamacs-version) , ( "" ) . , , , (progn nil), .

aquamacs-version - , , (fboundp 'aquamacs-version).

+2

I cannot verify this, but if you cannot identify Aquamacs with system-typeor window-system, then I think you could identify it from the command used to run it. Assuming the executable / link is actually called "aquamacs", then I think something like this should do the trick:

(unless (equal (car command-line-args) "aquamacs")
  ...)

Otherwise, try M-x apropos-value aquamacs RETsearching for any variables containing this string for use in a similar comparison.

0
source

All Articles