help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compatible .emacs for Gnu and xemacs


From: Chris Jones
Subject: Re: Compatible .emacs for Gnu and xemacs
Date: Mon, 01 Jun 2009 14:38:06 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

emacsy <hisnawi@hotmail.com> writes:

> Thanks for your responses guys.
> What I meant is actually porting/migrating my customizations in .emacs to
> work with xmeacs.
> So now when starting emacs, it picks up all the
> colors/functions/bindings...etc
> where when starting xemacs, it does not pick up anything from .emacs and
> shows plain basic xemacs.
> I learned that xemacs uses other files for customizations like .xemacs?
> So how could I make my customizations in .emacs be picked up by xemacs?

Here's how I do it:

My .emacs starts with this comment:

;; Xemacs doesn't read this file, but we use Xemacs' init file in Emacs.
;; However, Emacs does its own customizations.

After a bunch of code useful only in Emacs rather than Xemacs, it ends
with:

(let ((xemacs-init-file
       (expand-file-name "init.el" "~/.xemacs")))
  (load-file xemacs-init-file))

Inside the xemacs-init-file file, there is the following comment:

;; Note: this file is shared by FSF Emacs and Xemacs, hence the
;; "(featurep 'xemacs)" conditionializations below.

Then, code that only is needed or works in Xemacs has

(when (featurep 'xemacs) ...)

wrapped around it and code that only is needed or works in Emacs has

(unless (featurep 'xemacs) ...)

wrapped around it.

e.g. the following lines are in init.el:

  (when (featurep 'xemacs)
      (set-variable 'default-toolbar-visible-p nil))

Hope this helps.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]