13 votes
Accepted

How can I find which version of a particular mode I am using?

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 ...
user avatar
  • 13.5k
12 votes
Accepted

How to run multiple versions of emacs for package development?

There is a good collection of tools for Emacs Lisp testing: evm - Emacs Version Manager. Cask - project management tool for Emacs that helps automate the package development cycle; development, ...
user avatar
11 votes
Accepted

How do I inherit from prog-mode, whilst still supporting older emacsen?

At the cost of an extra top-level symbol binding, there's a very neat solution which avoids repeating the define-derived-mode form: (defalias 'my-fancy-parent-mode (if (fboundp 'prog-mode) 'prog-...
user avatar
  • 2,761
10 votes

Writing portable Elisp

Elisp is an interpreted language. You can put version-specific code in your .emacs, but protect it by testing at load time that it's operating on the correct version. (if (is-new-feature-available) ...
user avatar
8 votes
Accepted

How to test for specific Emacs version or newer?

Using emacs-version with the various version* functions is sane, yes. version= version< version<= (These are convenience wrappers which use the version-list functionality behind the scenes.) ...
user avatar
  • 43.1k
6 votes

Writing portable Elisp

(Community wiki. Please add yours!) If there's a function, added in a newer Emacs version, that you'd like to use, check whether it's defined with fboundp, and define a compatibility function if it's ...
5 votes
Accepted

(ucs-names) in Emacs 26 is not working for "EURO SIGN"

Do this, instead, starting with Emacs 26: (gethash "EURO SIGN" (ucs-names)) In other words, use something like this: (if (> emacs-major-version 25) (gethash "EURO SIGN" (ucs-names)) (cdr (...
user avatar
  • 69.1k
3 votes

How can I find which version of a particular mode I am using?

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 ...
user avatar
  • 43.1k
3 votes

How do I inherit from prog-mode, whilst still supporting older emacsen?

tl;dr: Use if and your own init function: (if (fboundp 'prog-mode) (define-derived-mode your-cool-mode prog-mode "Cool" "Docstring" (your-cool--init)) (define-derived-mode your-cool-...
user avatar
3 votes

How do I run multiple versions of Emacs with the same .emacs.d

Put the byte-compiled files for different Emacs versions in different directories. Make your load-path conditional on the Emacs version you are running, so that you load the appropriate byte-compiled ...
user avatar
  • 69.1k
2 votes
Accepted

Can't parse the output of manpages in pcmpl-args.el in Emacs 25.1.1

Well, the solution to this problem was a very simple one. The issue was that the encoding used for putting manpages (and maybe other things) into buffers in 25.1.1 was unsuitable for pcmpl-args ...
user avatar
  • 1,270
2 votes
Accepted

How to detect Emacs Mac Port in Elisp?

As amitp said in the comments, the window-system variable is 'mac on the Mac Port. Also, as pointed out by xuchunyang, emacs-version yields special output and mac-carbon-version-string is bound. ...
user avatar
  • 1,270
2 votes

New version of Org mode throws dbus-call-method: peculiar error: "Emacs not compiled with dbus support"

At least in the more recent version of org-mode (9.4.4), one can fix this issue by modifying the variable org-show-notification-handler, e.g., by adding the following to the init file: (setq org-show-...
user avatar
1 vote

Error when loading new version of org mode

I found the culprit in opening org files before loading the new version: (add-to-list 'load-path "~/code/org-mode/lisp") (require 'org-loaddefs) In a comment in that thread, I mentioned that the ...
user avatar
  • 1,489
1 vote

What happens if I have different versions of Emacs using the same directory

If you update packages in Emacs 26 you can use the same .emacs.d directory from Emacs 27.
user avatar
1 vote

What happens if I have different versions of Emacs using the same directory

I was in a similar situation few weeks ago, I wanted to have a fresh emacs instance but still wanted the old emacs around if I needed. I made a folder called ~/newhome and when starting emacs I ...
user avatar
1 vote

(ucs-names) in Emacs 26 is not working for "EURO SIGN"

I ended with: (defun my--get-char (name) "Get character by Unicode `name'." (cond ((>= 26 emacs-major-version) (gethash name (ucs-names))) ((>= 23 emacs-major-version) (cdr (...
user avatar
  • 3,122
1 vote

How to install sage-shell-mode with Emacs 25.1?

I loaded up MELPA and see sage-shell-mode listed. I don't know if this will solve the problem, but I've run into problems before with multiple package archives loading. Here is a function I use to ...
user avatar
  • 111
1 vote

A way to change Emacs versions at runtime (or some other way to fix an outdated package)

Install Emacs 24.5 in your $HOME. Multiple versions of Emacs can co-exist. Run below command line in shell, ./configure --prefix=$HOME/myemacs/24.4 --without-x-toolkit --without-x --without-xpm --...
user avatar
  • 4,581
1 vote

How can I find which version of a particular mode I am using?

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-...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible