Skip to content

Wrong type argument: listp, nil/Projects/builds/emacs-git/src/emacs-git/ #1939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Hi-Angel opened this issue Mar 23, 2025 · 3 comments
Open
Labels

Comments

@Hi-Angel
Copy link
Contributor

I am a light projectile-user, so figured I'd report this here in case it may come up for other people as well.

Today after I forcefully closed my KDE session (was testing an effects plugin), which included my Emacs, and then started Emacs back I started getting an error:

Wrong type argument: listp, nil/Projects/builds/emacs-git/src/emacs-git/

I tried updating projectile, but the only difference I got is that before update the error was happening during (projectile-mode 1), whereas now it's upon opening a file under projectile control.

Turning on backtrace gives this output:

Debugger entered--Lisp error: (wrong-type-argument listp nil/Projects/builds/emacs-git/src/emacs-git/)
  cl-remove(nil ("~/Projects/kwin/" . nil/Projects/builds/emacs-git/src/emacs-git/) :if #f(compiled-function (x) #<bytecode 0x116b183d0f88c66b>))
  cl-remove-if(#f(compiled-function (x) #<bytecode 0x116b183d0f88c66b>) ("~/Projects/kwin/" . nil/Projects/builds/emacs-git/src/emacs-git/))
  projectile-difference(("~/Projects/kwin/" . nil/Projects/builds/emacs-git/src/emacs-git/) nil)
  projectile-merge-known-projects()
  projectile-add-known-project("/home/constantine/Projects/kwin/")
  projectile-track-known-projects-find-file-hook()
  projectile-find-file-hook-function()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer main.js> "~/Projects/kwin/src/plugins/fadedesktop/package/contents/code/main.js" nil nil "~/Projects/kwin/src/plugins/fadedesktop/package/contents/code/main.js" (44814766 27))
  find-file-noselect("/home/constantine/Projects/kwin/src/plugins/fadedesktop/package/contents/code/main.js" nil nil)
  ido-file-internal(raise-frame)
  ido-find-file()
  funcall-interactively(ido-find-file)
  call-interactively(ido-find-file nil nil)
  command-execute(ido-find-file)
@bbatsov bbatsov added the Bug label Mar 24, 2025
@Hi-Angel
Copy link
Contributor Author

By searching in ~/.emacs.d I found what causes it (although it doesn't reveal what resulted in that in the first place).

File ~/.emacs.d/projectile-bookmarks.eld has an ELisp list which starts with nil/Projects/builds/emacs-git/src/emacs-git/". So, like, nil/Projects/builds/emacs-git/src/emacs-git/" "some/other/project" "some/3rd/project").

Basically, the start of the file lacks parentheses and double quotes and in place of a tilde sign there's a nil for some reason. Replacing it as

@@ -1,1 +1,1 @@
-nil/Projects/builds/emacs-git/src/emacs-git/"
+("~/Projects/builds/emacs-git/src/emacs-git/"

and restarting Emacs fixes the problem.

@bbatsov
Copy link
Owner

bbatsov commented Mar 24, 2025

Seems like some cache serialization issue, but I'm not sure what might have caused it, as the logic there hasn't been changed in a long time.

@Hi-Angel
Copy link
Contributor Author

the logic there hasn't been changed in a long time.

Yeah, I don't think it's a regression, this seems more likely some corner case when Emacs isn't being closed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants