From fe491173e8f839653cb22eea63a7261f4aa1dca9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 Mar 2024 11:40:27 +0200 Subject: [PATCH 1/7] ; * doc/emacs/files.texi (Image Mode): Fix typo (bug#69671). --- doc/emacs/files.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 36f72d42ba2..971483a6e4c 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -2373,7 +2373,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%. From db5915f30ba063b72b007d243fbd832e8a4e8961 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sun, 10 Mar 2024 20:13:42 -0700 Subject: [PATCH 2/7] Fix 'with-sqlite-transaction' * lisp/sqlite.el (with-sqlite-transaction): Tuck misplaced body of else form back into feature-test control structure whence it escaped. (Bug#67142) * test/lisp/sqlite-tests.el: New file to accompany test/src/sqlite-tests.el. --- lisp/sqlite.el | 7 +++--- test/lisp/sqlite-tests.el | 51 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 test/lisp/sqlite-tests.el 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/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 . + +;;; 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 From a9be5c7ea92e7868873d6d3c721d5a0be62ee3ad Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Tue, 12 Mar 2024 12:53:32 +0100 Subject: [PATCH 3/7] ; * doc/lispref/control.texi (Conditionals): Add missing paren (bug#69742). --- doc/lispref/control.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index eb1640ede52..292086ee4e0 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -322,7 +322,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 From db027a06976ee1bcbe6294e281bd5954dd1052ef Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 12 Mar 2024 22:47:45 +0100 Subject: [PATCH 4/7] ; Fix bibtex-biblatex-field-alist docstring typo. --- lisp/textmodes/bibtex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 3d155ac87b5..d78dac53516 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) From b708e639d63f488a98c7416866665c16730b9e8f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 14 Mar 2024 21:08:36 +0200 Subject: [PATCH 5/7] ; * src/lread.c (maybe_swap_for_eln): Clarify warning message. --- src/lread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lread.c b/src/lread.c index 451f699e27d..7574e45f3dd 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1745,9 +1745,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; From ed48b0d657cbf183a3e391a95672f921688e6ba8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 15 Mar 2024 13:29:31 +0200 Subject: [PATCH 6/7] ; * CONTRIBUTE: Ask not to use non-ASCII unless necessary. --- CONTRIBUTE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTE b/CONTRIBUTE index cdb47911d76..af5519c1bb3 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. From 3b791ebbe173fa18515558acaafbef1f88c51791 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 16 Mar 2024 00:19:43 +0100 Subject: [PATCH 7/7] ; Fix 'usage:' keyword in Ffile_name_concat doc. --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index a2e230879c3..a5d29d81fb7 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -759,7 +759,7 @@ Elements 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;