jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.37k stars 260 forks source link

Invalid read syntax #1062

Closed goldfita closed 9 months ago

goldfita commented 9 months ago

I've been having this issue for a while and haven't been able to figure out the cause. If I delete a package from the elpa directory and then attempt to re-install after setting use-package-always-ensure, e.g. (use-package atomic-chrome), I get

Debugger entered--Lisp error: (invalid-read-syntax "." 2 3)
  read(#<buffer .emacs.d>)

If I visit that buffer, I can then install the package. The first few lines of the buffer looks like this.

  /wsl/home/share/.emacs.d:
  .
  ..
  .cache

However, when I copy/paste, it looks like this. It's not in dired mode for some reason. I also tried opening that directory first instead of switching to the buffer opened by use-package, but that didn't work.

  /wsl/home/share/.emacs.d:
  drwxrwxrwx 1 goldfita goldfita    512 Oct  8 20:42 .
  drwxrwxrwx 1 goldfita goldfita    512 Oct  8 15:16 ..
  drwxrwxrwx 1 goldfita goldfita    512 May 17 18:17 .cache

I can also set use-package-always-ensure in my init.el and then when I start emacs, it installs the package.

package-user-dir /wsl/home/user/.emacs.d/elpa use-package-version 2.4.5 (the version built-in to emacs-29.1)

goldfita commented 9 months ago

I discovered this is being caused by setting custom-file to empty string, which prevents emacs from creating a customization file. I'm not sure if this is incorrect usage. As far as I'm aware, it's not breaking anything else.

See this discussion for a better way.