diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9e0d751 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + emacs_version: + - 25.1 + - 25.2 + - 25.3 + - 26.1 + - 26.2 + - 26.3 + - 27.1 + - 27.2 + - 28.1 + - 28.2 + - 29.1 + - 29.2 + - 29.3 + - release-snapshot + steps: + - name: Setup emacs + uses: purcell/setup-emacs@master + with: + version: ${{ matrix.emacs_version }} + + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Lint + uses: leotaku/elisp-check@master + with: + file: eshell-syntax-highlighting.el diff --git a/eshell-syntax-highlighting.el b/eshell-syntax-highlighting.el index 08f761e..f235908 100644 --- a/eshell-syntax-highlighting.el +++ b/eshell-syntax-highlighting.el @@ -136,11 +136,11 @@ (defvar eshell-syntax-highlighting--word-boundary-regexp "[^[:space:]&|;$'\"]*") -(defun eshell-syntax-highlighting--executable-find (command) +(defmacro eshell-syntax-highlighting--executable-find (command) "Check if COMMAND is on the variable `exec-path'." (if (< emacs-major-version 27) - (executable-find command) - (executable-find command t))) + `(executable-find ,command) + `(executable-find ,command t))) (defun eshell-syntax-highlighting--goto-string-end (quote end) "Find end of string marked by QUOTE before END." @@ -318,7 +318,7 @@ (defvar eshell-syntax-highlighting--control-flow-commands '("if" "unless" "while" "until")) (defun eshell-syntax-highlighting--parse-command (beg end command) - "Parse COMMAND in region (BEG, END) and highlight." + "In region (BEG, END), parse COMMAND and highlight." (let ((next-expected (cond @@ -402,7 +402,7 @@ (eshell-syntax-highlighting--parse-and-highlight next-expected end))) (defun eshell-syntax-highlighting--parse-and-highlight (expected end) - "Parse and highlight from point until END, expecting token of type EXPECTED." + "Parse and highlight EXPECTED token from point until END." ;; Whitespace (when (re-search-forward "\\s-*" end t) (eshell-syntax-highlighting--highlight @@ -502,7 +502,7 @@ (defmacro eshell-syntax-highlighting--command-running-p () "Return non-nil if a foreground command is currently running." - (if (>= emacs-major-version 30) + (if (fboundp 'eshell-head-process) '(eshell-head-process) 'eshell-current-command))