aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/test.yml35
-rw-r--r--.gitignore1
-rw-r--r--Makefile18
-rw-r--r--NEWS5
-rw-r--r--snakemake-mode.el22
-rw-r--r--snakemake.el14
6 files changed, 70 insertions, 25 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b7ff022..56ae573 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -8,31 +8,54 @@ jobs:
emacs_version:
- 26.1
- 27.2
+ - 28.2
+ - 29.1
- snapshot
steps:
- name: Install emacs
uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}
+ - name: Check out seq
+ if: matrix.emacs_version == '26.1' || matrix.emacs_version == '27.2' || matrix.emacs_version == '28.2'
+ # Note: This relies on Transient's Makefile looking in this spot
+ # (relative to Transient checkout) by default.
+ run: |
+ git clone --branch=externals/seq --depth=1 \
+ https://git.savannah.gnu.org/git/emacs/elpa.git seq
+ echo SEQ_DIR=$PWD/seq >>$GITHUB_ENV
+ - name: Check out compat
+ uses: actions/checkout@v4
+ with:
+ repository: emacs-compat/compat
+ path: compat
- name: Check out transient
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
repository: magit/transient
path: transient
- name: Check out snakemake-mode
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
repository: kyleam/snakemake-mode
path: snakemake-mode
- - name: Set up Python 3.7
- uses: actions/setup-python@v1
+ - name: Set up Python
+ uses: actions/setup-python@v4
with:
- python-version: 3.7
+ python-version: 3.12
- name: Install Snakemake
run: |
python -m pip install --upgrade pip
pip install snakemake
+ - name: Build compat
+ run: make -C compat compile
+ - name: Build transient
+ run: make -C transient lisp
+ - name: Set envvars for dependencies
+ run: |
+ echo "COMPAT_DIR=$PWD/compat" >>$GITHUB_ENV
+ echo "TRANSIENT_DIR=$PWD/transient/lisp" >>$GITHUB_ENV
- name: Build snakemake-mode
run: make -C snakemake-mode all
- - name: Test snaekmake-mode
+ - name: Test snakemake-mode
run: make -C snakemake-mode test
diff --git a/.gitignore b/.gitignore
index 1a0a7fc..c1adfcd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*-autoloads.el
*.elc
/.deps
+/config.mk
diff --git a/Makefile b/Makefile
index 85347e9..35b0cdd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,13 @@
-LOAD_PATH = -L ../transient/lisp -L .
+-include config.mk
+
+SEQ_DIR ?= /dev/null
+COMPAT_DIR ?= /dev/null
+TRANSIENT_DIR ?= /dev/null
+
+LOAD_PATH = -L $(SEQ_DIR) -L $(COMPAT_DIR) -L $(TRANSIENT_DIR) -L .
EMACS = emacs
BATCH = $(EMACS) -Q --batch $(LOAD_PATH)
-CURL := curl --silent
els := snakemake.el snakemake-mode.el
elcs := $(patsubst %.el, %.elc, $(els))
@@ -28,3 +33,12 @@ $(AUTOLOADS_FILE): $(els)
.PHONY: clean
clean:
$(RM) $(elcs) $(AUTOLOADS_FILE)
+
+.PHONY: sign-tar
+sign-tar:
+ tag="$$(git describe --abbrev=0)"; \
+ object=$$(git archive --format tar \
+ --prefix "snakemake-mode-$${tag#v}/" "$$tag" | \
+ gpg --output - --armor --detach-sign | \
+ git hash-object -w --stdin); \
+ git notes --ref=refs/notes/signatures/tar add -C "$$object" "$$tag"
diff --git a/NEWS b/NEWS
index 5afccb6..57b49dc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
NEWS -- history of user-visible changes -*- mode: org; -*-
+* master (unreleased)
+
+- The 'localrule' keyword (new in Snakemake v7.25.0) is now
+ recognized.
+
* v2.0.0
- Support for Emacs versions older than 26.1 has been dropped.
diff --git a/snakemake-mode.el b/snakemake-mode.el
index d7373f4..fd4763a 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -93,6 +93,7 @@
"group"
"handover"
"input"
+ "localrule"
"log"
"message"
"name"
@@ -404,9 +405,9 @@ For automatic highlighting of embedded regions, you need to set
(unless (require 'mmm-mode nil t)
(user-error "You need to install mmm-mode"))
- (when (unless (bound-and-true-p mmm-global-mode))
+ (unless (bound-and-true-p mmm-global-mode)
(display-warning 'snakemake-mode "To get automatic syntax highlighting of
-embedded R, you need to set mmm-global-mode to a non-nil value such as 'maybe."))
+embedded R, you need to set mmm-global-mode to a non-nil value such as `maybe'."))
(mmm-add-classes
'((snakemake-R-call-double
@@ -456,6 +457,7 @@ embedded R, you need to set mmm-global-mode to a non-nil value such as 'maybe.")
(,(rx line-start (group "use rule ")) 1 font-lock-keyword-face)
(,(snakemake-rx (group sm-builtin)) 1 font-lock-builtin-face)))
+(defvar snakemake-font-lock-keywords)
(if (bound-and-true-p python-font-lock-keywords-level-1)
(with-no-warnings
;; In Emacs 27 `python-font-lock-keywords' was split up into
@@ -469,14 +471,14 @@ embedded R, you need to set mmm-global-mode to a non-nil value such as 'maybe.")
(defvar snakemake-font-lock-keywords-maximum-decoration
(append snakemake--font-lock-keywords
python-font-lock-keywords-maximum-decoration))
- (defvar snakemake-font-lock-keywords
- ;; Mirrors `python-font-lock-keywords'.
- '(snakemake-font-lock-keywords-level-1
- snakemake-font-lock-keywords-level-1
- snakemake-font-lock-keywords-level-2
- snakemake-font-lock-keywords-maximum-decoration)))
- (defvar snakemake-font-lock-keywords
- (append snakemake--font-lock-keywords python-font-lock-keywords)))
+ (setq snakemake-font-lock-keywords
+ ;; Mirrors `python-font-lock-keywords'.
+ '(snakemake-font-lock-keywords-level-1
+ snakemake-font-lock-keywords-level-1
+ snakemake-font-lock-keywords-level-2
+ snakemake-font-lock-keywords-maximum-decoration)))
+ (setq snakemake-font-lock-keywords
+ (append snakemake--font-lock-keywords python-font-lock-keywords)))
;;;###autoload
(define-derived-mode snakemake-mode python-mode "Snakemake"
diff --git a/snakemake.el b/snakemake.el
index 343a329..20bff69 100644
--- a/snakemake.el
+++ b/snakemake.el
@@ -167,8 +167,8 @@ Used by `snakemake-region-file-targets'."
(defcustom snakemake-dot-program "dot"
"Program used to save the graph with `snakemake-graph-save'.
-This program must have an option '-T' that can be used to specify
-the output type. See 'man dot'."
+This program must have an option `-T' that can be used to specify
+the output type. See `man dot'."
:type 'string
:package-version '(snakemake-mode . "0.4.0"))
@@ -595,7 +595,7 @@ Snakemake-graph mode is a minor mode that provides a key,
2 1)))
(defun snakemake-compile-targets (targets args)
- "Run non-interactive `compile' with 'snakemake [ARGS] -- TARGETS'."
+ "Run non-interactive `compile' with `snakemake [ARGS] -- TARGETS'."
(let ((cmd (snakemake--make-command targets args)))
(compile cmd)
(push cmd compile-history)))
@@ -628,7 +628,7 @@ could point to a script that runs
guix environment --pure -m manifest.scm --ad-hoc snakemake
-The file 'guix-snakemake-environment' in Snakemake mode's source
+The file guix-snakemake-environment in Snakemake mode's source
directory can be used for this purpose."
(interactive)
(let ((default-directory (snakemake-snakefile-directory)))
@@ -649,13 +649,13 @@ directory can be used for this purpose."
(goto-char (process-mark proc)))))
(defun snakemake-term-build-targets (targets args)
- "Send 'snakemake [ARGS] -- TARGETS' to the terminal."
+ "Send `snakemake [ARGS] -- TARGETS' to the terminal."
(snakemake-term-send (snakemake--make-command targets args)))
;;;; General interface
(defun snakemake-build-targets (targets args)
- "Run 'snakemake [ARGS] -- TARGETS'.
+ "Run `snakemake [ARGS] -- TARGETS'.
If a terminal is associated with the current Snakefile directory,
send the command there. Otherwise, run the command with
`compile'."
@@ -738,7 +738,7 @@ $ snakemake [ARGS] -- <targets>"
:argument "--cores=")
;;;###autoload (autoload 'snakemake "snakemake" nil t)
-(transient-define-prefix snakemake
+(transient-define-prefix snakemake ()
"Transient for running Snakemake."
:value '("--cores=all")
["Arguments"