eschulte / emacs-web-server

web server running Emacs Lisp handlers.
eschulte.github.io/emacs-web-server/index.html#Top
GNU General Public License v3.0
173 stars 30 forks source link

Hidden dependency on cl #5

Closed tburette closed 10 years ago

tburette commented 10 years ago

If cl is not loaded, the error message Caught Error: (void-function symbol-macrolet) appears when the server handles a request.

A (require 'cl) must be done somewhere to make the error go away. This dependency is not mentioned anywhere.

Any servlet will trigger the error. For example :

(ws-start                                                                                                                                                                                                                                
 (lambda (request)                                                                                                                                                                   
   (with-slots (process headers) request
     (ws-response-header process 200 '("Content-Type" . "text/plain"))
     (process-send-string process "Hello world\n")))
 9000)

I'm a bit puzzled as I have found no reference to symbol-macrolet. My elisp/emacs skills are too weak to find where the error is coming from.

I'm using the package web-server-20140501.1218 and running emacs 24.3.1

eschulte commented 10 years ago

This problem might be specific to your version of Emacs. With GNU Emacs 24.4.50.2, simply requireing web-server will result in symbol-macrolet being defined (as an alias for cl-symbol-macrolet in cl-lib).

If this is in fact an error, then it is probably an issue with eieio, and should be fixed there. That said if this is biting a lot of people, perhaps it would be worthwhile adding a note to (require 'cl) when this issue is encountered.... I'm just not sure where to add such a warning.

thesoftwarebin commented 10 years ago

My two cents about where to document it: I vote for section REQUIREMENTS in the README file, which I think is shown when you M-x list-packages and select package web-server.

The text could be something like "eieio version: xyz or above; if you have lower versions and get a Caught Error: (void-function symbol-macrolet) then try adding (require 'cl) at start of your file".

eschulte commented 10 years ago

Would it be sufficient to require Emacs 24.4 instead of Emacs 24.3 (eieio is maintained as part of Emacs, so it might no longer have a version seperate from the Emacs version)? This would certainly be simpler.

I guess what I'm asking is, "does upgrading to Emacs 24.4 remove the cl dependency on your systems"?

Thanks,

eschulte commented 10 years ago

Looking at the Emacs commits, it seems this issues in eieio (bug#16998) was fixed March 12th, and the bump to Emacs 24.4 occured March 21st. So changing the requirement from Emacs 24.3 to Emacs 24.4 should be sufficient.

thesoftwarebin commented 10 years ago

The requirement emacs-24.4 is now preventing installation from ELPA to users with emacs 24.3 or older. Package is shown in list-packages but refuses to install. Not a big problem as long as we can download from here, but it's unfortunate that emacs-web-server loses some potential audience.

I just had an :-1: evil thought :-1: : one could trick Emacs 24.3 and install from ELPA anyway, for example by playing with M-x toggle-debug-on-entry RET package-installed-p RET ... :-)

eschulte commented 10 years ago

Emacs 24.4 is in pretest and should be released in the very near future, so this shouldn't be a problem for long.