[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql c4396ec5e6 057/427: Fix a bunch of warnings.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql c4396ec5e6 057/427: Fix a bunch of warnings. |
Date: |
Tue, 13 Dec 2022 02:59:27 -0500 (EST) |
branch: elpa/emacsql
commit c4396ec5e6cc036556e6d1a601f0513a015f1af3
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Fix a bunch of warnings.
---
emacsql.el | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/emacsql.el b/emacsql.el
index 6b89a35bc4..e8cf911048 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -107,7 +107,7 @@ buffer. This is for debugging purposes."
(when log
(setf (emacsql-log conn) (generate-new-buffer "*emacsql-log*")))
(prog1 conn
- (push (cons (copy-seq conn) (emacsql--ref conn))
+ (push (cons (copy-sequence conn) (emacsql--ref conn))
emacsql-connections)))))
(defun emacsql-close (conn)
@@ -124,12 +124,12 @@ buffer. This is for debugging purposes."
"Clean up after lost connections."
(cl-loop for (conn-copy . ref) in emacsql-connections
when (null (emacsql--deref ref))
- count (prog1 t (ignore-errors (emacsql-close emacsql-copy)))
+ count (prog1 t (ignore-errors (emacsql-close conn-copy)))
into total
else collect (cons conn-copy ref) into connections
finally (progn
(setf emacsql-connections connections)
- (return total))))
+ (cl-return total))))
(cl-defun emacsql-start-reap-timer (&optional (interval 60))
"Start the automatic `emacql-reap' timer."
@@ -181,7 +181,7 @@ buffer. This is for debugging purposes."
do (forward-char)
when (or (looking-at "\n") (looking-at "#"))
collect row into rows and do (setf row ())
- finally (return rows)))))
+ finally (cl-return rows)))))
(defun emacsql-escape (identifier &optional force)
"Escape an identifier, always with quotes when FORCE is non-nil."
@@ -227,7 +227,7 @@ buffer. This is for debugging purposes."
(type nil))
(while column
(let ((next (pop column)))
- (case next
+ (cl-case next
(:primary (push "PRIMARY KEY" output))
(:non-nil (push "NOT NULL" output))
(:unique (push "UNIQUE" output))
@@ -248,7 +248,7 @@ buffer. This is for debugging purposes."
(cl-loop for column being the elements of schema
when (symbolp column) collect (emacsql-escape column) into parts
else collect (emacsql--column-to-string column) into parts
- finally (return (mapconcat #'identity parts ", "))))
+ finally (cl-return (mapconcat #'identity parts ", "))))
(defun emacsql-create (conn table schema &optional if-not-exists)
"Create TABLE in CONN with SCHEMA."
@@ -303,16 +303,16 @@ See also `emacsql-with-errors'."
(defun emacsql-expand (sql)
"Expand SQL into a SQL-consumable string, with variables."
- (loop with items = (cl-coerce sql 'list)
- while (not (null items))
- for keyword = (pop items)
- for (arity expander) = (cdr (assoc keyword emacsql-expanders))
- when expander
- collect (apply expander (subseq items 0 arity)) into parts
- else do (error "Unrecognized keyword %s" keyword)
- do (setf items (subseq items arity))
- finally (return (cons (concat (mapconcat #'car parts " ") ";")
- (apply #'nconc (mapcar #'cdr parts))))))
+ (cl-loop with items = (cl-coerce sql 'list)
+ while (not (null items))
+ for keyword = (pop items)
+ for (arity expander) = (cdr (assoc keyword emacsql-expanders))
+ when expander
+ collect (apply expander (cl-subseq items 0 arity)) into parts
+ else do (error "Unrecognized keyword %s" keyword)
+ do (setf items (cl-subseq items arity))
+ finally (cl-return (cons (concat (mapconcat #'car parts " ") ";")
+ (apply #'nconc (mapcar #'cdr parts))))))
(defun emacsql-format (expansion &rest args)
"Fill in the variables EXPANSION with ARGS."
@@ -348,7 +348,7 @@ A variable is a symbol that looks like $1, $2, $3, etc. A $
means $1."
"Escape THING for use as a `format' spec, pre-escaping for KIND.
KIND should be :value or :identifier."
(replace-regexp-in-string
- "%" "%%" (case kind
+ "%" "%%" (cl-case kind
(:value (emacsql-escape-value thing))
(:identifier (emacsql-escape thing))
(otherwise thing))))
@@ -367,7 +367,7 @@ KIND should be :value or :identifier."
"Only use within `emacsql-with-vars'!"
(if (emacsql-var thing)
(prog1 "%s" (push (cons (emacsql-var thing) kind) emacsql--vars))
- (ecase kind
+ (cl-ecase kind
((:identifier :value) (emacsql-escape-format thing kind))
(:auto (emacsql-escape-format
thing (if (symbolp thing) :identifier :value))))))
@@ -390,6 +390,9 @@ definitions for return from a `emacsql-defexpander'."
(symbol-function 'emacsql--vars-combine)))
(cons (concat ,prefix (progn ,@body)) emacsql--vars))))
+(declare-function combine nil (expanded))
+(declare-function var nil (thing kind))
+
(defun emacsql--expr (expr)
"Expand EXPR recursively."
(emacsql-with-vars ""
- [nongnu] elpa/emacsql a362a97c98 136/427: Add README section on foreign keys., (continued)
- [nongnu] elpa/emacsql a362a97c98 136/427: Add README section on foreign keys., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 223db2d397 141/427: Add quote operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8951084b40 143/427: Add variable escaping., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 19a65f390e 147/427: Add ignored features section to README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 530b0ad98c 151/427: Allow arbitrary sub-statements., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3012f5b725 154/427: Fix typo., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 301e2ff4b6 175/427: Drop "simple" from helper method names., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 578a71d2d8 157/427: Re-order some definitions to group them., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 935cca89a9 176/427: Add updated information about Windows., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b3aea1e6af 055/427: Oops, fix >= back., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c4396ec5e6 057/427: Fix a bunch of warnings.,
ELPA Syncer <=
- [nongnu] elpa/emacsql e9fbc4a913 061/427: Fill out a Makefile., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 829298d5a7 063/427: Add dependency listing., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 231ec586ca 088/427: Drop forced process coding system., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql eba26bead6 102/427: Add emacsql-compile function for debugging., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d5cfaee783 158/427: Be more precise about error messages., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f512300aba 054/427: Fix a few things in emacsql-expr., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e900f99091 075/427: Update examples., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1116a0873e 163/427: Turn everything into generic functions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 47d9476a02 142/427: Add tests for quote operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql cd5e856ea6 150/427: Add :autoincrement., ELPA Syncer, 2022/12/13