diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d99ae62..dd2293f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,13 +24,24 @@ jobs: - 27.2 - snapshot steps: + - uses: actions/checkout@v2 + - uses: purcell/setup-emacs@master with: version: ${{ matrix.emacs-version }} - - uses: actions/checkout@v2 - - name: Test package - run: sh ./scripts/test-pkg.sh + - uses: actions/setup-python@v2 + with: + python-version: "3.6" + architecture: "x64" + + - uses: conao3/setup-cask@master + with: + version: 0.8.4 + + - name: Run tests + run: + make compile test-windows: runs-on: ${{ matrix.os }} @@ -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/checkout@v2 - - name: Test package - run: ./scripts/test-pkg.bat + - uses: actions/setup-python@v2 + with: + python-version: "3.6" + architecture: "x64" + + - uses: conao3/setup-cask@master + with: + version: 0.8.4 + + - name: Run tests + run: + make compile 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")) diff --git a/Makefile b/Makefile index 1017f38f..39edb376 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,24 @@ -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) BACKUPS = $(ELS:.el=.el~) -.PHONY: version lint clean cleanelpa - -.elpa: - $(EMACS) $(BATCH) - touch .elpa - -version: .elpa - $(EMACS) $(BATCH) --version +.PHONY: lint clean compile -lint: .elpa +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* + rm -rf .cask *.elc -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) 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) diff --git a/dashboard.el b/dashboard.el index af5137d3..67b1f77f 100644 --- a/dashboard.el +++ b/dashboard.el @@ -26,6 +26,12 @@ (require 'recentf) (require 'dashboard-widgets) +(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))) @@ -67,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 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