Skip to content

Commit

Permalink
fix: Byte compile warnings (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Aug 20, 2023
1 parent 4b0130d commit c1a10a4
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 28 deletions.
46 changes: 29 additions & 17 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Argument BODY are forms for execution."
;; This is used to creating the directory recipe!
(defun eask-current-time ()
"Return current time."
(let ((now (current-time))) (logior (lsh (car now) 16) (cadr now))))
(let ((now (current-time))) (logior (ash (car now) 16) (cadr now))))

(defun eask-seq-str-max (sequence)
"Return max length in SEQUENCE of strings."
Expand All @@ -180,8 +180,7 @@ Argument BODY are forms for execution."
(defun eask--download-archives ()
"If archives download failed; download it manually."
(dolist (archive package-archives)
(let* ((location (cdr archive))
(name (car archive))
(let* ((name (car archive))
(file "archive-contents")
(dir (expand-file-name (concat "archives/" name) package-user-dir))
(local-file (expand-file-name file dir))
Expand Down Expand Up @@ -743,7 +742,7 @@ Argument BODY are forms for execution."
(setq result (progn ,@body))
;; XXX: after loading Eask file, we revert those functions back to normal!
(eask--loop-file-keywords
(lambda (keyword api old)
(lambda (keyword _api old)
(defalias keyword (symbol-function old))))
result))

Expand Down Expand Up @@ -1187,15 +1186,18 @@ ELPA)."
"Log level for all messages; 4 means trace most anything, 0 means nothing.
Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 (debug), 5 (all)."
:type 'integer)
:type 'integer
:group 'eask)

(defcustom eask-timestamps nil
"Log messages with timestamps."
:type 'boolean)
:type 'boolean
:group 'eask)

(defcustom eask-log-level nil
"Log messages with level."
:type 'boolean)
:type 'boolean
:group 'eask)

(defcustom eask-level-color
'((all . ansi-magenta)
Expand All @@ -1205,7 +1207,8 @@ Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 (debug), 5 (all)."
(warn . ansi-yellow)
(error . ansi-red))
"Alist of each log level's color, in (SYMBOL . ANSI-FUNCTION)."
:type 'alist)
:type 'alist
:group 'eask)

(defun eask--verb2lvl (symbol)
"Convert verbosity SYMBOL to level."
Expand Down Expand Up @@ -1378,7 +1381,8 @@ Arguments FNC and ARGS are used for advice `:around'."

(defcustom eask-log-file nil
"Weather to generate log files."
:type 'boolean)
:type 'boolean
:group 'eask)

(defmacro eask--log-write-buffer (buffer file)
"Write BUFFER to FILE."
Expand Down Expand Up @@ -1458,11 +1462,13 @@ Arguments FNC and ARGS are used for advice `:around'."

(defcustom eask-elapsed-time nil
"Log with elapsed time."
:type 'boolean)
:type 'boolean
:group 'eask)

(defcustom eask-minimum-reported-time 0.1
"Minimal load time that will be reported."
:type 'number)
:type 'number
:group 'eask)

(defmacro eask-with-progress (msg-start body msg-end)
"Progress BODY wrapper with prefix (MSG-START) and suffix (MSG-END) messages."
Expand Down Expand Up @@ -1651,27 +1657,33 @@ variable we use to test validation."

(defcustom eask-file-loaded-hook nil
"Hook runs after Easkfile is loaded."
:type 'hook)
:type 'hook
:group 'eask)

(defcustom eask-before-command-hook nil
"Hook runs before command is executed."
:type 'hook)
:type 'hook
:group 'eask)

(defcustom eask-after-command-hook nil
"Hook runs after command is executed."
:type 'hook)
:type 'hook
:group 'eask)

(defcustom eask-on-error-hook nil
"Hook runs when error is triggered."
:type 'hook)
:type 'hook
:group 'eask)

(defcustom eask-on-warning-hook nil
"Hook runs when warning is triggered."
:type 'hook)
:type 'hook
:group 'eask)

(defcustom eask-dist-path "dist"
"Name of default target directory for building packages."
:type 'string)
:type 'string
:group 'eask)

;;
;;; Linter
Expand Down
3 changes: 1 addition & 2 deletions lisp/checker/check-eask.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
For arguments LEVEL and MSG, please see function `eask--write-log' for more
information."
(let* ((thing (thing-at-point 'sexp))
(bounds (bounds-of-thing-at-point 'sexp))
(let* ((bounds (bounds-of-thing-at-point 'sexp))
(filename (or load-file-name eask-file))
(start (car bounds))
(end (cdr bounds))
Expand Down
5 changes: 3 additions & 2 deletions lisp/clean/dist.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
"done ✓")
(setq delete-dir t))
(eask-msg "")
(eask-info "(Total of %s file%s, and %s directory deleted)" deleted
(eask-info "(Total of %s file%s and %s directory deleted, %s skipped)" deleted
(eask--sinr deleted "" "s")
(if delete-dir "1" "0"))))
(if delete-dir "1" "0")
(- 3 deleted))))

(eask-start
(let* ((eask-dist-path (or (eask-argv 0) eask-dist-path))
Expand Down
4 changes: 3 additions & 1 deletion lisp/clean/log-file.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
"done ✓")
(setq delete-dir t))
(eask-msg "")
(eask-info "(Total of %s log file%s deleted, %s skipped)" deleted
(eask-info "(Total of %s log file%s and %s directory deleted, %s skipped)"
deleted
(eask--sinr deleted "" "s")
(if delete-dir "1" "0")
(- (length log-files) deleted))))

(eask-start
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/upgrade.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"Upgrade for archive packages."
(if-let ((upgrades (eask-package--upgrades)))
(progn
(mapcar #'eask-package-upgrade upgrades)
(mapc #'eask-package-upgrade upgrades)
(eask-msg "")
(eask-info "(Done upgrading all packages)"))
(eask-msg "")
Expand Down
8 changes: 4 additions & 4 deletions lisp/link/add.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
(defvar eask--link-package-name nil "Used to form package name.")
(defvar eask--link-package-version nil "Used to form package name.")

(defun eask--create-link (name source)
"Add link with NAME to SOURCE path."
(defun eask--create-link (source)
"Add link with SOURCE path."
(let* ((dir-name (format "%s-%s" eask--link-package-name eask--link-package-version))
(link-path (expand-file-name dir-name package-user-dir)))
(when (file-exists-p link-path)
Expand Down Expand Up @@ -80,7 +80,7 @@
;; XXX: Install dependencies for linked package
(eask-msg "")
(eask--install-packages (eask--package-desc-reqs pkg-desc))
(eask--create-link name source)
(eask--create-link source)
(when (and (zerop (length links)) ; if no link previously,
(= 1 (length (eask--links)))) ; and first link created!
(eask-help "link/add/success/pkg")))
Expand Down Expand Up @@ -110,7 +110,7 @@
(unless pkg-file-presented
(eask-with-verbosity 'debug (eask-call "generate/pkg-file")))
(if pkg-file-presented "already presented ✗" "done ✓")))
(eask--create-link name source)
(eask--create-link source)
(when (and (zerop (length links)) ; if no link previously,
(= 1 (length (eask--links)))) ; and first link created!
(eask-help "link/add/success/eask")))
Expand Down
2 changes: 1 addition & 1 deletion lisp/lint/checkdoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

(defvar eask--checkdoc-errors nil "Error flag.")

(defun eask--checkdoc-print-error (text start end &optional unfixable)
(defun eask--checkdoc-print-error (text start _end &optional _unfixable)
"Print error for checkdoc.
Arguments TEXT, START, END and UNFIXABLE are required for this function to
Expand Down

0 comments on commit c1a10a4

Please sign in to comment.