dimitri / el-get

Manage the external elisp bits and pieces upon which you depend!
http://tapoueh.org/emacs/el-get.html
1.64k stars 457 forks source link

fix: car for t in el-get-read-status-file-force #2919

Open kenoss opened 4 months ago

kenoss commented 4 months ago

When I remove el-get dir and try to reinitialize, el-get-read-status-file-force fails with an error Wrong type argument: listp, t. This is due to make-directory returns t when directry is aleady exists. Indeed, it actually guarantees that retruning non-nil [1]. So, el-get-read-status-file-force tries to evaluate the following sexp:

(let ((ps t))
  (cond
   ((null ps)
    (list (list 'el-get 'status "required")))
   ((consp (car ps)) ps)
   (t (el-get-convert-from-old-status-format ps))))

This patch ensures that this case is handled by the default branch.

[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Create_002fDelete-Dirs.html#index-make_002ddirectory

kenoss commented 4 months ago
$ emacs --version
GNU Emacs 29.2
$ uname -a
Linux keno-asahi 6.6.3-411.asahi.fc39.aarch64+16k #1 SMP PREEMPT_DYNAMIC Tue Dec 19 10:21:20 UTC 2023 aarch64 GNU/Linux

I couldn't understand why ;; ps is an alist, no conversion needed. Let me know if I can improve my patch and comments.