From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Benjamin Lewis Newsgroups: gmane.emacs.help Subject: Re: detect emacs/xemacs in elisp? Date: Mon, 09 Dec 2002 14:19:44 -0800 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <49e2e83d.0212091030.7c05b32@posting.google.com> <87of7uetyj.fsf@blind-bat.une.edu.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1039485714 26668 80.91.224.249 (10 Dec 2002 02:01:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2002 02:01:54 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18LZiY-0006vo-00 for ; Tue, 10 Dec 2002 03:01:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18LWQ6-00011K-04 for gnu-help-gnu-emacs@m.gmane.org; Mon, 09 Dec 2002 17:30:34 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!feed.news.nacamar.de!uio.no!quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: marge.cs.sfu.ca Original-X-Trace: quimby.gnus.org 1039473014 2737 199.60.3.71 (9 Dec 2002 22:30:14 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 9 Dec 2002 22:30:14 GMT X-Attribution: Benjamin Lewis X-Yow: I'm having a MID-WEEK CRISIS! User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) Cancel-Lock: sha1:tftz4Q6p6Et9aOb9uWSEX76Rdr4= Original-Xref: shelby.stanford.edu gnu.emacs.help:107908 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4459 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4459 On 10 Dec 2002, Tim X. wrote: > jason_addison@hotmail.com (Jason Addison) writes: > >> I have some elisp that works/doesn't work in emacs/xemacs in my >> ".emacs" file. I would like to be able to execute or not execute code >> depending on which type of emacs I'm running. Another way around this >> would be to know how to determine if a function is defined before >> calling it. Any idea on how to do this in elisp? Also, how do you >> determine the version of emacs that is running in elisp? >> > > There is a package called initz which allows you to setup different > initializations depending on what emacs/xemacs flavor you are > running. This package will then control what init files are used > depending on the flavor/version you are starting up. Do you really need a ``package'' to do this? Why not just make a .emacs with something like (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) (defvar running-em21 (>= emacs-major-version 21)) (cond (running-xemacs (load-file my-xemacs-init-file)) (running-em21 (load-file my-em21-specific-file)) (load-file my-default-file)) ... or whatever. -- Benjamin Lewis Dinosaurs aren't extinct. They've just learned to hide in the trees.