2

On Windows Emacs v24.2.1 I get error:

(error "Required feature `cl-macs' was not provided")

I byte-compile my .emacs and here is code:

(with-no-warning (require 'cl-macs))

Actually (load "cl-macs") succeed but cl-macs.el lack (provide 'cl-macs) statement for that version (newer Emacs has corresponding provide statement).

What workaround to use for? I think:

(load "cl-macs")

but it look ugly in compare to usual (require '...).

(require 'cl-macs nil t) doesn't prevent from above error.

1

Do you need the macros at runtime? If you need them only at compile time, do this:

(eval-when-compile (require 'cl))

If you need them also at runtime (with byte-compiled code) then do this:

(load-library "cl-macs")
| improve this answer | |
  • Thanks. I ended with eval-when-compile but I like (cl-eval-when 'compile ...) but later absent at least in Emacs v24.2.1 (( – gavenkoa Dec 10 '15 at 21:50
  • I removed your edit. If you need a macro at runtime, there is no sense in using eval-when-compile. You would need a macro at runtime, for example, if you ran other (uncompiled) code at runtime that made use of one of the macros. This is unusual. What you probably need is just (eval-wnen-compile (require 'cl)). – Drew Dec 11 '15 at 15:03
  • Shouldn't the runtime solution be just (require 'cl)? – npostavs Dec 11 '15 at 15:56
  • @npostavs: That will certainly work too. But it will load lots of other stuff at runtime, in addition to the macros. If all you need are the macros, then just load the file that contains them. That's the point. – Drew Dec 11 '15 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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