From 2aedd4881566fc97833aafb89dfecaaacb5ce523 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 18 Jul 2024 15:13:46 +0200 Subject: [PATCH] update emacssql Signed-off-by: Andreas Gerler --- elpa/emacsql-20230417.1448/emacsql-pkg.el | 12 --- .../emacsql-autoloads.el | 48 +++-------- .../emacsql-compiler.el | 86 +++++++++---------- .../emacsql-mysql.el | 4 +- .../emacsql-pg.el | 2 +- elpa/emacsql-20240415.1535/emacsql-pkg.el | 12 +++ .../emacsql-psql.el | 12 +-- .../emacsql-sqlite-builtin.el | 4 +- .../emacsql-sqlite-common.el | 2 +- .../emacsql-sqlite-module.el | 4 +- .../emacsql-sqlite.el | 4 +- .../emacsql.el | 42 +++++---- .../sqlite/Makefile | 0 .../sqlite/emacsql.c | 0 .../sqlite/sqlite3.c | 0 .../sqlite/sqlite3.h | 0 16 files changed, 105 insertions(+), 127 deletions(-) delete mode 100644 elpa/emacsql-20230417.1448/emacsql-pkg.el rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-autoloads.el (57%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-compiler.el (90%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-mysql.el (98%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-pg.el (97%) create mode 100644 elpa/emacsql-20240415.1535/emacsql-pkg.el rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-psql.el (94%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-sqlite-builtin.el (96%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-sqlite-common.el (99%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-sqlite-module.el (96%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql-sqlite.el (98%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/emacsql.el (94%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/sqlite/Makefile (100%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/sqlite/emacsql.c (100%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/sqlite/sqlite3.c (100%) rename elpa/{emacsql-20230417.1448 => emacsql-20240415.1535}/sqlite/sqlite3.h (100%) diff --git a/elpa/emacsql-20230417.1448/emacsql-pkg.el b/elpa/emacsql-20230417.1448/emacsql-pkg.el deleted file mode 100644 index 67ef9214..00000000 --- a/elpa/emacsql-20230417.1448/emacsql-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(define-package "emacsql" "20230417.1448" "High-level SQL database front-end" - '((emacs "25.1")) - :commit "64012261f65fcdd7ea137d1973ef051af1dced42" :authors - '(("Christopher Wellons" . "wellons@nullprogram.com")) - :maintainers - '(("Jonas Bernoulli" . "jonas@bernoul.li")) - :maintainer - '("Jonas Bernoulli" . "jonas@bernoul.li") - :url "https://github.com/magit/emacsql") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/emacsql-20230417.1448/emacsql-autoloads.el b/elpa/emacsql-20240415.1535/emacsql-autoloads.el similarity index 57% rename from elpa/emacsql-20230417.1448/emacsql-autoloads.el rename to elpa/emacsql-20240415.1535/emacsql-autoloads.el index 60c60073..9586193b 100644 --- a/elpa/emacsql-20230417.1448/emacsql-autoloads.el +++ b/elpa/emacsql-20240415.1535/emacsql-autoloads.el @@ -1,93 +1,73 @@ -;;; emacsql-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- -;; +;;; emacsql-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "emacsql" "emacsql.el" (0 0 0 0)) ;;; Generated autoloads from emacsql.el (autoload 'emacsql-show-last-sql "emacsql" "\ Display the compiled SQL of the s-expression SQL expression before point. A prefix argument causes the SQL to be printed into the current buffer. -\(fn &optional PREFIX)" t nil) - +(fn &optional PREFIX)" t) (register-definition-prefixes "emacsql" '("emacsql-")) -;;;*** -;;;### (autoloads nil "emacsql-compiler" "emacsql-compiler.el" (0 -;;;;;; 0 0 0)) ;;; Generated autoloads from emacsql-compiler.el (register-definition-prefixes "emacsql-compiler" '("emacsql-")) -;;;*** -;;;### (autoloads nil "emacsql-mysql" "emacsql-mysql.el" (0 0 0 0)) ;;; Generated autoloads from emacsql-mysql.el (register-definition-prefixes "emacsql-mysql" '("emacsql-mysql-")) -;;;*** -;;;### (autoloads nil "emacsql-pg" "emacsql-pg.el" (0 0 0 0)) ;;; Generated autoloads from emacsql-pg.el (register-definition-prefixes "emacsql-pg" '("emacsql-pg-connection")) -;;;*** -;;;### (autoloads nil "emacsql-psql" "emacsql-psql.el" (0 0 0 0)) ;;; Generated autoloads from emacsql-psql.el (register-definition-prefixes "emacsql-psql" '("emacsql-psql-")) -;;;*** -;;;### (autoloads nil "emacsql-sqlite" "emacsql-sqlite.el" (0 0 0 -;;;;;; 0)) ;;; Generated autoloads from emacsql-sqlite.el (register-definition-prefixes "emacsql-sqlite" '("emacsql-sqlite-")) -;;;*** -;;;### (autoloads nil "emacsql-sqlite-builtin" "emacsql-sqlite-builtin.el" -;;;;;; (0 0 0 0)) ;;; Generated autoloads from emacsql-sqlite-builtin.el (register-definition-prefixes "emacsql-sqlite-builtin" '("emacsql-sqlite-builtin-connection")) -;;;*** -;;;### (autoloads nil "emacsql-sqlite-common" "emacsql-sqlite-common.el" -;;;;;; (0 0 0 0)) ;;; Generated autoloads from emacsql-sqlite-common.el (register-definition-prefixes "emacsql-sqlite-common" '("emacsql-")) -;;;*** -;;;### (autoloads nil "emacsql-sqlite-module" "emacsql-sqlite-module.el" -;;;;;; (0 0 0 0)) ;;; Generated autoloads from emacsql-sqlite-module.el (register-definition-prefixes "emacsql-sqlite-module" '("emacsql-sqlite-module-connection")) - -;;;*** -;;;### (autoloads nil nil ("emacsql-pkg.el") (0 0 0 0)) +;;; End of scraped data + +(provide 'emacsql-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; emacsql-autoloads.el ends here diff --git a/elpa/emacsql-20230417.1448/emacsql-compiler.el b/elpa/emacsql-20240415.1535/emacsql-compiler.el similarity index 90% rename from elpa/emacsql-20230417.1448/emacsql-compiler.el rename to elpa/emacsql-20240415.1535/emacsql-compiler.el index 4fef1329..d9908a7f 100644 --- a/elpa/emacsql-20230417.1448/emacsql-compiler.el +++ b/elpa/emacsql-20240415.1535/emacsql-compiler.el @@ -3,7 +3,7 @@ ;; This is free and unencumbered software released into the public domain. ;; Author: Christopher Wellons -;; Maintainer: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; SPDX-License-Identifier: Unlicense @@ -20,8 +20,8 @@ (let ((conditions (cl-remove-duplicates (append parents (list symbol 'emacsql-error 'error))))) `(prog1 ',symbol - (setf (get ',symbol 'error-conditions) ',conditions - (get ',symbol 'error-message) ,message)))) + (put ',symbol 'error-conditions ',conditions) + (put ',symbol 'error-message ,message)))) (emacsql-deferror emacsql-error () ;; parent condition for all others "EmacSQL had an unhandled condition") @@ -210,16 +210,16 @@ A parameter is a symbol that looks like $i1, $s2, $v3, etc. The letter refers to the type: identifier (i), scalar (s), vector (v), raw string (r), schema (S)." - (when (symbolp thing) - (let ((name (symbol-name thing))) - (when (string-match-p "^\\$[isvrS][0-9]+$" name) - (cons (1- (read (substring name 2))) - (cl-ecase (aref name 1) - (?i :identifier) - (?s :scalar) - (?v :vector) - (?r :raw) - (?S :schema))))))) + (and (symbolp thing) + (let ((name (symbol-name thing))) + (and (string-match-p "^\\$[isvrS][0-9]+$" name) + (cons (1- (read (substring name 2))) + (cl-ecase (aref name 1) + (?i :identifier) + (?s :scalar) + (?v :vector) + (?r :raw) + (?S :schema))))))) (defmacro emacsql-with-params (prefix &rest body) "Evaluate BODY, collecting parameters. @@ -236,7 +236,7 @@ string, which will be combined with variable definitions." (svector (thing) (combine (emacsql--*vector thing))) (expr (thing) (combine (emacsql--*expr thing))) (subsql (thing) - (format "(%s)" (combine (emacsql-prepare thing))))) + (format "(%s)" (combine (emacsql-prepare thing))))) (cons (concat ,prefix (progn ,@body)) emacsql--vars)))) (defun emacsql--!param (thing &optional kind) @@ -244,9 +244,9 @@ string, which will be combined with variable definitions." If optional KIND is not specified, then try to guess it. Only use within `emacsql-with-params'!" (cl-flet ((check (param) - (when (and kind (not (eq kind (cdr param)))) - (emacsql-error - "Invalid parameter type %s, expecting %s" thing kind)))) + (when (and kind (not (eq kind (cdr param)))) + (emacsql-error + "Invalid parameter type %s, expecting %s" thing kind)))) (let ((param (emacsql-param thing))) (if (null param) (emacsql-escape-format @@ -264,7 +264,7 @@ Only use within `emacsql-with-params'!" (emacsql-escape-scalar thing)))) (prog1 (if (eq (cdr param) :schema) "(%s)" "%s") (check param) - (setf emacsql--vars (nconc emacsql--vars (list param)))))))) + (setq emacsql--vars (nconc emacsql--vars (list param)))))))) (defun emacsql--*vector (vector) "Prepare VECTOR." @@ -275,8 +275,7 @@ Only use within `emacsql-with-params'!" (vector (format "(%s)" (mapconcat #'scalar vector ", "))) (otherwise (emacsql-error "Invalid vector: %S" vector))))) -(defmacro emacsql--generate-op-lookup-defun (name - operator-precedence-groups) +(defmacro emacsql--generate-op-lookup-defun (name operator-precedence-groups) "Generate function to look up predefined SQL operator metadata. The generated function is bound to NAME and accepts two @@ -349,20 +348,18 @@ See `emacsql--generate-op-lookup-defun' for details." "Create format-string for an SQL operator. The format-string returned is intended to be used with `format' to create an SQL expression." - (when expr - (cl-labels ((replace-operand (x) (if (eq x :operand) - "%s" - x)) - (to-format-string (e) (mapconcat #'replace-operand e ""))) - (cond - ((and (eq arity :unary) (eql argument-count 1)) - (to-format-string expr)) - ((and (eq arity :binary) (>= argument-count 2)) - (let ((result (reverse expr))) - (dotimes (_ (- argument-count 2)) - (setf result (nconc (reverse expr) (cdr result)))) - (to-format-string (nreverse result)))) - (t (emacsql-error "Wrong number of operands for %s" op)))))) + (and expr + (cl-labels ((replace-operand (x) (if (eq x :operand) "%s" x)) + (to-format-string (e) (mapconcat #'replace-operand e ""))) + (cond + ((and (eq arity :unary) (eql argument-count 1)) + (to-format-string expr)) + ((and (eq arity :binary) (>= argument-count 2)) + (let ((result (reverse expr))) + (dotimes (_ (- argument-count 2)) + (setq result (nconc (reverse expr) (cdr result)))) + (to-format-string (nreverse result)))) + (t (emacsql-error "Wrong number of operands for %s" op)))))) (defun emacsql--get-op-info (op argument-count parent-precedence-value) "Lookup SQL operator information for generating an SQL expression. @@ -373,10 +370,12 @@ equal to the identified operator's precedence, then the format string returned is wrapped with parentheses." (cl-destructuring-bind (format-string arity precedence-value) (emacsql--get-op op argument-count) - (let ((expanded-format-string (emacsql--expand-format-string op - format-string - arity - argument-count))) + (let ((expanded-format-string + (emacsql--expand-format-string + op + format-string + arity + argument-count))) (cl-values (cond ((null format-string) nil) ((>= parent-precedence-value @@ -397,10 +396,11 @@ string returned is wrapped with parentheses." (emacsql--get-op-info op (length args) (or parent-precedence-value 0)) - (cl-flet ((recur (n) (combine (emacsql--*expr (nth n args) - (or precedence-value 0)))) + (cl-flet ((recur (n) + (combine (emacsql--*expr (nth n args) + (or precedence-value 0)))) (nops (op) - (emacsql-error "Wrong number of operands for %s" op))) + (emacsql-error "Wrong number of operands for %s" op))) (cl-case op ;; Special cases <= >= ((<= >=) @@ -466,7 +466,7 @@ string returned is wrapped with parentheses." "Append parameters from PREPARED to `emacsql--vars', return the string. Only use within `emacsql-with-params'!" (cl-destructuring-bind (string . vars) prepared - (setf emacsql--vars (nconc emacsql--vars vars)) + (setq emacsql--vars (nconc emacsql--vars vars)) string)) (defun emacsql-prepare--string (string) @@ -506,7 +506,7 @@ Only use within `emacsql-with-params'!" (emacsql-escape-format (emacsql-escape-scalar item)))) into parts - do (setf last item) + do (setq last item) finally (cl-return (mapconcat #'identity parts " "))))) diff --git a/elpa/emacsql-20230417.1448/emacsql-mysql.el b/elpa/emacsql-20240415.1535/emacsql-mysql.el similarity index 98% rename from elpa/emacsql-20230417.1448/emacsql-mysql.el rename to elpa/emacsql-20240415.1535/emacsql-mysql.el index 629b3b86..49de133a 100644 --- a/elpa/emacsql-20230417.1448/emacsql-mysql.el +++ b/elpa/emacsql-20240415.1535/emacsql-mysql.el @@ -3,7 +3,7 @@ ;; This is free and unencumbered software released into the public domain. ;; Author: Christopher Wellons -;; Maintainer: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git @@ -126,7 +126,7 @@ http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html") collect (read) into row when (looking-at "\n") collect row into rows - and do (setf row ()) + and do (setq row ()) and do (forward-char) finally (cl-return rows))))) diff --git a/elpa/emacsql-20230417.1448/emacsql-pg.el b/elpa/emacsql-20240415.1535/emacsql-pg.el similarity index 97% rename from elpa/emacsql-20230417.1448/emacsql-pg.el rename to elpa/emacsql-20240415.1535/emacsql-pg.el index b1e82de4..fa2e79d3 100644 --- a/elpa/emacsql-20230417.1448/emacsql-pg.el +++ b/elpa/emacsql-20240415.1535/emacsql-pg.el @@ -3,7 +3,7 @@ ;; This is free and unencumbered software released into the public domain. ;; Author: Christopher Wellons -;; Maintainer: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git diff --git a/elpa/emacsql-20240415.1535/emacsql-pkg.el b/elpa/emacsql-20240415.1535/emacsql-pkg.el new file mode 100644 index 00000000..d4b036ed --- /dev/null +++ b/elpa/emacsql-20240415.1535/emacsql-pkg.el @@ -0,0 +1,12 @@ +(define-package "emacsql" "20240415.1535" "High-level SQL database front-end" + '((emacs "25.1")) + :commit "5108c16c5e1d5bfdd41fcc0807241e28886ab763" :authors + '(("Christopher Wellons" . "wellons@nullprogram.com")) + :maintainers + '(("Jonas Bernoulli" . "emacs.emacsql@jonas.bernoulli.dev")) + :maintainer + '("Jonas Bernoulli" . "emacs.emacsql@jonas.bernoulli.dev") + :url "https://github.com/magit/emacsql") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/emacsql-20230417.1448/emacsql-psql.el b/elpa/emacsql-20240415.1535/emacsql-psql.el similarity index 94% rename from elpa/emacsql-20230417.1448/emacsql-psql.el rename to elpa/emacsql-20240415.1535/emacsql-psql.el index ab0e1da3..ec99276c 100644 --- a/elpa/emacsql-20230417.1448/emacsql-psql.el +++ b/elpa/emacsql-20240415.1535/emacsql-psql.el @@ -3,7 +3,7 @@ ;; This is free and unencumbered software released into the public domain. ;; Author: Christopher Wellons -;; Maintainer: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git ;; Package-Requires: ((emacs "25.1") (emacsql "20230220")) @@ -77,7 +77,7 @@ http://www.postgresql.org/docs/7.3/static/sql-keywords-appendix.html") (when hostname (push "-h" args) (push hostname args)) - (setf args (nreverse args)) + (setq args (nreverse args)) (let* ((buffer (generate-new-buffer " *emacsql-psql*")) (psql emacsql-psql-executable) (command (mapconcat #'shell-quote-argument (cons psql args) " ")) @@ -117,9 +117,9 @@ http://www.postgresql.org/docs/7.3/static/sql-keywords-appendix.html") (cl-defmethod emacsql-waiting-p ((connection emacsql-psql-connection)) (with-current-buffer (emacsql-buffer connection) (cond ((= (buffer-size) 1) (string= "]" (buffer-string))) - ((> (buffer-size) 1) (string= "\n]" - (buffer-substring - (- (point-max) 2) (point-max))))))) + ((> (buffer-size) 1) (string= "\n]" (buffer-substring + (- (point-max) 2) + (point-max))))))) (cl-defmethod emacsql-check-error ((connection emacsql-psql-connection)) (with-current-buffer (emacsql-buffer connection) @@ -139,7 +139,7 @@ http://www.postgresql.org/docs/7.3/static/sql-keywords-appendix.html") collect (read) into row when (looking-at "\n") collect row into rows - and do (progn (forward-char 1) (setf row ())) + and do (progn (forward-char 1) (setq row ())) finally (cl-return rows))))) (provide 'emacsql-psql) diff --git a/elpa/emacsql-20230417.1448/emacsql-sqlite-builtin.el b/elpa/emacsql-20240415.1535/emacsql-sqlite-builtin.el similarity index 96% rename from elpa/emacsql-20230417.1448/emacsql-sqlite-builtin.el rename to elpa/emacsql-20240415.1535/emacsql-sqlite-builtin.el index 747ce84d..86854fd1 100644 --- a/elpa/emacsql-20230417.1448/emacsql-sqlite-builtin.el +++ b/elpa/emacsql-20240415.1535/emacsql-sqlite-builtin.el @@ -2,7 +2,7 @@ ;; This is free and unencumbered software released into the public domain. -;; Author: Jonas Bernoulli +;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git @@ -33,7 +33,7 @@ ((connection emacsql-sqlite-builtin-connection) &rest _) (require (quote sqlite)) (oset connection handle - (sqlite-open (slot-value connection 'file))) + (sqlite-open (oref connection file))) (when emacsql-global-timeout (emacsql connection [:pragma (= busy-timeout $s1)] (/ (* emacsql-global-timeout 1000) 2))) diff --git a/elpa/emacsql-20230417.1448/emacsql-sqlite-common.el b/elpa/emacsql-20240415.1535/emacsql-sqlite-common.el similarity index 99% rename from elpa/emacsql-20230417.1448/emacsql-sqlite-common.el rename to elpa/emacsql-20240415.1535/emacsql-sqlite-common.el index 8f1ca4c2..2a15ab46 100644 --- a/elpa/emacsql-20230417.1448/emacsql-sqlite-common.el +++ b/elpa/emacsql-20240415.1535/emacsql-sqlite-common.el @@ -2,7 +2,7 @@ ;; This is free and unencumbered software released into the public domain. -;; Author: Jonas Bernoulli +;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; SPDX-License-Identifier: Unlicense diff --git a/elpa/emacsql-20230417.1448/emacsql-sqlite-module.el b/elpa/emacsql-20240415.1535/emacsql-sqlite-module.el similarity index 96% rename from elpa/emacsql-20230417.1448/emacsql-sqlite-module.el rename to elpa/emacsql-20240415.1535/emacsql-sqlite-module.el index 92de2c10..d1e0cdbb 100644 --- a/elpa/emacsql-20230417.1448/emacsql-sqlite-module.el +++ b/elpa/emacsql-20240415.1535/emacsql-sqlite-module.el @@ -2,7 +2,7 @@ ;; This is free and unencumbered software released into the public domain. -;; Author: Jonas Bernoulli +;; Author: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git @@ -35,7 +35,7 @@ ((connection emacsql-sqlite-module-connection) &rest _) (require (quote sqlite3)) (oset connection handle - (sqlite3-open (or (slot-value connection 'file) ":memory:") + (sqlite3-open (or (oref connection file) ":memory:") sqlite-open-readwrite sqlite-open-create)) (when emacsql-global-timeout diff --git a/elpa/emacsql-20230417.1448/emacsql-sqlite.el b/elpa/emacsql-20240415.1535/emacsql-sqlite.el similarity index 98% rename from elpa/emacsql-20230417.1448/emacsql-sqlite.el rename to elpa/emacsql-20240415.1535/emacsql-sqlite.el index adc6de84..af6167bb 100644 --- a/elpa/emacsql-20230417.1448/emacsql-sqlite.el +++ b/elpa/emacsql-20240415.1535/emacsql-sqlite.el @@ -3,7 +3,7 @@ ;; This is free and unencumbered software released into the public domain. ;; Author: Christopher Wellons -;; Maintainer: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git @@ -66,7 +66,7 @@ used.") ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60872#11. (coding-system-for-write 'utf-8) (coding-system-for-read 'utf-8) - (file (slot-value connection 'file)) + (file (oref connection file)) (buffer (generate-new-buffer " *emacsql-sqlite*")) (fullfile (if file (expand-file-name file) ":memory:")) (process (start-process diff --git a/elpa/emacsql-20230417.1448/emacsql.el b/elpa/emacsql-20240415.1535/emacsql.el similarity index 94% rename from elpa/emacsql-20230417.1448/emacsql.el rename to elpa/emacsql-20240415.1535/emacsql.el index bcb48e99..d1d0c08b 100644 --- a/elpa/emacsql-20230417.1448/emacsql.el +++ b/elpa/emacsql-20240415.1535/emacsql.el @@ -3,7 +3,7 @@ ;; This is free and unencumbered software released into the public domain. ;; Author: Christopher Wellons -;; Maintainer: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git @@ -94,7 +94,6 @@ may return `process', `user-ptr' or `sqlite' for this value.") (log-buffer :type (or null buffer) :initarg :log-buffer :initform nil - :accessor emacsql-log-buffer :documentation "Output log (debug).") (finalizer :documentation "Object returned from `make-finalizer'.") (types :allocation :class @@ -112,7 +111,7 @@ may return `process', `user-ptr' or `sqlite' for this value.") (cl-defmethod emacsql-live-p ((connection emacsql-connection)) "Return non-nil if CONNECTION is still alive and ready." - (not (null (process-live-p (oref connection handle))))) + (and (process-live-p (oref connection handle)) t)) (cl-defgeneric emacsql-types (connection) "Return an alist mapping EmacSQL types to database types. @@ -127,14 +126,13 @@ SQL expression.") (cl-defmethod emacsql-enable-debugging ((connection emacsql-connection)) "Enable debugging on CONNECTION." - (unless (buffer-live-p (emacsql-log-buffer connection)) - (setf (emacsql-log-buffer connection) - (generate-new-buffer " *emacsql-log*")))) + (unless (buffer-live-p (oref connection log-buffer)) + (oset connection log-buffer (generate-new-buffer " *emacsql-log*")))) (cl-defmethod emacsql-log ((connection emacsql-connection) message) "Log MESSAGE into CONNECTION's log. MESSAGE should not have a newline on the end." - (let ((buffer (emacsql-log-buffer connection))) + (let ((buffer (oref connection log-buffer))) (when buffer (unless (buffer-live-p buffer) (setq buffer (emacsql-enable-debugging connection))) @@ -147,11 +145,11 @@ MESSAGE should not have a newline on the end." Using this function to do it anyway, means additionally using a misnamed and obsolete accessor function." (and (slot-boundp this 'handle) - (eieio-oref this 'handle))) + (oref this handle))) (cl-defmethod (setf emacsql-process) (value (this emacsql-connection)) - (eieio-oset this 'handle value)) + (oset this handle value)) (make-obsolete 'emacsql-process "underlying slot is for internal use only." - "Emacsql 4.0.0") + "EmacSQL 4.0.0") (cl-defmethod slot-missing ((connection emacsql-connection) slot-name operation &optional new-value) @@ -187,7 +185,7 @@ misnamed and obsolete accessor function." (cl-defmethod emacsql-wait ((connection emacsql-connection) &optional timeout) "Block until CONNECTION is waiting for further input." (let* ((real-timeout (or timeout emacsql-global-timeout)) - (end (when real-timeout (+ (float-time) real-timeout)))) + (end (and real-timeout (+ (float-time) real-timeout)))) (while (and (or (null real-timeout) (< (float-time) end)) (not (emacsql-waiting-p connection))) (save-match-data @@ -200,7 +198,7 @@ misnamed and obsolete accessor function." (defun emacsql-compile (connection sql &rest args) "Compile s-expression SQL for CONNECTION into a string." - (let* ((mask (when connection (emacsql-types connection))) + (let* ((mask (and connection (emacsql-types connection))) (emacsql-type-map (or mask emacsql-type-map))) (concat (apply #'emacsql-format (emacsql-prepare sql) args) ";"))) @@ -258,9 +256,9 @@ specific error conditions." (defun emacsql-register (connection) "Register CONNECTION for automatic cleanup and return CONNECTION." - (let ((finalizer (make-finalizer (lambda () (emacsql-close connection))))) - (prog1 connection - (setf (slot-value connection 'finalizer) finalizer)))) + (prog1 connection + (oset connection finalizer + (make-finalizer (lambda () (emacsql-close connection)))))) ;;; Useful macros @@ -301,10 +299,10 @@ multiple times before the changes are committed." (when (= 1 emacsql--transaction-level) (emacsql emacsql--connection [:begin])) (let ((result (progn ,@body))) - (setf emacsql--result result) + (setq emacsql--result result) (when (= 1 emacsql--transaction-level) (emacsql emacsql--connection [:commit])) - (setf emacsql--completed t))) + (setq emacsql--completed t))) (emacsql-locked (emacsql emacsql--connection [:rollback]) (sleep-for 0.05)))) (when (and (= 1 emacsql--transaction-level) @@ -344,7 +342,7 @@ compile time. For example, in the expression below the variables Each column must be a plain symbol, no expressions allowed here." (declare (indent 2)) (let ((sql (if (vectorp sql-and-args) sql-and-args (car sql-and-args))) - (args (unless (vectorp sql-and-args) (cdr sql-and-args)))) + (args (and (not (vectorp sql-and-args)) (cdr sql-and-args)))) (cl-assert (eq :select (elt sql 0))) (let ((vars (elt sql 1))) (when (eq '* vars) @@ -353,7 +351,7 @@ Each column must be a plain symbol, no expressions allowed here." `(let ((emacsql--results (emacsql ,connection ,sql ,@args)) (emacsql--final nil)) (dolist (emacsql--result emacsql--results emacsql--final) - (setf emacsql--final + (setq emacsql--final (cl-destructuring-bind ,(cl-coerce vars 'list) emacsql--result ,@body))))))) @@ -432,9 +430,9 @@ A prefix argument causes the SQL to be printed into the current buffer." (save-excursion (beginning-of-defun) (let ((containing-sexp (elt (parse-partial-sexp (point) start) 1))) - (when containing-sexp - (goto-char containing-sexp) - (looking-at "\\[")))))) + (and containing-sexp + (progn (goto-char containing-sexp) + (looking-at "\\["))))))) (defun emacsql--calculate-vector-indent (fn &optional parse-start) "Don't indent vectors in `emacs-lisp-mode' like lists." diff --git a/elpa/emacsql-20230417.1448/sqlite/Makefile b/elpa/emacsql-20240415.1535/sqlite/Makefile similarity index 100% rename from elpa/emacsql-20230417.1448/sqlite/Makefile rename to elpa/emacsql-20240415.1535/sqlite/Makefile diff --git a/elpa/emacsql-20230417.1448/sqlite/emacsql.c b/elpa/emacsql-20240415.1535/sqlite/emacsql.c similarity index 100% rename from elpa/emacsql-20230417.1448/sqlite/emacsql.c rename to elpa/emacsql-20240415.1535/sqlite/emacsql.c diff --git a/elpa/emacsql-20230417.1448/sqlite/sqlite3.c b/elpa/emacsql-20240415.1535/sqlite/sqlite3.c similarity index 100% rename from elpa/emacsql-20230417.1448/sqlite/sqlite3.c rename to elpa/emacsql-20240415.1535/sqlite/sqlite3.c diff --git a/elpa/emacsql-20230417.1448/sqlite/sqlite3.h b/elpa/emacsql-20240415.1535/sqlite/sqlite3.h similarity index 100% rename from elpa/emacsql-20230417.1448/sqlite/sqlite3.h rename to elpa/emacsql-20240415.1535/sqlite/sqlite3.h -- 2.47.3