Skip to content

Commit

Permalink
byte-compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiw committed Sep 25, 2023
1 parent 7ce5e70 commit b3b608a
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 48 deletions.
8 changes: 6 additions & 2 deletions elisp/edts/edts-alist.el
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@


(defun edts-alist-select (predicate alist)
"Return all elements of ALIST for which PREDICATE returns a non-nil value. PREDICATE is a function that takes two argument KEY and VALUE."
"Return all elements of ALIST for which PREDICATE returns a
non-nil value. PREDICATE is a function that takes two argument
KEY and VALUE."
(-filter (lambda (el) (funcall predicate (car el) (cdr el))) alist))


(defun edts-alist-filter (predicate alist)
"Remove all elements of ALIST for which PREDICATE returns a non-nil value. PREDICATE is a function that takes two argument KEY and VALUE."
"Remove all elements of ALIST for which PREDICATE returns a
non-nil value. PREDICATE is a function that takes two argument
KEY and VALUE."
(-filter (lambda (el) (not (funcall predicate (car el) (cdr el)))) alist))


Expand Down
8 changes: 2 additions & 6 deletions elisp/edts/edts-code.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ the module to be compiled as the only argument.")
'(edts-code-eunit)
"Hooks to run after compilation finishes. Hooks are called with the
compilation result as a symbol as the only argument")
(defvaralias ;; Compatibility
'edts-code-after-compilation-hook
'edts-code-after-compile-hook
"This variable is deprecated, use `edts-code-after-compile-hook'")

(defvar edts-code-buffer-issues nil
"A plist describing the current issues (errors and warnings) in the
Expand Down Expand Up @@ -97,8 +93,8 @@ with severity as key and a lists of issues as values"
(plist-put edts-code-buffer-issues type issues)))

