diff options
| author | Eli Zaretskii | 2024-03-16 05:47:41 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2024-03-16 05:47:41 -0400 |
| commit | cc8a2c57b5eed4045035dfeaf129ce33d7f74733 (patch) | |
| tree | 793edac12eec2ecc8539441e152e7b33fad9ab78 | |
| parent | 899ea79310d1b8ed78c3fd8ac1784043dd732dbf (diff) | |
| parent | 3b791ebbe173fa18515558acaafbef1f88c51791 (diff) | |
| download | emacs-cc8a2c57b5eed4045035dfeaf129ce33d7f74733.tar.gz emacs-cc8a2c57b5eed4045035dfeaf129ce33d7f74733.zip | |
Merge from origin/emacs-29
3b791ebbe17 ; Fix 'usage:' keyword in Ffile_name_concat doc.
ed48b0d657c ; * CONTRIBUTE: Ask not to use non-ASCII unless necessary.
b708e639d63 ; * src/lread.c (maybe_swap_for_eln): Clarify warning mes...
db027a06976 ; Fix bibtex-biblatex-field-alist docstring typo.
a9be5c7ea92 ; * doc/lispref/control.texi (Conditionals): Add missing ...
db5915f30ba Fix 'with-sqlite-transaction'
fe491173e8f ; * doc/emacs/files.texi (Image Mode): Fix typo (bug#69671).
| -rw-r--r-- | CONTRIBUTE | 2 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 2 | ||||
| -rw-r--r-- | lisp/sqlite.el | 7 | ||||
| -rw-r--r-- | lisp/textmodes/bibtex.el | 2 | ||||
| -rw-r--r-- | src/fileio.c | 2 | ||||
| -rw-r--r-- | src/lread.c | 6 | ||||
| -rw-r--r-- | test/lisp/sqlite-tests.el | 51 |
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: | |||
| 237 | particular, gnu.org and fsf.org URLs should start with "https:". | 237 | particular, gnu.org and fsf.org URLs should start with "https:". |
| 238 | 238 | ||
| 239 | - Commit messages should contain only printable UTF-8 characters. | 239 | - Commit messages should contain only printable UTF-8 characters. |
| 240 | However, we ask that non-ASCII characters be used only if strictly | ||
| 241 | necessary, not just for aesthetic purposes. | ||
| 240 | 242 | ||
| 241 | - Commit messages should not contain the "Signed-off-by:" lines that | 243 | - Commit messages should not contain the "Signed-off-by:" lines that |
| 242 | are used in some other projects. | 244 | 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 | |||
| 2392 | @findex image-decrease-size | 2392 | @findex image-decrease-size |
| 2393 | @kindex i - (Image mode) | 2393 | @kindex i - (Image mode) |
| 2394 | @item i - | 2394 | @item i - |
| 2395 | Decrease the image size (@code{image-increase-size}) by 20%. Prefix | 2395 | Decrease the image size (@code{image-decrease-size}) by 20%. Prefix |
| 2396 | numeric argument controls the decrement; the value of @var{n} means to | 2396 | numeric argument controls the decrement; the value of @var{n} means to |
| 2397 | multiply the size by the factor of @w{@code{1 - @var{n} / 10}}, so | 2397 | multiply the size by the factor of @w{@code{1 - @var{n} / 10}}, so |
| 2398 | @w{@kbd{C-u 3 i -}} means to decrease the size by 30%. | 2398 | @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. | |||
| 323 | 323 | ||
| 324 | @defmac if-let spec then-form else-forms... | 324 | @defmac if-let spec then-form else-forms... |
| 325 | Evaluate each binding in @var{spec} in turn, like in @code{let*} | 325 | Evaluate each binding in @var{spec} in turn, like in @code{let*} |
| 326 | (@pxref{Local Variables}, stopping if a binding value is @code{nil}. | 326 | (@pxref{Local Variables}), stopping if a binding value is @code{nil}. |
| 327 | If all are non-@code{nil}, return the value of @var{then-form}, | 327 | If all are non-@code{nil}, return the value of @var{then-form}, |
| 328 | otherwise the last form in @var{else-forms}. | 328 | otherwise the last form in @var{else-forms}. |
| 329 | @end defmac | 329 | @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 @@ | |||
| 32 | If BODY completes normally, commit the changes and return | 32 | If BODY completes normally, commit the changes and return |
| 33 | the value of BODY. | 33 | the value of BODY. |
| 34 | If BODY signals an error, or transaction commit fails, roll | 34 | If BODY signals an error, or transaction commit fails, roll |
| 35 | back the transaction changes." | 35 | back the transaction changes before allowing the signal to |
| 36 | propagate." | ||
| 36 | (declare (indent 1) (debug (form body))) | 37 | (declare (indent 1) (debug (form body))) |
| 37 | (let ((db-var (gensym)) | 38 | (let ((db-var (gensym)) |
| 38 | (func-var (gensym)) | 39 | (func-var (gensym)) |
| @@ -48,8 +49,8 @@ back the transaction changes." | |||
| 48 | (setq ,res-var (funcall ,func-var)) | 49 | (setq ,res-var (funcall ,func-var)) |
| 49 | (setq ,commit-var (sqlite-commit ,db-var)) | 50 | (setq ,commit-var (sqlite-commit ,db-var)) |
| 50 | ,res-var) | 51 | ,res-var) |
| 51 | (or ,commit-var (sqlite-rollback ,db-var)))) | 52 | (or ,commit-var (sqlite-rollback ,db-var))) |
| 52 | (funcall ,func-var)))) | 53 | (funcall ,func-var))))) |
| 53 | 54 | ||
| 54 | (provide 'sqlite) | 55 | (provide 'sqlite) |
| 55 | 56 | ||
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." | |||
| 1012 | ("volumes" "Total number of volumes of a multi-volume work") | 1012 | ("volumes" "Total number of volumes of a multi-volume work") |
| 1013 | ("year" "Year of publication")) | 1013 | ("year" "Year of publication")) |
| 1014 | "Alist of biblatex fields. | 1014 | "Alist of biblatex fields. |
| 1015 | It has the same format as `bibtex-BibTeX-entry-alist'." | 1015 | It has the same format as `bibtex-BibTeX-field-alist'." |
| 1016 | :group 'bibtex | 1016 | :group 'bibtex |
| 1017 | :version "28.1" | 1017 | :version "28.1" |
| 1018 | :type 'bibtex-field-alist) | 1018 | :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. | |||
| 847 | DIRECTORY or the non-final elements in COMPONENTS may or may not end | 847 | DIRECTORY or the non-final elements in COMPONENTS may or may not end |
| 848 | with a slash -- if they don't end with a slash, a slash will be | 848 | with a slash -- if they don't end with a slash, a slash will be |
| 849 | inserted before concatenating. | 849 | inserted before concatenating. |
| 850 | usage: (record DIRECTORY &rest COMPONENTS) */) | 850 | usage: (file-name-concat DIRECTORY &rest COMPONENTS) */) |
| 851 | (ptrdiff_t nargs, Lisp_Object *args) | 851 | (ptrdiff_t nargs, Lisp_Object *args) |
| 852 | { | 852 | { |
| 853 | ptrdiff_t chars = 0, bytes = 0, multibytes = 0, eargs = 0; | 853 | 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, | |||
| 1950 | = Fcons (list2 | 1950 | = Fcons (list2 |
| 1951 | (Qcomp, | 1951 | (Qcomp, |
| 1952 | CALLN (Fformat, | 1952 | CALLN (Fformat, |
| 1953 | build_string ("Cannot look up eln " | 1953 | build_string ("Cannot look up .eln file " |
| 1954 | "file as no source file " | 1954 | "for %s because no source " |
| 1955 | "was found for %s"), | 1955 | "file was found for it"), |
| 1956 | *filename)), | 1956 | *filename)), |
| 1957 | Vdelayed_warnings_list); | 1957 | Vdelayed_warnings_list); |
| 1958 | return; | 1958 | 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 @@ | |||
| 1 | ;;; sqlite-tests.el --- Tests for sqlite.el -*- lexical-binding: t; -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2024 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | (require 'sqlite) | ||
| 24 | |||
| 25 | (ert-deftest with-sqlite-transaction () | ||
| 26 | (skip-unless (sqlite-available-p)) | ||
| 27 | (let ((db (sqlite-open))) | ||
| 28 | (sqlite-execute db "create table test (a)") | ||
| 29 | (should | ||
| 30 | (eql 42 (with-sqlite-transaction db | ||
| 31 | (sqlite-execute db "insert into test values (1)") | ||
| 32 | (should (equal '((1)) (sqlite-select db "select * from test"))) | ||
| 33 | 42))) | ||
| 34 | ;; Body runs exactly once. | ||
| 35 | (should (equal '((1)) (sqlite-select db "select * from test"))))) | ||
| 36 | |||
| 37 | (ert-deftest with-sqlite-transaction/rollback () | ||
| 38 | (skip-unless (sqlite-available-p)) | ||
| 39 | (let ((db (sqlite-open))) | ||
| 40 | (sqlite-execute db "create table test (a)") | ||
| 41 | (should (equal '(sqlite-error | ||
| 42 | ("SQL logic error" "no such function: fake" 1 1)) | ||
| 43 | (should-error | ||
| 44 | (with-sqlite-transaction db | ||
| 45 | (sqlite-execute db "insert into test values (1)") | ||
| 46 | (sqlite-execute db "insert into test values (fake(2))") | ||
| 47 | 42)))) | ||
| 48 | ;; First insertion (a=1) rolled back. | ||
| 49 | (should-not (sqlite-select db "select * from test")))) | ||
| 50 | |||
| 51 | ;;; sqlite-tests.el ends here | ||