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:

  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
    Commented Dec 4, 2014 at 15:15

1 Answer 1


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

  • Thanks. Could you please explain your answer?
    – NVaughan
    Commented Dec 4, 2014 at 15:21
  • It says in the doc that it should be a list.
    – abo-abo
    Commented Dec 4, 2014 at 15:22
  • But what does this mean: (,user-emacs-directory "~")?
    – NVaughan
    Commented Dec 4, 2014 at 15:24
  • You can simplify to (list user-emacs-directory "~") if you want, it's the same.
    – abo-abo
    Commented Dec 4, 2014 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
    Commented Dec 4, 2014 at 16:24

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.