1

Having previously set emacs-user-directory thus:

(setq user-emacs-directory "~/Dropbox/emacs")

I would now want to set desktop-path and desktop-dirname in this manner:

(setq
  desktop-path user-emacs-directory
  desktop-dirname user-emacs-directory
  )

However, when I start Emacs and it runs that code (by loading the desktop package) I get this error:

Wrong type argument: listp, "~/Dropbox/emacs_x"

How can I solve this problem?

  • desktop-path should be a list – abo-abo Dec 4 '14 at 15:15
2

Try it like this:

(setq desktop-path `(,user-emacs-directory "~"))

Documentation: List of directories to search for the desktop file. The base name of the file is specified in `desktop-base-file-name'.

| improve this answer | |
  • Thanks. Could you please explain your answer? – NVaughan Dec 4 '14 at 15:21
  • It says in the doc that it should be a list. – abo-abo Dec 4 '14 at 15:22
  • But what does this mean: (,user-emacs-directory "~")? – NVaughan Dec 4 '14 at 15:24
  • You can simplify to (list user-emacs-directory "~") if you want, it's the same. – abo-abo Dec 4 '14 at 15:25
  • 2
    @NVaughan To answer your question, this form ` (,user-emacs-directory "~") is a backquoted list. Using backquote instead of quote allows you to have some elements evaluated by prefixing them with a ,. See gnu.org/software/emacs/manual/html_node/elisp/Backquote.html. – glucas Dec 4 '14 at 16:24

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.