(This has started happening with other commands too, but I don't remember which.)

Previously when I ran M-x desktop-change-dir I would be prompted to enter a folder, whereupon Emacs would load the .emacs-desktop saved there. Now it loads only one file from the .emacs-desktop, and then gives the error below. My .emacs dotfile does not include the string desktop anywhere, and hever has, so I don't think it's responsible. It's possible I'm now on a newer version of Emacs (I use NixOS and have it upgrade things nightly). I don't know what I was on before, but lately running M-x emacs-version prints

GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0)

Here's the error:

Debugger entered--Lisp error: (wrong-number-of-arguments (0 . 0) 1)
  desktop-create-buffer(208 "/home/jeff/nix/jbb-config/packages.nix" "packages.nix" nix-mode (override-global-mode global-auto-revert-mode beacon-mode org-roam-mode) 2221 (538 nil) nil nil ((tab-width . 2) (indent-tabs-mode) (buffer-display-time 24781 5953 925334 220000) (buffer-file-coding-system . undecided-unix)) ((mark-ring (538))))
  eval-buffer(#<buffer  *load*> nil "/home/jeff/nix/jbb-config/.emacs.desktop" nil t)  ; Reading at buffer position 3145
  load-with-code-conversion("/home/jeff/nix/jbb-config/.emacs.desktop" "/home/jeff/nix/jbb-config/.emacs.desktop" t t)
  load("/home/jeff/nix/jbb-config/.emacs.desktop" t t t)
  funcall-interactively(desktop-change-dir "~/nix/jbb-config/")
  call-interactively(desktop-change-dir record nil)
  command-execute(desktop-change-dir record)
  execute-extended-command(nil "desktop-change-dir" "desk-ch")
  funcall-interactively(execute-extended-command nil "desktop-change-dir" "desk-ch")
  call-interactively(execute-extended-command nil nil)
  • Thanks, @Drew! That indeed did the trick. I just created a new desktop -- maybe some people have complicated ones but for me it's just a list of files to open, so it's easy to recreate. Jul 23, 2021 at 2:08
  • In that case, I moved the comment to an answer, since comments can be deleted at any time. If you think this Q&A is not likely to help others, feel free to delete the question (which will also delete the answer).
    – Drew
    Jul 23, 2021 at 15:56

1 Answer 1


Sounds like whatever was saved in your desktop file is the problem. Some code there is calling org-roam and passing it an argument, but it expects zero arguments.

You can try bisecting your desktop file. Or you can just toss that desktop file and create a new one.

(OP confirmed that creating a new desktop file solved the problem.)

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.