From 89f50b1e6087114e6a5d698a46323ebdc90266d7 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sat, 2 Dec 2023 23:28:29 -0800 Subject: [PATCH] chore: Rename eask rest args --- lisp/_prepare.el | 8 ++++---- lisp/run/script.el | 2 +- test/fixtures/mini.emacs.pkg.1/Eask | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/_prepare.el b/lisp/_prepare.el index 85a73271..c9532f72 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -90,19 +90,19 @@ Arguments FNC and ARGS are used for advice `:around'." (defconst eask-is-pkg (getenv "EASK_IS_PKG") "Eask is pkg.") -(defconst eask-rest-args +(defconst eask-rest (let ((args (getenv "EASK_REST_ARGS"))) - (setq args (split-string args ",")) + (setq args (ignore-errors (split-string args ","))) args) "Eask arguments in list after command separator `--'. If the argument is `-- hello world'; it will return `(hello world)'.") -(defun eask-rest-args () +(defun eask-rest () "Eask arguments in string after command separator `--'. If the argument is `-- hello world'; it will return `hello world'." - (mapconcat #'identity eask-rest-args " ")) + (mapconcat #'identity eask-rest " ")) (defcustom eask-import-timeout 10 "Number of seconds before timing out elisp importation attempts. diff --git a/lisp/run/script.el b/lisp/run/script.el index 36d3e3e5..3678f613 100644 --- a/lisp/run/script.el +++ b/lisp/run/script.el @@ -44,7 +44,7 @@ ;; ;; We must split up all commands! (setq command (eask-s-replace " && " "\n" command))) - (setq command (concat command " " (eask-rest-args))) + (setq command (concat command " " (eask-rest))) (write-region (concat command "\n") nil eask--run-file t)) (defun eask--unmatched-scripts (scripts) diff --git a/test/fixtures/mini.emacs.pkg.1/Eask b/test/fixtures/mini.emacs.pkg.1/Eask index acfdde6b..c49d94ee 100644 --- a/test/fixtures/mini.emacs.pkg.1/Eask +++ b/test/fixtures/mini.emacs.pkg.1/Eask @@ -17,7 +17,7 @@ (eask-defcommand mini-test-2 "Test command 2." (message "Test 2")) (eask-defcommand mini-test-3 "Test command 3." - (message "Test 3: %s" eask-rest-args)) + (message "Test 3: %s" eask-rest)) (source "gnu") (source "melpa")