From cd3013b7201a4f7ce266cf76defb6c1b94d818be Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 22 Apr 2025 15:35:03 -0700 Subject: [PATCH 1/4] fix: Warning missing lexical-binding cookie in Eask-file --- Easkfile | 2 ++ lisp/_prepare.el | 7 +++++++ lisp/core/init.el | 4 +++- lisp/init/cask.el | 4 +++- lisp/init/eldev.el | 4 +++- lisp/init/keg.el | 4 +++- lisp/init/source.el | 4 +++- test/color/Eask | 2 ++ test/error/Eask | 2 ++ test/fixtures/home/.emacs.d/Eask | 2 ++ test/fixtures/home/Eask | 2 ++ test/fixtures/mini.pkg.1/Eask | 2 ++ test/fixtures/mini.pkg.2/Eask | 2 ++ test/jest/buttercup/Eask | 2 ++ test/jest/docker/Eask | 2 ++ test/jest/dsl/Eask | 2 ++ test/jest/ecukes/Eask | 2 ++ test/jest/ert-runner/Eask | 2 ++ test/jest/ert/Eask | 2 ++ test/jest/exec/Eask | 2 ++ test/jest/global/Eask | 2 ++ test/jest/install/Eask | 2 ++ test/jest/install/foo-mode/Eask | 2 ++ test/jest/install/foo-no-pkg/Eask | 2 ++ test/jest/link/Eask | 2 ++ test/jest/link/link-fail/Eask | 2 ++ test/jest/link/link-to/Eask | 2 ++ test/jest/local/Eask | 2 ++ test/jest/metadata/Eask | 2 ++ test/jest/options/Eask | 2 ++ test/jest/outdated-upgrade/Eask | 2 ++ test/jest/search/Eask | 2 ++ 32 files changed, 74 insertions(+), 5 deletions(-) diff --git a/Easkfile b/Easkfile index 1bfcbf2e..4472f6ec 100644 --- a/Easkfile +++ b/Easkfile @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "cli" "0.11.2" "A set of command-line tools to build Emacs packages") diff --git a/lisp/_prepare.el b/lisp/_prepare.el index 10bfd9e5..9bdbb6c4 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -112,6 +112,13 @@ If nil, never time out." (const :tag "Never time out" nil)) :group 'eask) +;; This is used to avoid the error: +;; +;; Ignoring unknown mode `eask-mode'. +;; +(unless (fboundp 'eask-mode) + (define-derived-mode eask-mode emacs-lisp-mode "Eask")) + ;; ;;; Execution diff --git a/lisp/core/init.el b/lisp/core/init.el index 417ff353..2f09708b 100644 --- a/lisp/core/init.el +++ b/lisp/core/init.el @@ -76,7 +76,9 @@ Press ^C at any time to quit.") (split-string keywords "[ \t\n]+" t "[ ]+"))) (keywords (mapconcat (lambda (s) (format "%S" s)) keywords " ")) (content (format - "(package \"%s\" + ";; -*- mode: eask; lexical-binding: t -*- + +(package \"%s\" \"%s\" \"%s\") diff --git a/lisp/init/cask.el b/lisp/init/cask.el index 4226277e..9800f2a7 100644 --- a/lisp/init/cask.el +++ b/lisp/init/cask.el @@ -146,7 +146,9 @@ Optional argument CONTENTS is used for nested directives. e.g. development." (keywords (split-string keywords "[, ]")) (keywords (string-join keywords "\" \"")) (content (format - "(package \"%s\" + ";; -*- mode: eask; lexical-binding: t -*- + +(package \"%s\" \"%s\" \"%s\") diff --git a/lisp/init/eldev.el b/lisp/init/eldev.el index 8c6c5de3..76132eac 100644 --- a/lisp/init/eldev.el +++ b/lisp/init/eldev.el @@ -50,7 +50,9 @@ (keywords (split-string keywords "[, ]")) (keywords (string-join keywords "\" \"")) (content (format - "(package \"%s\" + ";; -*- mode: eask; lexical-binding: t -*- + +(package \"%s\" \"%s\" \"%s\") diff --git a/lisp/init/keg.el b/lisp/init/keg.el index 1d2d455f..6855711f 100644 --- a/lisp/init/keg.el +++ b/lisp/init/keg.el @@ -73,7 +73,9 @@ If no found the Keg file, returns nil." (keywords (split-string keywords "[, ]")) (keywords (string-join keywords "\" \"")) (content (format - "(package \"%s\" + ";; -*- mode: eask; lexical-binding: t -*- + +(package \"%s\" \"%s\" \"%s\") diff --git a/lisp/init/source.el b/lisp/init/source.el index 514e46f0..fa051f5a 100644 --- a/lisp/init/source.el +++ b/lisp/init/source.el @@ -46,7 +46,9 @@ (keywords (string-join keywords "\" \"")) (reqs (package-desc-reqs pkg-desc)) (content (format - "(package \"%s\" + ";; -*- mode: eask; lexical-binding: t -*- + +(package \"%s\" \"%s\" %s) diff --git a/test/color/Eask b/test/color/Eask index d415d6e4..9d3da280 100644 --- a/test/color/Eask +++ b/test/color/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "color" "0.0.1" "Test to print color on the terminal") diff --git a/test/error/Eask b/test/error/Eask index 8e9f049e..a6cf997c 100644 --- a/test/error/Eask +++ b/test/error/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "error" "0.0.1" "Test (trigger) error on GitHub Actions") diff --git a/test/fixtures/home/.emacs.d/Eask b/test/fixtures/home/.emacs.d/Eask index 961eca06..42756e1f 100644 --- a/test/fixtures/home/.emacs.d/Eask +++ b/test/fixtures/home/.emacs.d/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package ".emacs.d" "0.0.1" "Minimal test configuration") diff --git a/test/fixtures/home/Eask b/test/fixtures/home/Eask index f0b6d57e..5dbe60f2 100644 --- a/test/fixtures/home/Eask +++ b/test/fixtures/home/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "home" "0.0.1" "Minimal test for global config") diff --git a/test/fixtures/mini.pkg.1/Eask b/test/fixtures/mini.pkg.1/Eask index 480eef12..54f7f948 100644 --- a/test/fixtures/mini.pkg.1/Eask +++ b/test/fixtures/mini.pkg.1/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "mini.pkg.1" "0.0.1" "Minimal test package") diff --git a/test/fixtures/mini.pkg.2/Eask b/test/fixtures/mini.pkg.2/Eask index a3b3e955..6bd0d44e 100644 --- a/test/fixtures/mini.pkg.2/Eask +++ b/test/fixtures/mini.pkg.2/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "mini.pkg.2" "0.0.1" "Minimal test package") diff --git a/test/jest/buttercup/Eask b/test/jest/buttercup/Eask index d026ebbc..d16667fb 100644 --- a/test/jest/buttercup/Eask +++ b/test/jest/buttercup/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "buttercup" "0.0.1" "Test project for command `buttercup'") diff --git a/test/jest/docker/Eask b/test/jest/docker/Eask index 480eef12..54f7f948 100644 --- a/test/jest/docker/Eask +++ b/test/jest/docker/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "mini.pkg.1" "0.0.1" "Minimal test package") diff --git a/test/jest/dsl/Eask b/test/jest/dsl/Eask index ec5dc11e..dc6e1114 100644 --- a/test/jest/dsl/Eask +++ b/test/jest/dsl/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 ;; diff --git a/test/jest/ecukes/Eask b/test/jest/ecukes/Eask index cc5ec20f..d5ae17b6 100644 --- a/test/jest/ecukes/Eask +++ b/test/jest/ecukes/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "ecukes" "0.0.1" "Test project for command `ecukes'") diff --git a/test/jest/ert-runner/Eask b/test/jest/ert-runner/Eask index 3050d52e..d3846298 100644 --- a/test/jest/ert-runner/Eask +++ b/test/jest/ert-runner/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "ert-runner" "0.0.1" "Test project for command `ert-runner'") diff --git a/test/jest/ert/Eask b/test/jest/ert/Eask index 0d433c3d..ff41a76f 100644 --- a/test/jest/ert/Eask +++ b/test/jest/ert/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "ert" "0.0.1" "Test project for command `ert'") diff --git a/test/jest/exec/Eask b/test/jest/exec/Eask index 3a9b9b2b..7d0d89ca 100644 --- a/test/jest/exec/Eask +++ b/test/jest/exec/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "exec" "0.0.1" "Test project for command exec") diff --git a/test/jest/global/Eask b/test/jest/global/Eask index f0b6d57e..5dbe60f2 100644 --- a/test/jest/global/Eask +++ b/test/jest/global/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "home" "0.0.1" "Minimal test for global config") diff --git a/test/jest/install/Eask b/test/jest/install/Eask index 2f93335f..7379a769 100644 --- a/test/jest/install/Eask +++ b/test/jest/install/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "mini.pkg.1" "0.0.1" "Minimal test package") diff --git a/test/jest/install/foo-mode/Eask b/test/jest/install/foo-mode/Eask index dc2bc1d3..286673d8 100644 --- a/test/jest/install/foo-mode/Eask +++ b/test/jest/install/foo-mode/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "foo" "0.0.1" "") diff --git a/test/jest/install/foo-no-pkg/Eask b/test/jest/install/foo-no-pkg/Eask index dc2bc1d3..286673d8 100644 --- a/test/jest/install/foo-no-pkg/Eask +++ b/test/jest/install/foo-no-pkg/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "foo" "0.0.1" "") diff --git a/test/jest/link/Eask b/test/jest/link/Eask index 29876c88..024758fe 100644 --- a/test/jest/link/Eask +++ b/test/jest/link/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "link" "1.0.0" "") diff --git a/test/jest/link/link-fail/Eask b/test/jest/link/link-fail/Eask index 480eef12..54f7f948 100644 --- a/test/jest/link/link-fail/Eask +++ b/test/jest/link/link-fail/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "mini.pkg.1" "0.0.1" "Minimal test package") diff --git a/test/jest/link/link-to/Eask b/test/jest/link/link-to/Eask index 29507781..3da6f5e2 100644 --- a/test/jest/link/link-to/Eask +++ b/test/jest/link/link-to/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "link-to" "1.0.0" "simple package to link") diff --git a/test/jest/local/Eask b/test/jest/local/Eask index bacb363d..191c4664 100644 --- a/test/jest/local/Eask +++ b/test/jest/local/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "mini.pkg.1" "0.0.1" "Minimal test package") diff --git a/test/jest/metadata/Eask b/test/jest/metadata/Eask index 25b9ca66..0f3534b3 100644 --- a/test/jest/metadata/Eask +++ b/test/jest/metadata/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 ;; diff --git a/test/jest/options/Eask b/test/jest/options/Eask index ee70be40..59bce5e3 100644 --- a/test/jest/options/Eask +++ b/test/jest/options/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "options" "0.0.0" "Test all options flag") diff --git a/test/jest/outdated-upgrade/Eask b/test/jest/outdated-upgrade/Eask index 00283012..e2ecbfd5 100644 --- a/test/jest/outdated-upgrade/Eask +++ b/test/jest/outdated-upgrade/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "outdated-upgrade" "0.0.1" "Test project for command outdated and upgrade") diff --git a/test/jest/search/Eask b/test/jest/search/Eask index 51558d01..b8b64f11 100644 --- a/test/jest/search/Eask +++ b/test/jest/search/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "search" "0.0.1" "Test project for command `search'") From e9deaf05048681125cd599d63df76f425eca08db Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 22 Apr 2025 15:36:46 -0700 Subject: [PATCH 2/4] chore: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index add51ffd..54343c78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * fix(install): Package installed calculation (a479d5355dfc832286288b790338652e174d606d) * fix(install-file): Get correct install package name (#318) * feat: Add `:try` for `depends-on` DSL (#319) +* fix: Warning missing `lexical-binding` cookie in Eask-file (#320) ## 0.11.x > Released Apr 03, 2025 From 0aef948397bba6b95b6ba112937716f53db58489 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 22 Apr 2025 15:51:16 -0700 Subject: [PATCH 3/4] fix test --- test/jest/__snapshots__/analyze.test.js.snap | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/jest/__snapshots__/analyze.test.js.snap b/test/jest/__snapshots__/analyze.test.js.snap index 7ebf4945..d4e917df 100644 --- a/test/jest/__snapshots__/analyze.test.js.snap +++ b/test/jest/__snapshots__/analyze.test.js.snap @@ -3,24 +3,24 @@ exports[`analyze in ./dsl matches snapshot 1`] = ` { "stderr": " -~/Eask:7:18 Error: Multiple definition of \`package' -~/Eask:10:55 Error: Multiple definition of \`website-url' -~/Eask:12:16 Error: Multiple definition of \`keywords' -~/Eask:15:15 Warning: Warning regarding duplicate author name, name -~/Eask:18:17 Warning: Warning regarding duplicate license name, GPLv3 -~/Eask:21:29 Error: Multiple definition of \`package-file' -~/Eask:23:35 Warning: Pkg-file seems to be missing \`check-pkg.el' -~/Eask:24:35 Error: Multiple definition of \`package-descriptor' -~/Eask:28:61 Error: Run-script with the same key name is not allowed: \`test\` -~/Eask:31:13 Error: Multiple definition of source \`gnu' -~/Eask:33:24 Error: Unknown package archive \`magic-archive' -~/Eask:35:15 Error: Invalid archive name \`local' -~/Eask:35:15 Error: Unknown package archive \`local' -~/Eask:38:20 Error: Define dependencies with the same name \`emacs' -~/Eask:41:19 Error: Define dependencies with the same name \`dash' -~/Eask:42:27 Error: Define dependencies with the same name \`dash' with different version -~/Eask:48:2 Error: Define dependencies with the same name \`f' -~/Eask:48:2 Error: Define dependencies with the same name \`f' with different version +~/Eask:9:18 Error: Multiple definition of \`package' +~/Eask:12:55 Error: Multiple definition of \`website-url' +~/Eask:14:16 Error: Multiple definition of \`keywords' +~/Eask:17:15 Warning: Warning regarding duplicate author name, name +~/Eask:20:17 Warning: Warning regarding duplicate license name, GPLv3 +~/Eask:23:29 Error: Multiple definition of \`package-file' +~/Eask:25:35 Warning: Pkg-file seems to be missing \`check-pkg.el' +~/Eask:26:35 Error: Multiple definition of \`package-descriptor' +~/Eask:30:61 Error: Run-script with the same key name is not allowed: \`test\` +~/Eask:33:13 Error: Multiple definition of source \`gnu' +~/Eask:35:24 Error: Unknown package archive \`magic-archive' +~/Eask:37:15 Error: Invalid archive name \`local' +~/Eask:37:15 Error: Unknown package archive \`local' +~/Eask:40:20 Error: Define dependencies with the same name \`emacs' +~/Eask:43:19 Error: Define dependencies with the same name \`dash' +~/Eask:44:27 Error: Define dependencies with the same name \`dash' with different version +~/Eask:50:2 Error: Define dependencies with the same name \`f' +~/Eask:50:2 Error: Define dependencies with the same name \`f' with different version ", "stdout": "", } From fbeeab050a24131997a4270abbe3186672dc1259 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 22 Apr 2025 16:37:39 -0700 Subject: [PATCH 4/4] ci: elisp-autofmt minimum is now 29.1 --- lisp/format/elisp-autofmt.el | 2 +- test/jest/local.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/format/elisp-autofmt.el b/lisp/format/elisp-autofmt.el index 3f3d9364..841ef010 100644 --- a/lisp/format/elisp-autofmt.el +++ b/lisp/format/elisp-autofmt.el @@ -45,7 +45,7 @@ (kill-buffer)))) (eask-start - (eask-command-check "28.1") + (eask-command-check "29.1") ;; Preparation (eask-archive-install-packages '("gnu" "melpa") diff --git a/test/jest/local.test.js b/test/jest/local.test.js index 8b455750..32100073 100644 --- a/test/jest/local.test.js +++ b/test/jest/local.test.js @@ -230,7 +230,7 @@ describe("local", () => { describe("Formatting", () => { // installs elisp-autofmt it("format elisp-autofmt", async () => { - if ((await emacsVersion()) >= "28.1") { + if ((await emacsVersion()) >= "29.1") { await ctx.runEask("format elisp-autofmt"); } });