Kevin Jones
Kevin Jones

Reputation: 2367

Trying to get package.el to work on Mac OS X

My ultimate goal is to get Clojure/Swank/Slime running through Emacs on Mac OS X. To try and get there I'm installing various modes into Emacs (I'm trying both Aquamacs and EMacsforMacOsx). I've looked at several posts on here and elsewhere on the web and the current advice seems to be to use ELPA.

I've grabbed what I think is the latest package.el (for Emacs 23.x) from here and I can use this to install clojure-mode. As I like to know that things are working correctly I've also tried to delete packages that I've installed. When I do this (I use package-list-packages, D to delete, X to execute) I get the following error:

condition-case: Wrong type argument: stringp, #[(directory &optional recursive) ... ... [directory handler recursive delete-by-moving-to-trash directory-files-no-dot-files-regexp directory-file-name expand-file-name find-file-name-handler delete-directory directory-files ...] 7 1863281 (let ((dir (expand-file-name (read-file-name "Delete directory: " default- directory default-directory nil nil)))) (list dir (if (directory-files dir nil directory-files-no-dot-files-regexp) (y-or-n-p (format "Directory `%s' is not empty, really delete? " dir)) nil)))]

where the ...s are a bunch of hex characters

This is happening on both versions of Emacs I've tried.

Am I using the correct version of package.el.

If so, what can I do to fix this?

Thanks

Upvotes: 1

Views: 1297

Answers (2)

Kevin Jones
Kevin Jones

Reputation: 2367

thanks for the input. Rather than waste more time on this I've moved to Emacs 24 which gives me what I need. Thanks again,

Kevin

Upvotes: 1

Drew
Drew

Reputation: 30708

Assuming you have the right package.el (but see sanityinc's comment), load that source file explicitly (load-file "..../package.el"), then do M-x debug-on-entry package-delete. That will put you in the debugger when you invoke that function (which seems to be where there error is raised). Use d' to step orc' to continue, in the debugger, to follow the evaluation. Keep the source code displayed in a separate buffer so you can follow more easily.

What seems to be happening is that in the call (delete-directory dir t t) the DIR arg is not a string, which would mean that package--dir did not return a directory (string).

Also, it looks like the args for your version of delete-directory are (directory &optional recursive). At least in the version of package.el in Emacs 24, `delete-directory is actually called here with 3 args. But you didn't get a wrong-number-of-args error, so maybe your versions are different.

Anyway, use the debugger to try to find what went wrong. It seems likely that, as sanityinc suggested, you have a mismatch of code versions.

Upvotes: 1

Related Questions