7

I'm trying to install php-mode, but I keep encountering this error when I run M-x php-mode:

Symbol's function definition is void: cl-macroexpand-all

The error persists whether I install php-mode via MELPA or manually.

Environment: Emacs 24.3.94.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-04 on builder10-9.porkrind.org

Why won't php-mode run? Note: I'm relatively new to Emacs, and inexperienced.

Malabarba
  • 22,878
  • 6
  • 78
  • 163
cg433n
  • 285
  • 2
  • 6
  • Same problem and same solution for [`cuda-mode`](http://melpa.org/#/cuda-mode) in MELPA (version `cuda-mode-20140704.1357`). When trying to enable `cuda-mode` using `M-x cuda-mode` the error comes, but after using `M-x load-library cl` the command `M-x cuda-mode` runs without problems. – boclodoa Dec 19 '14 at 21:43
  • `cuda-mode` is [on GitHub](https://github.com/chachi/cuda-mode); consider opening an issue using [its issue tracker](https://github.com/chachi/cuda-mode/issues). – Constantine Dec 19 '14 at 22:06
  • Here is the [issue](https://github.com/chachi/cuda-mode/issues/1), thank you :) – boclodoa Dec 19 '14 at 22:33

2 Answers2

7

The function cl-macroexpand-all has been obsoleted in Emacs 24.3; you are now supposed to use macroexpand-all instead, which is part of core Emacs, not the CL library.

The CL library defines cl-macroexpand-all as an alias for macroexpand-all, so in principle you could do

(require 'cl)

in your init file to fix the problem. However, the cl library itself is being deprecated, and using it is not recommended.

I think you should contact the authors of php-mode and tell them to use macroexpand-all.

jch
  • 5,680
  • 22
  • 39
  • The dev seems to be aware of the issue: [ejmr/php-mode#202](https://github.com/ejmr/php-mode/issues/202) – cg433n Oct 31 '14 at 15:50
4

It's bug #18845 in Emacs-24.4. To work around it, you need to add (require 'cl) somewhere before you load php-mode.

Stefan
  • 26,154
  • 3
  • 46
  • 84