Windows – How to use the Emacs color-theme on Windows and with the .emacs/.emacs.d

color-themeemacswindows 7

Here is what I have done:

  • Downloaded the latest release of GNU Emacs and installed it on Windows 7

  • Completed the tutorial

  • Set my home path as C:\Users\User, so I have a .emacs at C:\Users\User\.emacs, and there is a folder at C:\Users\User\.emacs.d\

  • Downloaded http://github.com/technomancy/emacs-starter-kit/ and wasn't entirely sure where to put it – I extracted the 'technomancy-emacs-starter-kit-b30f368' directory (just the contents) into my .emacs.d directory

Would it be useful for me to keep that starter kit package? And would it conflict with the http://ergoemacs.org/features.html package that I am planning to install?

  • I tried enabling org-mode by copying the suggested code into my Emacs file. (It didn't seem to change anything, but org-mode does seem to work – with and without this code in my .emacs file)

So then for the color-theme package, I extracted 'color-theme-6.6.0' (the directory) into .emacs.d, and then tried adding this to my .emacs file (with numerous variations, including back and forward slashes, and with full directory paths, and with ~/, etc).

However, I could not get it to work.

(add-to-list 'load-path "/color-theme-6.6.0/color-theme.el")
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-hober)))

From http://www.nongnu.org/color-theme/

What I am aiming to do:


In reference to @MyCubeIsMyCell

Thanks for the help 🙂 I decided to go with the GNU Emacs, as it seems to be updated more and more compatible with other applications – but correct me if I am wrong – are there any downsides to EmacsW32?

Sorry about that user.emacs thing – the text formatting function of this site requires it to be {double slash.emacs}\\.emacs, which I was unaware of! – they are both meant to be C:\Users\user.emacs, etc. I set my home to C:\Users\User, and my packages are in %home%.emacs.d\vendor. Does the ~ reference still apply to Windows?

My .emacs is now:

(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

(setq load-path (append load-path (list "~/.emacs.d/vendor")))
(setq load-path (append load-path (list "~/.emacs.d/vendor/color-theme")))

(require 'color-theme)
(color-theme-example)

This gives an error again, and I tried with different ways of typing the load-path again.

Symbol's function definition is void: color-theme-example

Best Answer

You might want to have a look at Emacs W32. Has some nice customizations for windows.

As for getting color theme working... I won't try to convert things to your current install, seems a few things are off there (file should just be .emacs - not User.emacs, same for .emacs.d directory). Instead I'll just tell you how I have things setup, shouldn't be too hard to translate if you want to keep your current config.

I find it easiest to just create a C:\home directory and set a HOME enviornment variable to point to that directory. Place your .emacs file in there. A .emacs.d directory will be created. I also like to create a directory named emacs_site_lisp in the home folder; C:\home\emacs_site_lisp. I place any and all packages or files under there for easy reference.

Put the color-theme directory in the emacs_site_lisp folder.

Then in my .emacs I have:

(setq load-path (append load-path (list "~/emacs_site_lisp")))
(setq load-path (append load-path (list "~/emacs_site_lisp/color-theme-6.6.0")))

(require 'color-theme)
(color-theme-hober)

Note that ~ references your home directory if not familiar with *nix.

That should work as a minimal .emacs - odds are you'll have a lot more stuff in there soon as you try different things out & tweak different settings, plenty of example .emacs to be found... just search on google: filetype:emacs

Good Luck.

Related Question