5

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?

4 Answers 4

21

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 : )

2
  • Thank you very much! Coming from a vim backgroud, I am startled seeing how much tweaking is needed in the emacs hemisphere to get things up and running. (My vim is heavily modded, and I am trying emacs because supposedly there exist even more possibilities for tweaking and because I know a little lisp.)`
    – sjas
    Commented Nov 17, 2013 at 14:35
  • brilliant, now my .emacs file works again with emacs 24.3.1, thanks so much!
    – Bogatyr
    Commented Feb 26, 2014 at 10:13
3

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.

0

I have little idea why, but when installing the solarized theme in emacs 24.3.1 on MacOS X, I found that if I put my init lines:

(load-file "~/lisp/color-theme/color-theme.el")
(load-file "~/lisp/emacs-colors-solarized/color-theme-solarized.el")
(color-theme-solarized 'dark)

after I turned off the scroll bars:

(if (featurep 'scroll-bar)
    (scroll-bar-mode -1))

it worked fine. The other way around, I get the error above. I've no idea why the color-theme-alist function is affected by the absence of a scroll bar (the plist-to-alist function call seems to be only for XEmacs)

0

I definitely thanks wenjun.yan. But i would rather want to check if the function exist before defining it :

(unless (fboundp 'plist-to-alist) 
(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)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.