[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 2f606fdd2d 300/427: Fix with-transaction macro to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 2f606fdd2d 300/427: Fix with-transaction macro to return results. |
Date: |
Tue, 13 Dec 2022 02:59:53 -0500 (EST) |
branch: elpa/emacsql
commit 2f606fdd2d522af09b1117e78f96fc44363a21b2
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Fix with-transaction macro to return results.
---
emacsql.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/emacsql.el b/emacsql.el
index 3e6344d2f3..4905e14581 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -260,7 +260,8 @@ multiple times before the changes are committed."
(declare (indent 1))
`(let ((emacsql--connection ,connection)
(emacsql--completed nil)
- (emacsql--transaction-level (1+ emacsql--transaction-level)))
+ (emacsql--transaction-level (1+ emacsql--transaction-level))
+ (emacsql--result))
(unwind-protect
(while (not emacsql--completed)
(condition-case nil
@@ -268,15 +269,16 @@ multiple times before the changes are committed."
(when (= 1 emacsql--transaction-level)
(emacsql emacsql--connection [:begin :transaction]))
(let ((result (progn ,@body)))
- (prog1 result
- (when (= 1 emacsql--transaction-level)
- (emacsql emacsql--connection [:commit]))
- (setf emacsql--completed t))))
+ (setf emacsql--result result)
+ (when (= 1 emacsql--transaction-level)
+ (emacsql emacsql--connection [:commit]))
+ (setf emacsql--completed t)))
(emacsql-locked (emacsql emacsql--connection [:rollback])
(sleep-for 0.05))))
(when (and (= 1 emacsql--transaction-level)
(not emacsql--completed))
- (emacsql emacsql--connection [:rollback])))))
+ (emacsql emacsql--connection [:rollback])))
+ emacsql--result))
(defmacro emacsql-thread (connection &rest statements)
"Thread CONNECTION through STATEMENTS.
- [nongnu] elpa/emacsql 4db068920d 247/427: Provide MySQL front-end., (continued)
- [nongnu] elpa/emacsql 4db068920d 247/427: Provide MySQL front-end., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dce6736e04 249/427: Oops, add new MySQL module to the Makefile., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fcba876d0e 251/427: Solve the tty (pty) issue in MySQL., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fb0e2d5423 256/427: Fix typecase typo., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a6e859f1b5 260/427: Normalize darwin OS., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4332bd67ec 271/427: Flesh out the main header a bit more., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4e9297233d 273/427: Don't rely on C99 mode., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 7963261ef3 270/427: Bump to version 1.0.0., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6f6533ab70 272/427: Add Cygwin note., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 45f43323ad 275/427: Check the compiler error code., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2f606fdd2d 300/427: Fix with-transaction macro to return results.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 76acd4f8a1 304/427: Add a test for reserved word escaping., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a6155464c7 274/427: Try to build the package locally if possible., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4a58806d64 299/427: Improve new indentation a little bit., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c512f4287c 315/427: Add back-end note to README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a0587f1b5f 311/427: Fix docstring on emacsql-enable-debugging., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9cf4e267cc 310/427: Bump up to version 1.0.2., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fd73d37df8 319/427: Ignore the generated executable, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 048e81b759 320/427: Add file tests/.nosearch, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 017cd8460d 329/427: Use own data root in emacsql-sqlite., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 03d4788708 332/427: Bump to version 2.0.0 (fix #15)., ELPA Syncer, 2022/12/13