From 16703682153f63734334d61316cfcb45a5a4bb1a Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 04:30:37 -0700 Subject: [PATCH 1/9] fix(core): Mark files before retrieving the package-dir-info --- lisp/core/install-file.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index 50cea82c..ae2eadb4 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -51,6 +51,9 @@ ;; Note `package-dir-info' doesn't work outside of dired mode! (let ((pkg-desc (with-temp-buffer (dired path) + ;; After Emacs 31, the function `package-dir-info' + ;; will respect the marked files. + (dired-mark-files-in-region (point-min) (point-max)) (ignore-errors (package-dir-info))))) (unless pkg-desc ;; `package-dir-info' will return nil if there is no `-pkg.el' From 49112e37682e0c941d13318e5d89cc21e46efc3c Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 04:34:14 -0700 Subject: [PATCH 2/9] comment --- lisp/core/install-file.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index ae2eadb4..2da7b204 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -53,6 +53,8 @@ (dired path) ;; After Emacs 31, the function `package-dir-info' ;; will respect the marked files. + ;; + ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78521#17 (dired-mark-files-in-region (point-min) (point-max)) (ignore-errors (package-dir-info))))) (unless pkg-desc From 0d385190bfe6df431dbb1109e915e4dcbbe80b14 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:20:21 -0700 Subject: [PATCH 3/9] check output directly --- .github/workflows/{ => disabled}/analyze.yml | 0 .github/workflows/{ => disabled}/build.yml | 0 .github/workflows/{ => disabled}/compat.yml | 0 .github/workflows/{ => disabled}/compile.yml | 0 .github/workflows/{ => disabled}/config.yml | 0 .github/workflows/{ => disabled}/docker.yml | 0 .github/workflows/{ => disabled}/docs.yml | 0 .github/workflows/{ => disabled}/emacs.yml | 0 .github/workflows/{ => disabled}/exec.yml | 0 .github/workflows/{ => disabled}/exit_status.yml | 0 .github/workflows/{ => disabled}/global.yml | 0 .github/workflows/{ => disabled}/labeler.yml | 0 .github/workflows/{ => disabled}/link.yml | 0 .github/workflows/{ => disabled}/local.yml | 0 .github/workflows/{ => disabled}/options.yml | 0 .github/workflows/{ => disabled}/outdated_upgrade.yml | 0 .github/workflows/{ => disabled}/search.yml | 0 .github/workflows/{ => disabled}/test_buttercup.yml | 0 .github/workflows/{ => disabled}/test_ecukes.yml | 0 .github/workflows/{ => disabled}/test_ert-runner.yml | 0 .github/workflows/{ => disabled}/test_ert.yml | 0 .github/workflows/{ => disabled}/update_submodules.yml | 0 .github/workflows/{ => disabled}/upgrade-eask.yml | 0 .github/workflows/{ => disabled}/webinstall.yml | 0 .github/workflows/install.yml | 6 +++++- lisp/core/install-file.el | 1 + 26 files changed, 6 insertions(+), 1 deletion(-) rename .github/workflows/{ => disabled}/analyze.yml (100%) rename .github/workflows/{ => disabled}/build.yml (100%) rename .github/workflows/{ => disabled}/compat.yml (100%) rename .github/workflows/{ => disabled}/compile.yml (100%) rename .github/workflows/{ => disabled}/config.yml (100%) rename .github/workflows/{ => disabled}/docker.yml (100%) rename .github/workflows/{ => disabled}/docs.yml (100%) rename .github/workflows/{ => disabled}/emacs.yml (100%) rename .github/workflows/{ => disabled}/exec.yml (100%) rename .github/workflows/{ => disabled}/exit_status.yml (100%) rename .github/workflows/{ => disabled}/global.yml (100%) rename .github/workflows/{ => disabled}/labeler.yml (100%) rename .github/workflows/{ => disabled}/link.yml (100%) rename .github/workflows/{ => disabled}/local.yml (100%) rename .github/workflows/{ => disabled}/options.yml (100%) rename .github/workflows/{ => disabled}/outdated_upgrade.yml (100%) rename .github/workflows/{ => disabled}/search.yml (100%) rename .github/workflows/{ => disabled}/test_buttercup.yml (100%) rename .github/workflows/{ => disabled}/test_ecukes.yml (100%) rename .github/workflows/{ => disabled}/test_ert-runner.yml (100%) rename .github/workflows/{ => disabled}/test_ert.yml (100%) rename .github/workflows/{ => disabled}/update_submodules.yml (100%) rename .github/workflows/{ => disabled}/upgrade-eask.yml (100%) rename .github/workflows/{ => disabled}/webinstall.yml (100%) diff --git a/.github/workflows/analyze.yml b/.github/workflows/disabled/analyze.yml similarity index 100% rename from .github/workflows/analyze.yml rename to .github/workflows/disabled/analyze.yml diff --git a/.github/workflows/build.yml b/.github/workflows/disabled/build.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/disabled/build.yml diff --git a/.github/workflows/compat.yml b/.github/workflows/disabled/compat.yml similarity index 100% rename from .github/workflows/compat.yml rename to .github/workflows/disabled/compat.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/disabled/compile.yml similarity index 100% rename from .github/workflows/compile.yml rename to .github/workflows/disabled/compile.yml diff --git a/.github/workflows/config.yml b/.github/workflows/disabled/config.yml similarity index 100% rename from .github/workflows/config.yml rename to .github/workflows/disabled/config.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/disabled/docker.yml similarity index 100% rename from .github/workflows/docker.yml rename to .github/workflows/disabled/docker.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/disabled/docs.yml similarity index 100% rename from .github/workflows/docs.yml rename to .github/workflows/disabled/docs.yml diff --git a/.github/workflows/emacs.yml b/.github/workflows/disabled/emacs.yml similarity index 100% rename from .github/workflows/emacs.yml rename to .github/workflows/disabled/emacs.yml diff --git a/.github/workflows/exec.yml b/.github/workflows/disabled/exec.yml similarity index 100% rename from .github/workflows/exec.yml rename to .github/workflows/disabled/exec.yml diff --git a/.github/workflows/exit_status.yml b/.github/workflows/disabled/exit_status.yml similarity index 100% rename from .github/workflows/exit_status.yml rename to .github/workflows/disabled/exit_status.yml diff --git a/.github/workflows/global.yml b/.github/workflows/disabled/global.yml similarity index 100% rename from .github/workflows/global.yml rename to .github/workflows/disabled/global.yml diff --git a/.github/workflows/labeler.yml b/.github/workflows/disabled/labeler.yml similarity index 100% rename from .github/workflows/labeler.yml rename to .github/workflows/disabled/labeler.yml diff --git a/.github/workflows/link.yml b/.github/workflows/disabled/link.yml similarity index 100% rename from .github/workflows/link.yml rename to .github/workflows/disabled/link.yml diff --git a/.github/workflows/local.yml b/.github/workflows/disabled/local.yml similarity index 100% rename from .github/workflows/local.yml rename to .github/workflows/disabled/local.yml diff --git a/.github/workflows/options.yml b/.github/workflows/disabled/options.yml similarity index 100% rename from .github/workflows/options.yml rename to .github/workflows/disabled/options.yml diff --git a/.github/workflows/outdated_upgrade.yml b/.github/workflows/disabled/outdated_upgrade.yml similarity index 100% rename from .github/workflows/outdated_upgrade.yml rename to .github/workflows/disabled/outdated_upgrade.yml diff --git a/.github/workflows/search.yml b/.github/workflows/disabled/search.yml similarity index 100% rename from .github/workflows/search.yml rename to .github/workflows/disabled/search.yml diff --git a/.github/workflows/test_buttercup.yml b/.github/workflows/disabled/test_buttercup.yml similarity index 100% rename from .github/workflows/test_buttercup.yml rename to .github/workflows/disabled/test_buttercup.yml diff --git a/.github/workflows/test_ecukes.yml b/.github/workflows/disabled/test_ecukes.yml similarity index 100% rename from .github/workflows/test_ecukes.yml rename to .github/workflows/disabled/test_ecukes.yml diff --git a/.github/workflows/test_ert-runner.yml b/.github/workflows/disabled/test_ert-runner.yml similarity index 100% rename from .github/workflows/test_ert-runner.yml rename to .github/workflows/disabled/test_ert-runner.yml diff --git a/.github/workflows/test_ert.yml b/.github/workflows/disabled/test_ert.yml similarity index 100% rename from .github/workflows/test_ert.yml rename to .github/workflows/disabled/test_ert.yml diff --git a/.github/workflows/update_submodules.yml b/.github/workflows/disabled/update_submodules.yml similarity index 100% rename from .github/workflows/update_submodules.yml rename to .github/workflows/disabled/update_submodules.yml diff --git a/.github/workflows/upgrade-eask.yml b/.github/workflows/disabled/upgrade-eask.yml similarity index 100% rename from .github/workflows/upgrade-eask.yml rename to .github/workflows/disabled/upgrade-eask.yml diff --git a/.github/workflows/webinstall.yml b/.github/workflows/disabled/webinstall.yml similarity index 100% rename from .github/workflows/webinstall.yml rename to .github/workflows/disabled/webinstall.yml diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 66fff457..92369d03 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -71,6 +71,10 @@ jobs: if: matrix.os == 'windows-latest' run: .github/scripts/setup-eask.ps1 + # - name: Testing... + # run: | + # npm run test-unsafe test/jest/install.test.js + - name: Testing... run: | - npm run test-unsafe test/jest/install.test.js + eask install-file ./test/jest/install/foo-mode/ diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index 2da7b204..b787665e 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -56,6 +56,7 @@ ;; ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78521#17 (dired-mark-files-in-region (point-min) (point-max)) + (eask--unsilent (dired-get-marked-files)) (ignore-errors (package-dir-info))))) (unless pkg-desc ;; `package-dir-info' will return nil if there is no `-pkg.el' From 51c1523105974951819da02c19564dfb3ddc323b Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:21:34 -0700 Subject: [PATCH 4/9] test only --- .github/workflows/install.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 92369d03..609665fa 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -32,10 +32,10 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - - 26.3 - - 27.2 - - 28.2 - - 29.4 + # - 26.3 + # - 27.2 + # - 28.2 + # - 29.4 - 30.1 experimental: [false] include: From c64627d9dfaf2742f2b73c4195a91fe6019a228f Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:32:02 -0700 Subject: [PATCH 5/9] try print out --- lisp/core/install-file.el | 7 ++++--- test/jest/install/Eask | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index b787665e..ffcdc710 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -55,9 +55,10 @@ ;; will respect the marked files. ;; ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78521#17 - (dired-mark-files-in-region (point-min) (point-max)) - (eask--unsilent (dired-get-marked-files)) - (ignore-errors (package-dir-info))))) + ;;(dired-mark-files-in-region (point-min) (point-max)) + (eask--unsilent + (message "? %s" (dired-get-marked-files)) + (ignore-errors (package-dir-info)))))) (unless pkg-desc ;; `package-dir-info' will return nil if there is no `-pkg.el' ;; and no `.el' files at path diff --git a/test/jest/install/Eask b/test/jest/install/Eask index 7379a769..94c5ac96 100644 --- a/test/jest/install/Eask +++ b/test/jest/install/Eask @@ -55,3 +55,32 @@ (depends-on "ert-runner")) (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 + + +(defun package-dir-info () + "Find package information for a directory. +The return result is a `package-desc'." + (cl-assert (derived-mode-p 'dired-mode)) + (let* ((desc-file (package--description-file default-directory))) + (if (file-readable-p desc-file) + (with-temp-buffer + (insert-file-contents desc-file) + (package--read-pkg-desc 'dir)) + (catch 'found + (let ((files (or (and (derived-mode-p 'dired-mode) + (dired-get-marked-files)) + (directory-files-recursively default-directory "\\.el\\'")))) + ;; We sort the file names in lexicographical order, to ensure + ;; that we check shorter file names first (ie. those further + ;; up in the directory structure). + (dolist (file (sort files)) + ;; The file may be a link to a nonexistent file; e.g., a + ;; lock file. + (when (file-exists-p file) + (with-temp-buffer + (insert-file-contents file) + ;; When we find the file with the data, + (when-let* ((info (ignore-errors (package-buffer-info)))) + (setf (package-desc-kind info) 'dir) + (throw 'found info)))))) + (error "No .el files with package headers in `%s'" default-directory))))) From ee3af21bf395a3716338aa2689818b34178d86e3 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:35:23 -0700 Subject: [PATCH 6/9] retry --- lisp/core/install-file.el | 2 +- test/jest/install/Eask | 29 ----------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index ffcdc710..1f201a50 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -55,7 +55,7 @@ ;; will respect the marked files. ;; ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78521#17 - ;;(dired-mark-files-in-region (point-min) (point-max)) + (dired-mark-files-in-region (point-min) (point-max)) (eask--unsilent (message "? %s" (dired-get-marked-files)) (ignore-errors (package-dir-info)))))) diff --git a/test/jest/install/Eask b/test/jest/install/Eask index 94c5ac96..7379a769 100644 --- a/test/jest/install/Eask +++ b/test/jest/install/Eask @@ -55,32 +55,3 @@ (depends-on "ert-runner")) (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 - - -(defun package-dir-info () - "Find package information for a directory. -The return result is a `package-desc'." - (cl-assert (derived-mode-p 'dired-mode)) - (let* ((desc-file (package--description-file default-directory))) - (if (file-readable-p desc-file) - (with-temp-buffer - (insert-file-contents desc-file) - (package--read-pkg-desc 'dir)) - (catch 'found - (let ((files (or (and (derived-mode-p 'dired-mode) - (dired-get-marked-files)) - (directory-files-recursively default-directory "\\.el\\'")))) - ;; We sort the file names in lexicographical order, to ensure - ;; that we check shorter file names first (ie. those further - ;; up in the directory structure). - (dolist (file (sort files)) - ;; The file may be a link to a nonexistent file; e.g., a - ;; lock file. - (when (file-exists-p file) - (with-temp-buffer - (insert-file-contents file) - ;; When we find the file with the data, - (when-let* ((info (ignore-errors (package-buffer-info)))) - (setf (package-desc-kind info) 'dir) - (throw 'found info)))))) - (error "No .el files with package headers in `%s'" default-directory))))) From 4396d59fedca6a76aeca6299c09b03514d550851 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:38:49 -0700 Subject: [PATCH 7/9] try unmark --- lisp/core/install-file.el | 2 +- test/jest/install/Eask | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index 1f201a50..9a5771ca 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -55,7 +55,7 @@ ;; will respect the marked files. ;; ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78521#17 - (dired-mark-files-in-region (point-min) (point-max)) + (dired-unmark-all-marks) (eask--unsilent (message "? %s" (dired-get-marked-files)) (ignore-errors (package-dir-info)))))) diff --git a/test/jest/install/Eask b/test/jest/install/Eask index 7379a769..94c5ac96 100644 --- a/test/jest/install/Eask +++ b/test/jest/install/Eask @@ -55,3 +55,32 @@ (depends-on "ert-runner")) (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 + + +(defun package-dir-info () + "Find package information for a directory. +The return result is a `package-desc'." + (cl-assert (derived-mode-p 'dired-mode)) + (let* ((desc-file (package--description-file default-directory))) + (if (file-readable-p desc-file) + (with-temp-buffer + (insert-file-contents desc-file) + (package--read-pkg-desc 'dir)) + (catch 'found + (let ((files (or (and (derived-mode-p 'dired-mode) + (dired-get-marked-files)) + (directory-files-recursively default-directory "\\.el\\'")))) + ;; We sort the file names in lexicographical order, to ensure + ;; that we check shorter file names first (ie. those further + ;; up in the directory structure). + (dolist (file (sort files)) + ;; The file may be a link to a nonexistent file; e.g., a + ;; lock file. + (when (file-exists-p file) + (with-temp-buffer + (insert-file-contents file) + ;; When we find the file with the data, + (when-let* ((info (ignore-errors (package-buffer-info)))) + (setf (package-desc-kind info) 'dir) + (throw 'found info)))))) + (error "No .el files with package headers in `%s'" default-directory))))) From 0f439757cb42c110affb79ac6c37a3c0bdd6ed4f Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:40:31 -0700 Subject: [PATCH 8/9] try silent --- lisp/core/install-file.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index 9a5771ca..cccb5287 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -40,7 +40,7 @@ (let ((pkg-desc (with-temp-buffer (insert-file-contents-literally path) (tar-mode) - (ignore-errors (package-tar-file-info))))) + (eask-ignore-errors-silent (package-tar-file-info))))) (unless pkg-desc ;; `package-dir-info' will return nil if there is no `-pkg.el' ;; and no `.el' files at path @@ -58,7 +58,7 @@ (dired-unmark-all-marks) (eask--unsilent (message "? %s" (dired-get-marked-files)) - (ignore-errors (package-dir-info)))))) + (eask-ignore-errors-silent (package-dir-info)))))) (unless pkg-desc ;; `package-dir-info' will return nil if there is no `-pkg.el' ;; and no `.el' files at path From 729f443669b52ec66e89f06f37accffd895ecddd Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 May 2025 05:55:00 -0700 Subject: [PATCH 9/9] print latest --- lisp/core/install-file.el | 2 +- test/jest/install/Eask | 29 ----------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/lisp/core/install-file.el b/lisp/core/install-file.el index cccb5287..7b079f66 100644 --- a/lisp/core/install-file.el +++ b/lisp/core/install-file.el @@ -58,7 +58,7 @@ (dired-unmark-all-marks) (eask--unsilent (message "? %s" (dired-get-marked-files)) - (eask-ignore-errors-silent (package-dir-info)))))) + (ignore-errors (package-dir-info)))))) (unless pkg-desc ;; `package-dir-info' will return nil if there is no `-pkg.el' ;; and no `.el' files at path diff --git a/test/jest/install/Eask b/test/jest/install/Eask index 94c5ac96..7379a769 100644 --- a/test/jest/install/Eask +++ b/test/jest/install/Eask @@ -55,32 +55,3 @@ (depends-on "ert-runner")) (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 - - -(defun package-dir-info () - "Find package information for a directory. -The return result is a `package-desc'." - (cl-assert (derived-mode-p 'dired-mode)) - (let* ((desc-file (package--description-file default-directory))) - (if (file-readable-p desc-file) - (with-temp-buffer - (insert-file-contents desc-file) - (package--read-pkg-desc 'dir)) - (catch 'found - (let ((files (or (and (derived-mode-p 'dired-mode) - (dired-get-marked-files)) - (directory-files-recursively default-directory "\\.el\\'")))) - ;; We sort the file names in lexicographical order, to ensure - ;; that we check shorter file names first (ie. those further - ;; up in the directory structure). - (dolist (file (sort files)) - ;; The file may be a link to a nonexistent file; e.g., a - ;; lock file. - (when (file-exists-p file) - (with-temp-buffer - (insert-file-contents file) - ;; When we find the file with the data, - (when-let* ((info (ignore-errors (package-buffer-info)))) - (setf (package-desc-kind info) 'dir) - (throw 'found info)))))) - (error "No .el files with package headers in `%s'" default-directory)))))