summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTE2
-rw-r--r--doc/emacs/files.texi2
-rw-r--r--doc/lispref/control.texi2
-rw-r--r--lisp/sqlite.el7
-rw-r--r--lisp/textmodes/bibtex.el2
-rw-r--r--src/fileio.c2
-rw-r--r--src/lread.c6
-rw-r--r--test/lisp/sqlite-tests.el51
8 files changed, 64 insertions, 10 deletions
diff --git a/CONTRIBUTE b/CONTRIBUTE
index bdee16eeab4..7c5c07771eb 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -237,6 +237,8 @@ formatting them:
particular, gnu.org and fsf.org URLs should start with "https:".
- Commit messages should contain only printable UTF-8 characters.
+ However, we ask that non-ASCII characters be used only if strictly
+ necessary, not just for aesthetic purposes.
- Commit messages should not contain the "Signed-off-by:" lines that
are used in some other projects.
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index b152b7943a2..7f514a1c8b7 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -2392,7 +2392,7 @@ multiply the size by the factor of @w{@code{1 + @var{n} / 10}}, so
@findex image-decrease-size
@kindex i - (Image mode)
@item i -
-Decrease the image size (@code{image-increase-size}) by 20%. Prefix
+Decrease the image size (@code{image-decrease-size}) by 20%. Prefix
numeric argument controls the decrement; the value of @var{n} means to
multiply the size by the factor of @w{@code{1 - @var{n} / 10}}, so
@w{@kbd{C-u 3 i -}} means to decrease the size by 30%.
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 78ad5b68a51..f9f3389c398 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -323,7 +323,7 @@ described below.
@defmac if-let spec then-form else-forms...
Evaluate each binding in @var{spec} in turn, like in @code{let*}
-(@pxref{Local Variables}, stopping if a binding value is @code{nil}.
+(@pxref{Local Variables}), stopping if a binding value is @code{nil}.
If all are non-@code{nil}, return the value of @var{then-form},
otherwise the last form in @var{else-forms}.
@end defmac
diff --git a/lisp/sqlite.el b/lisp/sqlite.el
index 46e35ac18d8..efc5997fb5c 100644
--- a/lisp/sqlite.el
+++ b/lisp/sqlite.el
@@ -32,7 +32,8 @@
If BODY completes normally, commit the changes and return
the value of BODY.
If BODY signals an error, or transaction commit fails, roll
-back the transaction changes."
+back the transaction changes before allowing the signal to
+propagate."
(declare (indent 1) (debug (form body)))
(let ((db-var (gensym))
(func-var (gensym))
@@ -48,8 +49,8 @@ back the transaction changes."
(setq ,res-var (funcall ,func-var))
(setq ,commit-var (sqlite-commit ,db-var))
,res-var)
- (or ,commit-var (sqlite-rollback ,db-var))))
- (funcall ,func-var))))
+ (or ,commit-var (sqlite-rollback ,db-var)))
+ (funcall ,func-var)))))
(provide 'sqlite)
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index a8e2f03bd70..a6da34d6a41 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1012,7 +1012,7 @@ if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD."
("volumes" "Total number of volumes of a multi-volume work")
("year" "Year of publication"))
"Alist of biblatex fields.
-It has the same format as `bibtex-BibTeX-entry-alist'."
+It has the same format as `bibtex-BibTeX-field-alist'."
:group 'bibtex
:version "28.1"
:type 'bibtex-field-alist)
diff --git a/src/fileio.c b/src/fileio.c
index 483498fd879..12da7a9ed3a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -847,7 +847,7 @@ Each element in COMPONENTS must be a string or nil.
DIRECTORY or the non-final elements in COMPONENTS may or may not end
with a slash -- if they don't end with a slash, a slash will be
inserted before concatenating.
-usage: (record DIRECTORY &rest COMPONENTS) */)
+usage: (file-name-concat DIRECTORY &rest COMPONENTS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
ptrdiff_t chars = 0, bytes = 0, multibytes = 0, eargs = 0;
diff --git a/src/lread.c b/src/lread.c
index 49683d02401..1cb941e84fc 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1950,9 +1950,9 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
= Fcons (list2
(Qcomp,
CALLN (Fformat,
- build_string ("Cannot look up eln "
- "file as no source file "
- "was found for %s"),
+ build_string ("Cannot look up .eln file "
+ "for %s because no source "
+ "file was found for it"),
*filename)),
Vdelayed_warnings_list);
return;
diff --git a/test/lisp/sqlite-tests.el b/test/lisp/sqlite-tests.el
new file mode 100644
index 00000000000..d4892a27efc
--- /dev/null
+++ b/test/lisp/sqlite-tests.el
@@ -0,0 +1,51 @@
+;;; sqlite-tests.el --- Tests for sqlite.el -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+(require 'sqlite)
+
+(ert-deftest with-sqlite-transaction ()
+ (skip-unless (sqlite-available-p))
+ (let ((db (sqlite-open)))
+ (sqlite-execute db "create table test (a)")
+ (should
+ (eql 42 (with-sqlite-transaction db
+ (sqlite-execute db "insert into test values (1)")
+ (should (equal '((1)) (sqlite-select db "select * from test")))
+ 42)))
+ ;; Body runs exactly once.
+ (should (equal '((1)) (sqlite-select db "select * from test")))))
+
+(ert-deftest with-sqlite-transaction/rollback ()
+ (skip-unless (sqlite-available-p))
+ (let ((db (sqlite-open)))
+ (sqlite-execute db "create table test (a)")
+ (should (equal '(sqlite-error
+ ("SQL logic error" "no such function: fake" 1 1))
+ (should-error
+ (with-sqlite-transaction db
+ (sqlite-execute db "insert into test values (1)")
+ (sqlite-execute db "insert into test values (fake(2))")
+ 42))))
+ ;; First insertion (a=1) rolled back.
+ (should-not (sqlite-select db "select * from test"))))
+
+;;; sqlite-tests.el ends here