emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql 5da614bc9b 359/427: Drop finalizer use and explici


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 5da614bc9b 359/427: Drop finalizer use and explicitely depend on Emacs 25
Date: Tue, 13 Dec 2022 03:00:04 -0500 (EST)

branch: elpa/emacsql
commit 5da614bc9b37525a1dd3a2d420b3702215ae49b9
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Drop finalizer use and explicitely depend on Emacs 25
    
    Emacs 25 has been released for over a year now. EIEIO has diverged, and
    continues to diverge, from Emacs 24, making it more difficult to
    support as time goes on.
---
 Makefile   | 5 ++---
 README.md  | 2 +-
 emacsql.el | 9 +++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index c8eb4c9d1c..f931a0bd73 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,16 @@
 # Clone the two dependencies of this package in sibling directories:
 #     $ cd ..
 #     $ git clone https://github.com/cbbrowne/pg.el pg
-#     $ git clone https://github.com/skeeto/elisp-finalize finalize
 #     $ cd -
 #     $ make
 #
 # Or set LDFLAGS to point at these packages elsewhere:
-#     $ make LDFLAGS='-L path/to/finalize -L path/to/pg'
+#     $ make LDFLAGS='-L path/to/pg'
 
 .POSIX:
 .SUFFIXES: .el .elc
 EMACS   = emacs
-LDFLAGS = -L ../finalize -L ../pg
+LDFLAGS = -L ../pg
 BATCH   = $(EMACS) -batch -Q -L . -L tests $(LDFLAGS)
 
 EL = emacsql-compiler.el \
diff --git a/README.md b/README.md
index 248d68cbf2..54bf1c240a 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ build tool is required. If your own package depends on 
EmacSQL as a
 database, this means it doesn't have to rely on the user having any
 particular software installed.
 
-Requires Emacs 24.3 or later.
+Requires Emacs 25 or later.
 
 ### Windows Issues
 
diff --git a/emacsql.el b/emacsql.el
index 83c1b43c9f..0d7cc15f4f 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -5,7 +5,7 @@
 ;; Author: Christopher Wellons <wellons@nullprogram.com>
 ;; URL: https://github.com/skeeto/emacsql
 ;; Version: 2.0.2
-;; Package-Requires: ((emacs "24.3") (cl-generic "0.3") (cl-lib "0.3") 
(finalize "1.0.0"))
+;; Package-Requires: ((emacs "25"))
 
 ;;; Commentary:
 
@@ -63,7 +63,6 @@
 (require 'cl-lib)
 (require 'cl-generic)
 (require 'eieio)
-(require 'finalize)
 (require 'emacsql-compiler)
 
 (defgroup emacsql nil
@@ -91,6 +90,7 @@ If nil, wait forever.")
                :initform nil
                :accessor emacsql-log-buffer
                :documentation "Output log (debug).")
+   (finalizer :documentation "Object returned from `make-finalizer'.")
    (types :allocation :class
           :initform nil
           :reader emacsql-types
@@ -221,8 +221,9 @@ specific error conditions."
 
 (defun emacsql-register (connection)
   "Register CONNECTION for automatic cleanup and return CONNECTION."
-  (finalize-register connection #'emacsql-close (copy-sequence connection))
-  connection)
+  (let ((finalizer (make-finalizer (lambda () (emacsql-close connection)))))
+    (prog1 connection
+      (setf (slot-value connection 'finalizer) finalizer))))
 
 ;;; Useful macros
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]