code for both Xemacs and GNU emacs

Uwe Brauer oub at mat.ucm.es
Tue Dec 6 15:07:15 EST 2005


Hello


What is the best way to provide code which can be understood by both
emacsen.

I have seen so far:

Code for both emacsen

(if (featurep 'xemacs)
code for xemacs
)

But what  if I had code specifically for GNU emacs.

Would the following be a good idea? Taken from the .emacs skeleton file.

(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))

Code for both emacsen

(cond (running-xemacs

Code for xemacs
))


(cond ((and (not running-xemacs)
	    (> emacs-major-version 19))

Code for gnus goes here
))



Or are there better solutions?

Thanks


Uwe Brauer 





More information about the XEmacs-Beta mailing list