From c0734862851006793cf67aee431aaa57e09a3dfe Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Tue, 7 Nov 2023 14:04:24 +0100 Subject: Fix actionlint buffer detection In multi-mode yaml buffers, e.g. parts of alidist-mode buffers, `buffer-file-name' returns nil instead, which previously raised an error here. --- tw/home/files/emacs-packages/actionlint.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tw') diff --git a/tw/home/files/emacs-packages/actionlint.el b/tw/home/files/emacs-packages/actionlint.el index 64c90bd5..68a25c57 100644 --- a/tw/home/files/emacs-packages/actionlint.el +++ b/tw/home/files/emacs-packages/actionlint.el @@ -131,7 +131,9 @@ Any running invocations are killed before running another one." (defun actionlint-github-workflow-p () "Does the current buffer contain a GitHub Action?" - (string-match-p (rx ".github/workflows/" (+ (not ?\/)) ".yml" eos) (buffer-file-name))) + (let ((name (buffer-file-name))) + (and name (string-match-p + (rx ".github/workflows/" (+ (not ?\/)) ".yml" eos) name)))) (defun actionlint-setup () "Set up actionlint in this buffer, if it is recognised as a workflow file." -- cgit v1.2.3