8

For example, I want to use a library that requires I am on org-mode version 8 or above. I don't know what version of org-mode I have.

Running M-x version only gives me the emacs version. Is there a command where I can get the org-mode version?

NOTE: As @Drew mentioned in the comments, I am searching for the version of a package, not a mode. In this example, I want to get the version of the org-mode package, not the version of org-mode itself.

modulitos
  • 2,432
  • 1
  • 18
  • 36
  • 1
    `M-x org-version`? – Name Jul 26 '15 at 10:40
  • Yep, that works! I guess it's slightly different for each mode? For example, to get the current `markdown-mode` version, I run `M-x markdown-show-version`. It'd be nice if there was a generic method, but I guess it is sufficient to just run `M-x -version ` and the autocomplete should find the rest... – modulitos Jul 26 '15 at 10:42
  • `M-x describe-package org` – xuchunyang Jul 26 '15 at 10:50
  • 1
    Perfect! @xuchunyang if you post as an answer, I will gladly accept. Perhaps it will help future readers. If not, I'll just delete the question. – modulitos Jul 26 '15 at 10:55
  • 1
    Packages and other libraries can have versions. Modes typically do not have versions. You might want to edit your question to clarify - it seems you are looking for the version of a *package*. – Drew Jul 26 '15 at 13:30

4 Answers4

14

You can use C-h P (describe-package). After entering a package name, the attributes (including version) of the package will be listed in the *Help* buffer. Besides, you can also view the version of a package from Package Menu (M-x list-packages).

xuchunyang
  • 14,302
  • 1
  • 18
  • 39
3

Packages aside, note that M-x find-library will take you to the source code for a given library name. Assuming the author has assigned a version, you will typically find that information specified in the comments at the top of the file.

phils
  • 48,657
  • 3
  • 76
  • 115
1

You can also do this programmatically:

(require 'find-func)
(require 'lisp-mnt)

(defun get-library-version (library)
  "Return a version string for LIBRARY."
  (with-temp-buffer
    (insert-file-contents (find-library-name library))
    (or (lm-header "package-version")
        (lm-header "version"))))

Here's an example usage:

(get-library-version "auctex") ;=> "13.0.12"
0

M-x list-packages takes you to a list of all the packages, including what you have installed and their version number.

For example, to look for wc-mode. I C-s wc-mode. Or I can click the "status" to sort the different packages in the order of "installed", "available" etc...

Pandian Le
  • 260
  • 3
  • 13