Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check which Emacs I am using?

Tags:

emacs

I have two Emacs (Aquamacs and text-based Emacs) on my Mac.

In my .emacs file, I can check if I'm using Aquamacs with ...

(boundp 'aquamacs-version)

How can I check if I'm using text based emacs?

EDIT

Jürgen Hötzel's answer works, but for text based emacs, using

(unless (null window-system) ...) 

is better as (window-system) is not defined.

like image 461
prosseek Avatar asked Jan 07 '11 21:01

prosseek


3 Answers

M-x emacs-version

ad some more characters here......

Sorry, from .emacs, just call

(emacs-version)
like image 92
Charlie Martin Avatar answered Oct 07 '22 02:10

Charlie Martin


I know this question was answered a long time ago, but I found another answer by typing emacs --help. This gives a list of options in which you can find emacs --version.

In my case, emacs --version prints: GNU Emacs 24.3.1.

I have only tested this solution on Linux with my current version of Emacs. I do not know if the same solution applies to Windows, or to older versions of Emacs, but in theory it should.

like image 9
Thanos Avatar answered Oct 07 '22 00:10

Thanos


(if (window-system)
    "window-based"
  "text-based")
like image 4
Jürgen Hötzel Avatar answered Oct 07 '22 01:10

Jürgen Hötzel