From 1da66c100b276a4030a1ddbbe7fc7d6ee1f54142 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:07:51 +0800 Subject: [PATCH 01/10] Install cask --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d99ae62..f4c9461a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,10 +24,21 @@ jobs: - 27.2 - snapshot steps: + - uses: actions/checkout@v2 + - uses: purcell/setup-emacs@master with: version: ${{ matrix.emacs-version }} + - uses: actions/setup-python@v2 + with: + python-version: "3.6" + architecture: "x64" + + - uses: conao3/setup-cask@master + with: + version: 0.8.4 + - uses: actions/checkout@v2 - name: Test package run: sh ./scripts/test-pkg.sh @@ -45,10 +56,21 @@ jobs: - 27.2 - snapshot steps: + - uses: actions/checkout@v2 + - uses: jcs090218/setup-emacs-windows@master with: version: ${{ matrix.emacs-version }} + - uses: actions/setup-python@v2 + with: + python-version: "3.6" + architecture: "x64" + + - uses: conao3/setup-cask@master + with: + version: 0.8.4 + - uses: actions/checkout@v2 - name: Test package run: ./scripts/test-pkg.bat From 1a818d3608d4f29aa84b79e7bfb4ac18687b2451 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:15:43 +0800 Subject: [PATCH 02/10] Remove ci script --- scripts/pkg-prepare.el | 37 ------------------------------------- scripts/test-pkg.bat | 9 --------- scripts/test-pkg.el | 19 ------------------- scripts/test-pkg.sh | 7 ------- 4 files changed, 72 deletions(-) delete mode 100644 scripts/pkg-prepare.el delete mode 100644 scripts/test-pkg.bat delete mode 100644 scripts/test-pkg.el delete mode 100644 scripts/test-pkg.sh diff --git a/scripts/pkg-prepare.el b/scripts/pkg-prepare.el deleted file mode 100644 index 8781b54a..00000000 --- a/scripts/pkg-prepare.el +++ /dev/null @@ -1,37 +0,0 @@ -;;; pkg-prepare.el --- Prepare for package initialization -*- lexical-binding: t -*- -;;; Commentary: -;;; Code: - -(require 'package) - -(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) -(setq package-enable-at-startup nil - package-check-signature nil) - -(setq network-security-level 'low) - -(package-initialize) - -(defun jcs-package-install (pkg) - "Install PKG package." - (unless (get 'jcs-package-install 'state) - (put 'jcs-package-install 'state t)) - ;; Don't run `package-refresh-contents' if you don't need to install - ;; packages on startup. - (package-refresh-contents) - ;; Else we just install the package regularly. - (package-install pkg)) - -(defun jcs-ensure-package-installed (packages &optional without-asking) - "Assure every PACKAGES is installed, ask WITHOUT-ASKING." - (dolist (package packages) - (unless (package-installed-p package) - (if (or without-asking - (y-or-n-p (format "[ELPA] Package %s is missing. Install it? " package))) - (jcs-package-install package) - package))) - ;; STUDY: Not sure if you need this? - (when (get 'jcs-package-install 'state) - (package-initialize))) - -;;; pkg-prepare.el ends here diff --git a/scripts/test-pkg.bat b/scripts/test-pkg.bat deleted file mode 100644 index 7e76c385..00000000 --- a/scripts/test-pkg.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off - -echo "Executing package..." - -emacs -nw --batch --load "./scripts/test-pkg.el" - -git clone "https://github.com/gonewest818/elisp-lint" - -emacs --batch -q -l "./scripts/pkg-prepare.el" -l "./elisp-lint/elisp-lint.el" -f elisp-lint-files-batch --no-package-lint dashboard-widgets.el dashboard.el diff --git a/scripts/test-pkg.el b/scripts/test-pkg.el deleted file mode 100644 index d1847e17..00000000 --- a/scripts/test-pkg.el +++ /dev/null @@ -1,19 +0,0 @@ -;; -;; (@* "Prepare" ) -;; - -(add-to-list 'load-path "./") -(load-file (expand-file-name "./scripts/pkg-prepare.el")) - -(jcs-ensure-package-installed - (append - '(page-break-lines org all-the-icons) - '(elisp-lint package-lint dash)) - t) - -;; -;; (@* "Test" ) -;; - -(require 'dashboard) -(dashboard-insert-startupify-lists) diff --git a/scripts/test-pkg.sh b/scripts/test-pkg.sh deleted file mode 100644 index 7793f679..00000000 --- a/scripts/test-pkg.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo "Executing package..." - -${EMACS:=emacs} -nw --batch --load "./scripts/test-pkg.el" - -git clone "https://github.com/gonewest818/elisp-lint" - -emacs --batch -q -l "./scripts/pkg-prepare.el" -l "./elisp-lint/elisp-lint.el" -f elisp-lint-files-batch --no-package-lint dashboard-widgets.el dashboard.el From 0fc15d7419589a7820be76b6a52cfd0c81230501 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:17:59 +0800 Subject: [PATCH 03/10] Add lint --- .github/workflows/ci.yml | 10 +++++----- Cask | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4c9461a..e819754e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,9 +39,9 @@ jobs: with: version: 0.8.4 - - uses: actions/checkout@v2 - - name: Test package - run: sh ./scripts/test-pkg.sh + - name: Run tests + run: + make unix-ci test-windows: runs-on: ${{ matrix.os }} @@ -71,6 +71,6 @@ jobs: with: version: 0.8.4 - - uses: actions/checkout@v2 - name: Test package - run: ./scripts/test-pkg.bat + run: + make windows-ci diff --git a/Cask b/Cask index 0f45d508..b87c8a9a 100644 --- a/Cask +++ b/Cask @@ -5,4 +5,5 @@ (files "*.el" "*.org" "banners") (development + (depends-on "elisp-lint") (depends-on "page-break-lines")) From a70698355a9d846a22386b388192e167376314e5 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:19:14 +0800 Subject: [PATCH 04/10] Lint --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e819754e..200b780d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: - name: Run tests run: - make unix-ci + make lint test-windows: runs-on: ${{ matrix.os }} @@ -73,4 +73,4 @@ jobs: - name: Test package run: - make windows-ci + make lint From 123db0e4d661c60d3c4d193aee75cff03bd29368 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:24:32 +0800 Subject: [PATCH 05/10] Start test --- .github/workflows/ci.yml | 6 +++--- Makefile | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 200b780d..dd2293f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: - name: Run tests run: - make lint + make compile test-windows: runs-on: ${{ matrix.os }} @@ -71,6 +71,6 @@ jobs: with: version: 0.8.4 - - name: Test package + - name: Run tests run: - make lint + make compile diff --git a/Makefile b/Makefile index 1017f38f..506d651c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ export EMACS ?= emacs export BATCH = --batch -q -l .emacs/init.el +EMACS ?= emacs +CASK ?= cask + ELLP := $(shell find . -regex '.*elisp-lint-[0-9]+\.[0-9]+') ELS = $(filter-out emacs-dashboard-autoloads.el,$(wildcard *.el)) OBJECTS = $(ELS:.el=.elc) @@ -8,14 +11,7 @@ BACKUPS = $(ELS:.el=.el~) .PHONY: version lint clean cleanelpa -.elpa: - $(EMACS) $(BATCH) - touch .elpa - -version: .elpa - $(EMACS) $(BATCH) --version - -lint: .elpa +lint: $(EMACS) $(BATCH) -l $(ELLP)/elisp-lint.el -f elisp-lint-files-batch --no-package-lint $(ELS) clean: @@ -23,3 +19,10 @@ clean: cleanelpa: clean rm -rf .emacs/elpa .emacs/quelpa .emacs/.emacs-custom.el* .elpa + +compile: + @echo "Compiling..." + @$(CASK) $(EMACS) -Q --batch \ + -L . + --eval '(setq byte-compile-error-on-warn t)' \ + -f batch-byte-compile $(ELS) From 2ab60cd649b0e058e47be6b877e1aa8aced2e1a5 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:26:08 +0800 Subject: [PATCH 06/10] Fix syntax --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 506d651c..f636b3c4 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,6 @@ cleanelpa: clean compile: @echo "Compiling..." @$(CASK) $(EMACS) -Q --batch \ - -L . + -L . \ --eval '(setq byte-compile-error-on-warn t)' \ -f batch-byte-compile $(ELS) From 0ff5362d83f07c850c05317d5c91cc35ec9fb4ee Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:31:04 +0800 Subject: [PATCH 07/10] Fix decalre --- dashboard-widgets.el | 1 + 1 file changed, 1 insertion(+) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 30fe1d44..fbaf7aab 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -55,6 +55,7 @@ (declare-function org-get-todo-state "ext:org.el") (declare-function org-entry-is-todo-p "ext:org.el") (declare-function org-release-buffers "ext:org.el") +(declare-function recentf-cleanup "ext:recentf.el") (defalias 'org-time-less-p 'time-less-p) (defvar org-level-faces) (defvar org-agenda-new-buffers) From 223e6bf03643fff4c4bd319955dbfca1cde1f8cb Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:33:09 +0800 Subject: [PATCH 08/10] Fix declaration for page-break-lines --- dashboard.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dashboard.el b/dashboard.el index af5137d3..2b1e4ead 100644 --- a/dashboard.el +++ b/dashboard.el @@ -26,6 +26,8 @@ (require 'recentf) (require 'dashboard-widgets) +(declare-function page-break-lines-mode "ext:page-break-lines.el") + ;; Custom splash screen (defvar dashboard-mode-map (let ((map (make-sparse-keymap))) From 46365d2ef6128eff1ee926d9e29ecbe73a18efad Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:34:26 +0800 Subject: [PATCH 09/10] Move defgroup ontop --- dashboard.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard.el b/dashboard.el index 2b1e4ead..67b1f77f 100644 --- a/dashboard.el +++ b/dashboard.el @@ -28,6 +28,10 @@ (declare-function page-break-lines-mode "ext:page-break-lines.el") +(defgroup dashboard nil + "Extensible startup screen." + :group 'applications) + ;; Custom splash screen (defvar dashboard-mode-map (let ((map (make-sparse-keymap))) @@ -69,10 +73,6 @@ buffer-read-only t truncate-lines t)) -(defgroup dashboard nil - "Extensible startup screen." - :group 'applications) - (defcustom dashboard-center-content nil "Whether to center content within the window." :type 'boolean From ffc1c7e635d2dbc30c910f6ff9831f176e3316f6 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 20 Dec 2021 04:40:09 +0800 Subject: [PATCH 10/10] Clean up makefile --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f636b3c4..39edb376 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -export EMACS ?= emacs export BATCH = --batch -q -l .emacs/init.el EMACS ?= emacs @@ -9,16 +8,13 @@ ELS = $(filter-out emacs-dashboard-autoloads.el,$(wildcard *.el)) OBJECTS = $(ELS:.el=.elc) BACKUPS = $(ELS:.el=.el~) -.PHONY: version lint clean cleanelpa +.PHONY: lint clean compile lint: $(EMACS) $(BATCH) -l $(ELLP)/elisp-lint.el -f elisp-lint-files-batch --no-package-lint $(ELS) clean: - rm -f $(OBJECTS) $(BACKUPS) emacs-dashboard-autoloads.el* - -cleanelpa: clean - rm -rf .emacs/elpa .emacs/quelpa .emacs/.emacs-custom.el* .elpa + rm -rf .cask *.elc compile: @echo "Compiling..."