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

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

[elpa] externals/triples 5d44aab1e5 1/2: Fix various compilation errors.


From: ELPA Syncer
Subject: [elpa] externals/triples 5d44aab1e5 1/2: Fix various compilation errors.
Date: Thu, 10 Aug 2023 00:58:50 -0400 (EDT)

branch: externals/triples
commit 5d44aab1e5fefe379286fec35d9282fc7c640a0d
Author: Andrew Hyatt <ahyatt@gmail.com>
Commit: Andrew Hyatt <ahyatt@gmail.com>

    Fix various compilation errors.
    
    This partially should fix https://github.com/ahyatt/ekg/issues/87.
---
 NEWS.org   |  2 ++
 triples.el | 26 ++++++++++++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 48a1245742..4e383c7e05 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,5 +1,7 @@
 TITLE: Changelog for the triples module for GNU Emacs.
 
+* 0.3.5
+- Compilation issues, and fixing an issue with not being able to use 
triples-with-transaction in some cases.
 * 0.3.4
 - Fix instances where the database has no index, and has duplicate rows 
because of that index.
 - Fix differences in the properties column between emacsql and builtin when 
upgrading from emacsql to builtin.
diff --git a/triples.el b/triples.el
index 1ff0513cab..4c801f36cd 100644
--- a/triples.el
+++ b/triples.el
@@ -33,9 +33,16 @@
 (require 'package)
 (require 'seq)
 (require 'subr-x)
+(require 'emacsql nil t)
 
 ;;; Code:
 
+(defvar emacsql-sqlite-executable)
+(declare-function emacsql-with-transaction "emacsql")
+(declare-function emacsql-close "emacsql")
+(declare-function emacsql-sqlite "emacsql")
+(declare-function emacsql "emacsql")
+
 (defvar triples-sqlite-interface
   (if (and (fboundp 'sqlite-available-p) (sqlite-available-p))
       'builtin
@@ -54,6 +61,12 @@ It is invoked to make backups.")
   "The default filename triples database. If no database is
 specified, this file is used.")
 
+(defmacro triples-with-transaction (db &rest body)
+  "Create a transaction using DB, executing BODY.
+The transaction will abort if an error is thrown."
+  (declare (indent 0) (debug t))
+  `(triples--with-transaction ,db (lambda () ,@body)))
+
 (defun triples-rebuild-builtin-database (db)
   "Rebuild the builtin database DB.
 This is used in upgrades and when problems are detected."
@@ -135,8 +148,11 @@ upgrades to version 0.3"
     ('builtin (sqlite-close db))
     ('emacsql (emacsql-close db))))
 
-(defun triples-backup (db filename num-to-keep)
-  "Perform a backup of DB, located at path FILENAME.
+(defun triples-backup (_ filename num-to-keep)
+  "Perform a backup of the db, located at path FILENAME.
+The first argument is unused, but later may be used to specify
+the running database.
+
 This uses the same backup location and names as configured in
 variables such as `backup-directory-alist'. Due to the fact that
 the database is never opened as a buffer, normal backups will not
@@ -518,12 +534,6 @@ PROPERTIES is a plist of properties, without TYPE 
prefixes."
                      (cdr c))) prop-schema-alist))
     (triples--add db op)))
 
-(defmacro triples-with-transaction (db &rest body)
-  "Create a transaction using DB, executing BODY.
-The transaction will abort if an error is thrown."
-  (declare (indent 0) (debug t))
-  `(triples--with-transaction ,db (lambda () ,@body)))
-
 (defmacro triples--eval-when-fboundp (sym form)
   "Delay macroexpansion to runtime if SYM is not yet `fboundp'."
   (declare (indent 1) (debug (symbolp form)))



reply via email to

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