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 (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.

  • Same problem and same solution for 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 <RET> cl the command M-x cuda-mode runs without problems.
    – boclodoa
    Dec 19, 2014 at 21:43
  • cuda-mode is on GitHub; consider opening an issue using its issue tracker. Dec 19, 2014 at 22:06
  • Here is the issue, thank you :)
    – boclodoa
    Dec 19, 2014 at 22:33

2 Answers 2


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.


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

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.