Skip to content

Commit fbda232

Browse files
committed
code: init command arg left
1 parent 52c8d51 commit fbda232

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

lisp/_prepare.el

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,22 @@ other scripts internally. See function `eask-call'.")
446446
(push arg args))))
447447
(reverse args)))
448448

449+
(defmacro eask--batch-mode (&rest body)
450+
"Initialize for batch-mode"
451+
(declare (indent 0) (debug t))
452+
`(let ((command-line-args-left (eask-args))
453+
load-file-name buffer-file-name)
454+
,@body))
455+
449456
(defmacro eask--setup-env (&rest body)
450457
"Execute BODY with workspace setup."
451458
(declare (indent 0) (debug t))
452-
`(let ((load-file-name) (buffer-file-name) ; initialize for batch-mode
453-
(alist))
454-
(dolist (cmd eask--command-list)
455-
(push (cons cmd '(lambda (&rest _))) alist))
456-
(setq command-switch-alist (append command-switch-alist alist))
457-
,@body))
459+
`(eask--batch-mode
460+
(let (alist)
461+
(dolist (cmd eask--command-list)
462+
(push (cons cmd '(lambda (&rest _))) alist))
463+
(setq command-switch-alist (append command-switch-alist alist))
464+
,@body)))
458465

459466
(defconst eask-file-keywords
460467
'("package" "package-file" "files"

0 commit comments

Comments
 (0)