Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Can't I use old theme style file under Emacs 24.1?

Tags:

emacs

I can use my style file under 23.1, 23.4, but after I update Emacs to 24.1, I can't use the old style files. For example, one of my style files is color-theme-arjen.el. Here is the link:

https://github.com/credmp/color-theme-arjen/blob/master/color-theme-arjen.el

In my elisp file, I use following code to load the color theme:

(load-file "~/emacs/site-lisp/color-theme/master_color-theme-arjen.el") (color-theme-arjen)

I don't know why the color theme works under Emacs 23.1 & 23.4 but just doesn't work under Emacs 24.1.

While Emacs is loading the file, Emacs gives following error:

Symbol's function definition is void: plist-to-alist

If I uncomment above code and don't load the style file, the error is dismissed.

Does anyone know why this happens? Or how can I debug it?

like image 659
Watterry Avatar asked Jul 27 '12 15:07

Watterry


2 Answers

Yeah , I found this bug too. It seems that the Emacs 24 dosen't have the ' plist-to-alist ' function. So probably you should write it yourself. Here is mine. Put this function in your dot-emacs file then it will be ok.

(defun plist-to-alist (the-plist)
  (defun get-tuple-from-plist (the-plist)
    (when the-plist
      (cons (car the-plist) (cadr the-plist))))

  (let ((alist '()))
    (while the-plist
      (add-to-list 'alist (get-tuple-from-plist the-plist))
      (setq the-plist (cddr the-plist)))
  alist))

Hope it helps : )

like image 52
wenjun.yan Avatar answered Oct 17 '22 10:10

wenjun.yan


The color theme stuff was heavily revamped in 24, there is a color theme package included with emacs (see M-x customize-themes), and as far as I know breakage of older themes is expected.

The color theme package from marmalade reportedly works as well.

You should probably open a bug report for color-theme-arjen.

like image 3
jdd Avatar answered Oct 17 '22 11:10

jdd