(defun edts-code-buffer-status ()
"Return 'error if there are any edts errors in current buffer,
'warning if there are warnings and 'ok otherwise."
"Return `'error' if there are any edts errors in current buffer,
`'warning' if there are warnings and `'ok' otherwise."
(cl-block nil
(let ((status 'ok)
(issues edts-code-buffer-issues))
Expand Down
6 changes: 3 additions & 3 deletions elisp/edts/edts-complete-built-in-function-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@

(defun edts-complete-built-in-function-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-built-in-function-candidates))
('none (edts-complete-normal-built-in-function-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-built-in-function-candidates))
(none (edts-complete-normal-built-in-function-candidates))))

(defun edts-complete-normal-built-in-function-candidates ()
"Produces the completion list for normal (unqoted) local functions."
Expand Down
8 changes: 4 additions & 4 deletions elisp/edts/edts-complete-exported-function-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(let ((point (or ac-point (point))))
(when (edts-complete-exported-function-p point)
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
(double-quoted nil) ; Don't complete inside strings
(otherwise
(edts-log-debug "Initializing exported function completions")
(let* ((module (ferl-symbol-at (- point 1)))
Expand All @@ -66,9 +66,9 @@

(defun edts-complete-exported-function-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-exported-function-candidates))
('none (edts-complete-normal-exported-function-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-exported-function-candidates))
(none (edts-complete-normal-exported-function-candidates))))

(defun edts-complete-normal-exported-function-candidates ()
"Produces the completion list for normal (unqoted) exported functions."
Expand Down
6 changes: 3 additions & 3 deletions elisp/edts/edts-complete-imported-function-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@

(defun edts-complete-imported-function-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-imported-function-candidates))
('none (edts-complete-normal-imported-function-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-imported-function-candidates))
(none (edts-complete-normal-imported-function-candidates))))

(defun edts-complete-normal-imported-function-candidates ()
"Produces the completion list for normal (unqoted) imported functions."
Expand Down
6 changes: 3 additions & 3 deletions elisp/edts/edts-complete-keyword-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

(defun edts-complete-keyword-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-keyword-candidates))
('none (edts-complete-normal-keyword-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-keyword-candidates))
(none (edts-complete-normal-keyword-candidates))))

(defun edts-complete-normal-keyword-candidates ()
"Produces the completion list for normal (unqoted) local functions."
Expand Down
8 changes: 4 additions & 4 deletions elisp/edts/edts-complete-local-function-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
"Initialize local function completions."
(when (edts-complete-local-function-p)
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
(double-quoted nil) ; Don't complete inside strings
(otherwise
(edts-log-debug "Initializing local function completions")
(setq edts-complete-local-function-candidates
(mapcar #'car (ferl-local-functions)))))))

(defun edts-complete-local-function-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-local-function-candidates))
('none (edts-complete-normal-local-function-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-local-function-candidates))
(none (edts-complete-normal-local-function-candidates))))

(defun edts-complete-normal-local-function-candidates ()
"Produces the completion list for normal (unqoted) local functions."
Expand Down
6 changes: 3 additions & 3 deletions elisp/edts/edts-complete-macro-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@

(defun edts-complete-macro-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-macro-candidates))
('none (edts-complete-normal-macro-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-macro-candidates))
(none (edts-complete-normal-macro-candidates))))

(defun edts-complete-normal-macro-candidates ()
"Produces the completion list for normal (unqoted) macros."
Expand Down
6 changes: 3 additions & 3 deletions elisp/edts/edts-complete-module-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@

(defun edts-complete-module-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-module-candidates))
('none (edts-complete-normal-module-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-module-candidates))
(none (edts-complete-normal-module-candidates))))

(defun edts-complete-normal-module-candidates ()
"Produces the completion list for normal (unqoted) modules."
Expand Down
8 changes: 4 additions & 4 deletions elisp/edts/edts-complete-record-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"Initialize record completions."
(when (edts-complete-record-p ac-point)
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
(double-quoted nil) ; Don't complete inside strings
(otherwise
(edts-log-debug "Initializing record completions")
(cl-flet ((rec-name (rec) (cdr (assoc 'record rec))))
Expand All @@ -65,9 +65,9 @@

(defun edts-complete-record-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted (edts-complete-single-quoted-record-candidates))
('none (edts-complete-normal-record-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted (edts-complete-single-quoted-record-candidates))
(none (edts-complete-normal-record-candidates))))

(defun edts-complete-normal-record-candidates ()
"Produces the completion list for normal (unqoted) records. Unimplemented"
Expand Down
6 changes: 3 additions & 3 deletions elisp/edts/edts-complete-variable-source.el
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@

(defun edts-complete-variable-candidates ()
(cl-case (ferl-point-inside-quotes)
('double-quoted nil) ; Don't complete inside strings
('single-quoted nil) ; No single-quoted variables
('none (edts-complete-normal-variable-candidates))))
(double-quoted nil) ; Don't complete inside strings
(single-quoted nil) ; No single-quoted variables
(none (edts-complete-normal-variable-candidates))))

(defun edts-complete-normal-variable-candidates ()
"Generates the auto-complete candidate list for variables. Matches variables
Expand Down
2 changes: 1 addition & 1 deletion elisp/edts/edts-face.el
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ left-fringe or right-fringe."
:group 'edts)

(defvar edts-face-modeline-remap-cookie nil
"A list of The 'cookies' returned from face-remap-add-relative, so
"A list of The `cookies' returned from face-remap-add-relative, so
that we can reset our face remappings.")
(make-variable-buffer-local 'edts-face-modeline-remap-cookie)

Expand Down
2 changes: 1 addition & 1 deletion elisp/edts/edts-rpc.el
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ inside a `with-temp-buffer'."
(defun edts-rpc--parse-http-response-status ()
(save-excursion
(goto-char (point-min))
(s-split " " (buffer-substring (point) (point-at-eol)))))
(s-split " " (buffer-substring (point) (line-end-position)))))

(defun edts-rpc-command-url (command)
"Construct the edts command url."
Expand Down
2 changes: 1 addition & 1 deletion elisp/edts/edts-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ respectively so we can use them later when fontifying user input."
(while (< start end)
(let ((temp-end nil))
(cl-case (get-text-property start 'field)
('output
(output
(setq temp-end (edts-shell-output-end start end))
(font-lock-default-fontify-region start temp-end loudly))
(otherwise
Expand Down
2 changes: 1 addition & 1 deletion elisp/edts/edts-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
(defmacro edts-test-case (suite name args desc &rest body)
"Define a testcase in SUITE. All other arguments are the same is in
`ert-deftest'."
(declare (indent 3))
(unless body
(error "edts-test-case: Not enough arguments"))
(declare (indent 3))
`(macroexpand
(ert-deftest ,name ,args ,desc :tags '(,suite edts-test-suite) ,@body)))

Expand Down
5 changes: 0 additions & 5 deletions lib/edts_dialyzer/edts-dialyzer.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
:group 'edts
:type 'boolean)

(define-obsolete-variable-alias
'edts-code-inhibit-dialyzer-on-compile
'edts-dialyzer-inhibit-on-compile
"2017-04-15")

(defun edts-dialyzer-init ()
"Initialize edts-dialyzer."
(add-to-list 'edts-code-issue-types 'edts-dialyzer)
Expand Down
2 changes: 1 addition & 1 deletion test_data/package-install-deps.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;;; edts-pkg.el --- EDTS dependency installation, for test.
;;; package-install-deps.el --- EDTS dependency installation, for test.

;; Copyright 2012-2013 Thomas Järvstrand <tjarvstrand@gmail.com>

Expand Down

0 comments on commit b3b608a

Please sign in to comment.