Skip to content

Commit

Permalink
Add Github actions CI (#18)
Browse files Browse the repository at this point in the history
Adds a workflow for linting on supported emacs versions, and fixes current linting issues.
  • Loading branch information
akreisher authored May 9, 2024
1 parent d5c94ca commit 1198fd6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions eshell-syntax-highlighting.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 1198fd6

Please sign in to comment.