finding emacs version
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
finding emacs version         


Author: Rustom Mody
Date: May 14, 2007 09:32

How do you find out which emacs version is running in elisp?

I want to do:

if version is emacs-21
some code
else
some other code

How do you find out which emacs version is running in elisp?I want to do:if version is emacs-21    some codeelse    some other code 
3 Comments
Re: finding emacs version         


Author: Harald Hanche-Olsen
Date: May 14, 2007 09:49

+ "Rustom Mody" gmail.com>:

| How do you find out which emacs version is running in elisp?I want
| to do:if version is emacs-21 some codeelse some other code

(cond ((string= (substring emacs-version 0 2) "21")
code for version 21)
((string= (substring emacs-version 0 2) "22")
code for version 22)
(t code for other versions))

--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
no comments
Re: finding emacs version         


Author: Tassilo Horn
Date: May 14, 2007 09:55

"Rustom Mody" gmail.com> writes:

Hi,
> How do you find out which emacs version is running in elisp?

,----[ C-h v emacs-major-version RET ]
| emacs-major-version is a variable defined in `version.el'.
| Its value is 22
|
| Documentation:
| Major version number of this version of Emacs.
| This variable first existed in version 19.23.
`----

HTH,
Tassilo
--
People sometimes ask me if it is a sin in the Church of Emacs to use
vi. Using a free version of vi is not a sin; it is a penance. So happy
hacking. (Richard M. Stallman)
no comments
Re: finding emacs version         


Author: Stefan Monnier
Date: Jun 9, 2007 15:11

> How do you find out which emacs version is running in elisp?
> I want to do:
> if version is emacs-21
> some code
> else
> some other code

Please check the archive for this mailing list. It's been asked many times
in the past. And part of the answer is that you probably want to check
something more specific than the version number.

Stefan
no comments