@@ -185,14 +185,18 @@ will return `lint/checkdoc' with a dash between two subcommands."
185185 version)))
186186
187187(defun eask-command-p (commands )
188- " Return t if COMMANDS is the current command."
188+ " Return t when the current command matches any entry in the COMMANDS list ."
189189 (member (eask-command) (eask-listify commands)))
190190
191191(defun eask-special-p ()
192192 " Return t if the command that can be run without Eask-file existence.
193193
194194These commands will first respect the current workspace. If the current
195- workspace has no valid Eask-file; it will load global workspace instead."
195+ workspace has no valid Eask-file; it will load the Eask-file form the global
196+ workspace instead.
197+
198+ If there is no valid Eask-file presented; the execution continues without
199+ printing the missing Eask-file message."
196200 (eask-command-p '(" init" " init/source" " init/cask" " init/eldev" " init/keg"
197201 " create/package" " create/elpa" " create/el-project"
198202 " bump" " cat" " keywords" " repl"
@@ -255,6 +259,14 @@ the `eask-start' execution.")
255259; ;
256260; ;; Util
257261
262+ (defmacro eask-add-hook (hooks &rest body )
263+ " The eye candy for the function `add-hook' ."
264+ (declare (indent 1 ))
265+ `(cond ((listp , hooks )
266+ (dolist (hook , hooks )
267+ (add-hook hook (lambda (&optional arg0 arg1 arg2 &rest args ) ,@body ))))
268+ (t (add-hook , hooks (lambda (&optional arg0 arg1 arg2 &rest args ) ,@body )))))
269+
258270(defmacro eask-defvc< (version &rest body )
259271 " Define scope if Emacs version is below VERSION.
260272
@@ -484,7 +496,7 @@ You can pass BUFFER-OR-NAME to replace current buffer."
484496 (line-end-position ))))
485497 ; ; The variable `line' can contains format specifier, avoid it with `%s' !
486498 (cond ((string-match-p " [: ][Ee]rror: " line)
487- (eask-error " %s" line))
499+ (eask-ignore-errors (eask- error " %s" line) ))
488500 ((string-match-p " [: ][Ww]arning: " line)
489501 (eask-warn " %s" line))
490502 (t
@@ -2032,6 +2044,7 @@ The argument ARGS is passed from the function `eask--error'."
20322044 ; ; Handle https://github.com/emacs-eask/cli/issues/11.
20332045 (unless (string-prefix-p " Can't find library " (car args))
20342046 (setq eask--has-error-p t )))
2047+ ; ; Flag the error normally.
20352048 (t
20362049 (setq eask--has-error-p t ))) ; Just a record.
20372050
@@ -2092,15 +2105,14 @@ Arguments FNC and ARGS are used for advice `:around'."
20922105 (write-region (with-current-buffer , buffer (buffer-string )) nil
20932106 (expand-file-name , file log-dir)))))
20942107
2095- (add-hook 'kill-emacs-hook ; Write log files
2096- (lambda (&rest _ )
2097- (when eask-log-file
2098- (let ((log-dir (expand-file-name eask-log-path eask-file-root)))
2099- (make-directory log-dir t )
2100- (eask--log-write-buffer " *Messages*" " messages.log" )
2101- (eask--log-write-buffer " *Warnings*" " warnings.log" )
2102- (eask--log-write-buffer " *Backtrace*" " backtrace.log" )
2103- (eask--log-write-buffer " *Compile-Log*" " compile-log.log" )))))
2108+ (eask-add-hook '( kill-emacs-hook)
2109+ (when eask-log-file ; Write log files
2110+ (let ((log-dir (expand-file-name eask-log-path eask-file-root)))
2111+ (make-directory log-dir t )
2112+ (eask--log-write-buffer " *Messages*" " messages.log" )
2113+ (eask--log-write-buffer " *Warnings*" " warnings.log" )
2114+ (eask--log-write-buffer " *Backtrace*" " backtrace.log" )
2115+ (eask--log-write-buffer " *Compile-Log*" " compile-log.log" ))))
21042116
21052117; ;
21062118; ;; File
0 commit comments