commit b8e6beaab01e9c7eaf5cdc12a34987402fb9b72f (HEAD, refs/remotes/origin/master) Merge: 855f1bd176 3607508f3f Author: Stefan Kangas Date: Tue Dec 14 06:31:37 2021 +0100 Merge from origin/emacs-28 3607508f3f Set calc-make-windows-dedicated to nil by default 9de8eec3bc * make-dist: Don't run "make --question info". (Bug#52322) cea8deea72 ; * src/xdisp.c (move_it_vertically_backward): Clarify com... 6170c5036e Fix regression in help-mode prompt # Conflicts: # etc/NEWS commit 3607508f3ffa3c32bc913a8be08f3d00bcde8027 (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Tue Dec 14 03:38:11 2021 +0100 Set calc-make-windows-dedicated to nil by default * lisp/calc/calc.el (calc-make-windows-dedicated): Default to nil. (Bug#52016) diff --git a/etc/NEWS b/etc/NEWS index eb65213ac2..d2565e50e1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1588,9 +1588,9 @@ and the result is not truncated in any way. It no longer has lower precedence than '+' and '-'. --- -*** Calc now marks its windows dedicated. -The new user option 'calc-make-windows-dedicated' controls this. It -is t by default; set to nil to get back the old behavior. +*** New user option 'calc-make-windows-dedicated'. +When this user option is non-nil, Calc will mark its windows as +dedicated. ** Calendar diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 553bdc9c6e..e97315165b 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1423,7 +1423,7 @@ commands given here will actually operate on the *Calculator* stack." (require 'calc-ext) (calc-set-language calc-language calc-language-option t))) -(defcustom calc-make-windows-dedicated t +(defcustom calc-make-windows-dedicated nil "If non-nil, windows displaying Calc buffers will be marked dedicated. See `window-dedicated-p' for what that means." :version "28.1" commit 9de8eec3bc9be2f6e7debf26159c1761c47df909 Author: Stefan Kangas Date: Tue Dec 14 03:08:37 2021 +0100 * make-dist: Don't run "make --question info". (Bug#52322) diff --git a/make-dist b/make-dist index b069130ca6..db7a74b82b 100755 --- a/make-dist +++ b/make-dist @@ -299,13 +299,6 @@ if [ $check = yes ]; then echo "${bogosities}" fi - ## This exits with non-zero status if any .info files need - ## rebuilding. - if [ -r Makefile ] && [ "$with_info" = "yes" ]; then - echo "Checking to see if info files are up-to-date..." - make --question info || error=yes - fi - ## Is this a release? case $version in [1-9][0-9].[0-9]) commit 855f1bd17667781761e62ed439ecc99fe972cf1a Author: Stefan Kangas Date: Tue Dec 14 02:16:41 2021 +0100 completion.el: Make two compat aliases obsolete * lisp/completion.el (cmpl-syntax-table, initialize-completions): Make compat aliases obsolete. diff --git a/lisp/completion.el b/lisp/completion.el index 643f2da0d2..a77cccde64 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -492,7 +492,7 @@ Used to decide whether to save completions.") table)) ;; Old name, non-namespace-clean. -(defvaralias 'cmpl-syntax-table 'completion-syntax-table) +(define-obsolete-variable-alias 'cmpl-syntax-table 'completion-syntax-table "29.1") (defvar-local completion-syntax-table completion-standard-syntax-table "This variable holds the current completion syntax table.") @@ -2220,7 +2220,7 @@ TYPE is the type of the wrapper to be added. Can be :before or :under." (completion-def-wrapper 'delete-backward-char-untabify :backward) ;; Old name, non-namespace-clean. -(defalias 'initialize-completions #'completion-initialize) +(define-obsolete-function-alias 'initialize-completions #'completion-initialize "29.1") (provide 'completion) commit cea8deea7288efd15880dc035dccfb8d9866dff8 Author: Eli Zaretskii Date: Mon Dec 13 21:02:38 2021 +0200 ; * src/xdisp.c (move_it_vertically_backward): Clarify commentary. diff --git a/src/xdisp.c b/src/xdisp.c index 5d687e1c29..597b12d4d6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10233,11 +10233,12 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos /* Move iterator IT backward by a specified y-distance DY, DY >= 0. - If DY > 0, move IT backward at least that many pixels. DY = 0 - means move IT backward to the preceding line start or BEGV. This - function may move over more than DY pixels if IT->current_y - DY - ends up in the middle of a line; in this case IT->current_y will be - set to the top of the line moved to. */ + If DY > 0, move IT backward that many pixels. + DY = 0 means move IT backward to the preceding line start or to BEGV. + This function may move over less or more than DY pixels if + IT->current_y - DY ends up in the middle of a line; in this case + IT->current_y will be set to the top of the line either before or + after the exact pixel coordinate. */ void move_it_vertically_backward (struct it *it, int dy) commit ae169bda2cbec49e30a7ca15828c45f2c638e500 Author: Philipp Stephani Date: Mon Dec 13 18:28:13 2021 +0100 ; Add a FIXME regarding the GMP memory allocation functions. * src/bignum.c (init_bignum): Add a warning about the technically incorrect use of the GMP memory allocation functions. diff --git a/src/bignum.c b/src/bignum.c index 1ac75c19e2..5c587fc6db 100644 --- a/src/bignum.c +++ b/src/bignum.c @@ -53,6 +53,15 @@ init_bignum (void) { eassert (mp_bits_per_limb == GMP_NUMB_BITS); integer_width = 1 << 16; + + /* FIXME: The Info node `(gmp) Custom Allocation' states: "No error + return is allowed from any of these functions, if they return + then they must have performed the specified operation. [...] + There's currently no defined way for the allocation functions to + recover from an error such as out of memory, they must terminate + program execution. A 'longjmp' or throwing a C++ exception will + have undefined results." But xmalloc and xrealloc do call + 'longjmp'. */ mp_set_memory_functions (xmalloc, xrealloc_for_gmp, xfree_for_gmp); for (int i = 0; i < ARRAYELTS (mpz); i++) commit b30b33ed9b3cdacecebef73ad1131f03c635de7a Author: Michael Albinus Date: Mon Dec 13 16:09:56 2021 +0100 ERT can generate JUnit test reports * .gitignore: Add test/**/*.xml. * admin/notes/emba: Mention JUnit test report. * etc/NEWS: ERT can generate JUnit test reports. * lisp/emacs-lisp/ert.el (xml-escape-string): Autoload. (ert-write-junit-test-report) (ert-write-junit-test-summary-report): New defuns. (ert-run-tests-batch, ert-summarize-tests-batch-and-exit): Call them. * test/Makefile.in (clean): Remove *.xml. * test/README: Mention $EMACS_TEST_JUNIT_REPORT environment variable. * test/infra/Makefile.in ($(FILE)): Generate header commentary. (clean): Remove. * test/infra/gitlab-ci.yml (variables): Set EMACS_TEST_JUNIT_REPORT. (.job-template): Use it in script and after_script. (.build-template, .gnustep-template, .filenotify-gio-template) (.native-comp-template): Adapt rules. (.test-template): Trigger JUnit test report. * test/infra/test-jobs.yml: Regenerate. diff --git a/.gitignore b/.gitignore index f1abb2ab68..7baee47b0a 100644 --- a/.gitignore +++ b/.gitignore @@ -159,6 +159,7 @@ test/manual/etags/CTAGS test/manual/indent/*.new test/lisp/gnus/mml-sec-resources/random_seed test/lisp/play/fortune-resources/fortunes.dat +test/**/*.xml # ctags, etags. TAGS diff --git a/admin/notes/emba b/admin/notes/emba index f1b52b2cde..2135c7a97c 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -63,6 +63,10 @@ They can be downloaded from the server, visiting the URL , and selecting the job in question. +Every pipeline generates a JUnit test report for the respective test +jobs, which can be inspected on the pipeline web page. This test +report counts completed ERT tests, aborted tests are not counted. + * Emba configuration The emba configuration files are hosted on diff --git a/etc/NEWS b/etc/NEWS index b55b30665b..8d83b2a7e3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -163,6 +163,12 @@ the previous definition to be discarded, which was probably not intended when this occurs in batch mode. To remedy the error, rename tests so that they all have unique names. ++++ +*** ERT can generate JUnit test reports. +When environment variable 'EMACS_TEST_JUNIT_REPORT' is set, ERT +generates a JUnit test report under this file name. This is useful +for Emacs integration into CI/CD test environments. + ** Emoji +++ @@ -1143,6 +1149,7 @@ This variable is bound to t during the preparation of a "*Help*" buffer. ** 'date-to-time' now assumes earliest values if its argument lacks month, day, or time. For example, (date-to-time "2021-12-04") now assumes a time of 00:00 instead of signaling an error. + * Changes in Emacs 29.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 946193e40d..981e23931c 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -65,6 +65,8 @@ (require 'pp) (require 'map) +(autoload 'xml-escape-string "xml.el") + ;;; UI customization options. (defgroup ert () @@ -247,7 +249,6 @@ in batch mode, an error is signalled. "%s\\(\\s-\\|$\\)") "The regexp the `find-function' mechanisms use for finding test definitions.") - (define-error 'ert-test-failed "Test failed") (define-error 'ert-test-skipped "Test skipped") @@ -677,7 +678,6 @@ and is displayed in front of the value of MESSAGE-FORM." ,@body)) - ;;; Facilities for running a single test. (defvar ert-debug-on-error nil @@ -1437,7 +1437,9 @@ Returns the stats object." (if (getenv "EMACS_TEST_VERBOSE") (ert-reason-for-test-result result) "")))) - (message "%s" ""))))) + (message "%s" "")) + (when (getenv "EMACS_TEST_JUNIT_REPORT") + (ert-write-junit-test-report stats))))) (test-started) (test-ended (cl-destructuring-bind (stats test result) event-args @@ -1525,6 +1527,128 @@ the tests)." (backtrace)) (kill-emacs 2)))) +(defun ert-write-junit-test-report (stats) + "Write a JUnit test report, generated from STATS." + ;; https://www.ibm.com/docs/de/developer-for-zos/14.1.0?topic=formats-junit-xml-format + ;; https://llg.cubic.org/docs/junit/ + (unless (zerop (length (ert--stats-tests stats))) + (when-let ((test-file + (symbol-file + (ert-test-name (aref (ert--stats-tests stats) 0)) 'ert--test))) + (with-temp-file (file-name-with-extension test-file "xml") + (insert "\n") + (insert (format "\n" + (file-name-nondirectory test-file) + (ert-stats-total stats) + (ert-stats-completed-unexpected stats) + (ert-stats-skipped stats) + (float-time + (time-subtract + (ert--stats-end-time stats) + (ert--stats-start-time stats))))) + (insert (format " \n" + (file-name-nondirectory test-file) + (ert-stats-total stats) + (ert-stats-completed-unexpected stats) + (ert-stats-skipped stats) + (float-time + (time-subtract + (ert--stats-end-time stats) + (ert--stats-start-time stats))) + (ert--format-time-iso8601 (ert--stats-end-time stats)))) + (insert " \n" + (format " \n" + (ert--stats-selector stats)) + " \n") + (cl-loop for test across (ert--stats-tests stats) + for result = (ert-test-most-recent-result test) do + (insert (format " \n") + (insert ">\n") + (if (ert-test-skipped-p result) + (insert (format " \n" + (xml-escape-string + (string-trim + (ert-reason-for-test-result result))) + (ert-string-for-test-result + result + (ert-test-result-expected-p + test result))) + (xml-escape-string + (string-trim + (ert-reason-for-test-result result))) + "\n" + " \n") + (unless + (ert-test-result-type-p + result (ert-test-expected-result-type test)) + (insert (format " \n" + (xml-escape-string + (string-trim + (ert-reason-for-test-result result))) + (ert-string-for-test-result + result + (ert-test-result-expected-p + test result))) + (xml-escape-string + (string-trim + (ert-reason-for-test-result result))) + "\n" + " \n"))) + (unless (zerop (length (ert-test-result-messages result))) + (insert " \n" + (xml-escape-string + (ert-test-result-messages result)) + " \n")) + (insert " \n"))) + (insert " \n") + (insert "\n"))))) + +(defun ert-write-junit-test-summary-report (&rest logfiles) + "Write a JUnit summary test report, generated from LOGFILES." + (let ((report (file-name-with-extension + (getenv "EMACS_TEST_JUNIT_REPORT") "xml")) + (tests 0) (failures 0) (skipped 0) (time 0) (id 0)) + (with-temp-file report + (dolist (logfile logfiles) + (let ((test-file (file-name-with-extension logfile "xml"))) + (when (file-readable-p test-file) + (insert-file-contents-literally test-file) + (when (looking-at-p + (regexp-quote "")) + (delete-region (point) (line-beginning-position 2))) + (when (looking-at + "") + (cl-incf tests (string-to-number (match-string 1))) + (cl-incf failures (string-to-number (match-string 2))) + (cl-incf skipped (string-to-number (match-string 3))) + (cl-incf time (string-to-number (match-string 4))) + (delete-region (point) (line-beginning-position 2))) + (when (looking-at " ") + (delete-region (point) (line-beginning-position 2))) + (narrow-to-region (point-max) (point-max))))) + + (insert "\n") + (widen) + (goto-char (point-min)) + (insert "\n") + (insert (format "\n" + (file-name-nondirectory report) + tests failures skipped time))))) (defun ert-summarize-tests-batch-and-exit (&optional high) "Summarize the results of testing. @@ -1540,6 +1664,8 @@ If HIGH is a natural number, the HIGH long lasting tests are summarized." ;; behavior. (setq attempt-stack-overflow-recovery nil attempt-orderly-shutdown-on-fatal-signal nil) + (when (getenv "EMACS_TEST_JUNIT_REPORT") + (apply #'ert-write-junit-test-summary-report command-line-args-left)) (let ((nlogs (length command-line-args-left)) (ntests 0) (nrun 0) (nexpected 0) (nunexpected 0) (nskipped 0) nnotrun logfile notests badtests unexpected skipped tests) @@ -1855,7 +1981,6 @@ Also sets `ert--results-progress-bar-button-begin'." ;; should test it again.) "\n"))) - (defvar ert-test-run-redisplay-interval-secs .1 "How many seconds ERT should wait between redisplays while running tests. @@ -2037,7 +2162,6 @@ STATS is the stats object; LISTENER is the results listener." (goto-char (1- (point-max))) buffer))))) - (defvar ert--selector-history nil "List of recent test selectors read from terminal.") diff --git a/test/Makefile.in b/test/Makefile.in index f2c49584e7..eeda2918fa 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -353,6 +353,7 @@ mostlyclean: clean: find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE) + find . '(' -name '*.xml' -a ! -path '*resources*' ')' $(FIND_DELETE) rm -f ${srcdir}/lisp/gnus/mml-sec-resources/random_seed rm -f $(test_module_dir)/*.o $(test_module_dir)/*.so \ $(test_module_dir)/*.dll diff --git a/test/README b/test/README index 4d447c9bf1..2bd84b5f9b 100644 --- a/test/README +++ b/test/README @@ -114,6 +114,9 @@ mode--only the names of the failed tests are listed. If the $EMACS_TEST_VERBOSE environment variable is set, the failure summaries will also include the data from the failing test. +If the $EMACS_TEST_JUNIT_REPORT environment variable is set to a file +name, a JUnit test report is generated under this name. + Some of the tests require a remote temporary directory (autorevert-tests.el, filenotify-tests.el, shadowfile-tests.el and tramp-tests.el). Per default, a mock-up connection method is used diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index fd11d36798..e4f99743e0 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -93,10 +93,8 @@ all: generate-test-jobs .PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) -generate-test-jobs: clean $(FILE) $(SUBDIR_TARGETS) +generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) $(FILE): $(AM_V_GEN) - -clean: - @rm -f $(FILE) + @echo "# Generated by \"make generate-test-jobs\", don't edit." >$(FILE) diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index b0ea6813b3..3903642c79 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -44,6 +44,7 @@ workflow: variables: GIT_STRATEGY: fetch EMACS_EMBA_CI: 1 + EMACS_TEST_JUNIT_REPORT: junit-test-report.xml EMACS_TEST_TIMEOUT: 3600 EMACS_TEST_VERBOSE: 1 # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled @@ -85,7 +86,7 @@ default: # TODO: with make -j4 several of the tests were failing, for # example shadowfile-tests, but passed without it. - 'export PWD=$(pwd)' - - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"' + - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"' after_script: # - docker ps -a # - printenv @@ -93,7 +94,8 @@ default: # Prepare test artifacts. - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name} - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} - - find ${test_name} ! -name "*.log" -type f -delete + - find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete + # BusyBox find does not know -empty. - find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null .build-template: @@ -103,7 +105,6 @@ default: when: always - changes: - "**.in" - - "**.yml" - GNUmakefile - aclocal.m4 - autogen.sh @@ -112,7 +113,7 @@ default: - lib/malloc/*.{h,c} - lisp/emacs-lisp/*.el - src/*.{h,c} - - test/infra/Dockerfile.emba + - test/infra/* - changes: # gfilemonitor, kqueue - src/gfilenotify.c @@ -133,9 +134,11 @@ default: name: ${test_name} public: true expire_in: 1 week + when: always paths: - ${test_name}/ - when: always + reports: + junit: ${test_name}/${EMACS_TEST_JUNIT_REPORT} .gnustep-template: rules: @@ -143,12 +146,11 @@ default: - if: '$CI_PIPELINE_SOURCE == "schedule"' changes: - "**.in" - - "**.yml" - src/ns*.{h,m} - src/macfont.{h,m} - lisp/term/ns-win.el - nextstep/** - - test/infra/Dockerfile.emba + - test/infra/* .filenotify-gio-template: rules: @@ -156,12 +158,11 @@ default: - if: '$CI_PIPELINE_SOURCE == "schedule"' changes: - "**.in" - - "**.yml" - lisp/autorevert.el - lisp/filenotify.el - lisp/net/tramp-sh.el - src/gfilenotify.c - - test/infra/Dockerfile.emba + - test/infra/* - test/lisp/autorevert-tests.el - test/lisp/filenotify-tests.el @@ -171,11 +172,10 @@ default: - if: '$CI_PIPELINE_SOURCE == "schedule"' changes: - "**.in" - - "**.yml" - lisp/emacs-lisp/comp.el - lisp/emacs-lisp/comp-cstr.el - src/comp.{h,m} - - test/infra/Dockerfile.emba + - test/infra/* - test/src/comp-resources/*.el - test/src/comp-tests.el timeout: 8 hours diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index bad8575b5c..63b052bf8c 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -1,3 +1,4 @@ +# Generated by "make generate-test-jobs", don't edit. test-lib-src-inotify: stage: normal commit c1476afb99fbba316832c12e584a633684966c09 Author: Stefan Kangas Date: Mon Dec 13 15:57:54 2021 +0100 Make alias obsolete in xscheme.el * lisp/progmodes/xscheme.el (xscheme-yank-previous-send): Make obsolete. diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 26ffe33b83..e7667ebf51 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -574,9 +574,8 @@ See also the commands \\[xscheme-yank-pop] and \\[xscheme-yank-push]." (if (consp arg) (exchange-point-and-mark))) -;; Old name, to avoid errors in users' init files. -(fset 'xscheme-yank-previous-send - 'xscheme-yank) +(define-obsolete-function-alias 'xscheme-yank-previous-send + #'xscheme-yank "29.1") (defun xscheme-yank-pop (arg) "Insert or replace a just-yanked expression with an older expression. commit 7c4c72fa52aa80a5c399a4374ff1766377d1fd47 Author: Stefan Kangas Date: Mon Dec 13 15:57:04 2021 +0100 Make two aliases obsolete in lisp/international/robin.el * lisp/international/robin.el (robin-transliterate-region) (robin-transliterate-buffer): Make obsolete. diff --git a/lisp/international/robin.el b/lisp/international/robin.el index c38cd82269..4c498d7f92 100644 --- a/lisp/international/robin.el +++ b/lisp/international/robin.el @@ -529,10 +529,10 @@ Use the longest match method to select a rule." (insert (cadr tree)) (delete-char (- end begin))))) -;; for backward compatibility - -(fset 'robin-transliterate-region 'robin-convert-region) -(fset 'robin-transliterate-buffer 'robin-convert-buffer) +(define-obsolete-function-alias 'robin-transliterate-region + #'robin-convert-region "29.1") +(define-obsolete-function-alias 'robin-transliterate-buffer + #'robin-convert-buffer "29.1") ;;; Reverse conversion commit 0c24ccc9d8e8f9740040ce433635e8d67e77d7f0 Author: Stefan Monnier Date: Mon Dec 13 09:31:49 2021 -0500 * lisp/emacs-lisp/generator.el (iter-yield): Simplify diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index cb0241017a..ac1412704b 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -143,8 +143,7 @@ the CPS state machinery." (setf ,static-var ,dynamic-var))))) (defmacro cps--with-dynamic-binding (dynamic-var static-var &rest body) - "Evaluate BODY such that generated atomic evaluations run with -DYNAMIC-VAR bound to STATIC-VAR." + "Run BODY's atomic evaluations run with DYNAMIC-VAR bound to STATIC-VAR." (declare (indent 2)) `(cps--with-value-wrapper (cps--make-dynamic-binding-wrapper ,dynamic-var ,static-var) @@ -645,12 +644,11 @@ modified copy." (iter-close iterator))))) iterator)))) -(defun iter-yield (value) +(defun iter-yield (_value) "When used inside a generator, yield control to caller. The caller of `iter-next' receives VALUE, and the next call to `iter-next' resumes execution with the form immediately following this `iter-yield' call." - (identity value) (error "`iter-yield' used outside a generator")) (defmacro iter-yield-from (value) commit c952f8b059611739cd8f79151cc7ba7f71d7c95a Author: Stefan Monnier Date: Mon Dec 13 09:29:42 2021 -0500 lisp/pcomplete.el: Mark obsolete some unused functions * lisp/pcomplete.el (pcomplete-match-beginning, pcomplete-match-end): Mark as obsolete. (pcomplete-opt, pcomplete--here, pcomplete--help): Use lexical-binding. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 64acc416c2..1636e21882 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -680,8 +680,8 @@ user actually typed in." (match-string which arg) (throw 'pcompleted nil)))) -(defalias 'pcomplete-match-beginning 'match-beginning) -(defalias 'pcomplete-match-end 'match-end) +(define-obsolete-function-alias 'pcomplete-match-beginning #'match-beginning "29.1") +(define-obsolete-function-alias 'pcomplete-match-end #'match-end "29.1") (defsubst pcomplete--test (pred arg) "Perform a programmable completion predicate match." @@ -1006,7 +1006,7 @@ Arguments NO-GANGING and ARGS-FOLLOW are currently ignored." ((eq arg-char ?*) (pcomplete-executables)) ((eq arg-char ??) nil) ((eq arg-char ?.) (pcomplete-entries)) - ((eq arg-char ?\() (eval result)))))) + ((eq arg-char ?\() (eval result t)))))) (setq index (1+ index)))))))) (defun pcomplete--here (&optional form stub paring form-only) @@ -1040,7 +1040,7 @@ See the documentation for `pcomplete-here'." (funcall form) ;; Old calling convention, might still be used by files ;; byte-compiled with the older code. - (eval form))))) + (eval form t))))) (defmacro pcomplete-here* (&optional form stub form-only) @@ -1062,9 +1062,9 @@ See the documentation for `pcomplete-here'." pcomplete-window-restore-timer nil)) (define-obsolete-function-alias 'pcomplete-event-matches-key-specifier-p - 'eq "27.1") + #'eq "27.1") -(define-obsolete-function-alias 'pcomplete-read-event 'read-event "27.1") +(define-obsolete-function-alias 'pcomplete-read-event #'read-event "27.1") (defun pcomplete-show-completions (completions) "List in help buffer sorted COMPLETIONS. @@ -1244,7 +1244,7 @@ If specific documentation can't be given, be generic." (fboundp 'Info-goto-node)) (listp pcomplete-help))) (if (listp pcomplete-help) - (message "%s" (eval pcomplete-help)) + (message "%s" (eval pcomplete-help t)) (save-window-excursion (info)) (declare-function Info-goto-node "info" (nodename &optional fork strict-case)) commit 6170c5036e3802914723a288ef3191b58ef4a42d Author: Eli Zaretskii Date: Mon Dec 13 15:51:38 2021 +0200 Fix regression in help-mode prompt * lisp/help-macro.el (make-help-screen): Restore SPC and DEL in prompt. Reported by Colin Baxter . diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 1fa9d82afd..b3c7e2393a 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -165,14 +165,18 @@ and then returns." (let ((cursor-in-echo-area t) (overriding-local-map local-map)) (setq key (read-key-sequence - (format "Type one of the options listed%s: " + (format "Type one of listed options%s: " (if (pos-visible-in-window-p (point-max)) "" (concat ", or " (help--key-description-fontified (kbd "")) - " or " + "/" (help--key-description-fontified (kbd "")) + "/" + (help--key-description-fontified (kbd "SPC")) + "/" + (help--key-description-fontified (kbd "DEL")) " to scroll")))) char (aref key 0))) commit 57efc5d1bb60f6abb4766387b708e20532638135 Author: Eli Zaretskii Date: Mon Dec 13 15:35:31 2021 +0200 * src/sqlite.c (Fsqlite_open, Fsqlite_load_extension): Use ENCODE_FILE. diff --git a/src/sqlite.c b/src/sqlite.c index 4968ce3f69..248ad478d5 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -247,7 +247,7 @@ If FILE is nil, an in-memory database will be opened instead. */) if (!NILP (file)) { CHECK_STRING (file); - file = encode_string (Fexpand_file_name (file, Qnil)); + file = ENCODE_FILE (Fexpand_file_name (file, Qnil)); name = xstrdup (SSDATA (file)); } else @@ -596,7 +596,7 @@ system-dependent file-name extension. */) { check_sqlite (db, false); CHECK_STRING (module); - Lisp_Object module_encoded = encode_string (Fexpand_file_name (module, Qnil)); + Lisp_Object module_encoded = ENCODE_FILE (Fexpand_file_name (module, Qnil)); sqlite3 *sdb = XSQLITE (db)->db; int result = sqlite3_load_extension (sdb, SSDATA (module_encoded), commit 38f782f48df3a35c2735707892610325a5cba92d Author: Stefan Kangas Date: Mon Dec 13 14:14:19 2021 +0100 * lisp/ielm.el (ielm-map): Use defvar-keymap. diff --git a/lisp/ielm.el b/lisp/ielm.el index 0ddd83f100..ec7f010a4d 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -154,24 +154,22 @@ This variable is buffer-local.") "Message to display when IELM is started.") (defvaralias 'inferior-emacs-lisp-mode-map 'ielm-map) -(defvar ielm-map - (let ((map (make-sparse-keymap))) - (define-key map "\t" 'ielm-tab) - (define-key map "\C-m" 'ielm-return) - (define-key map "\e\C-m" 'ielm-return-for-effect) - (define-key map "\C-j" 'ielm-send-input) - (define-key map "\e\C-x" 'eval-defun) ; for consistency with - (define-key map "\e\t" 'completion-at-point) ; lisp-interaction-mode - ;; These bindings are from `lisp-mode-shared-map' -- can you inherit - ;; from more than one keymap?? - (define-key map "\e\C-q" 'indent-sexp) - (define-key map "\177" 'backward-delete-char-untabify) - ;; Some convenience bindings for setting the working buffer - (define-key map "\C-c\C-b" 'ielm-change-working-buffer) - (define-key map "\C-c\C-f" 'ielm-display-working-buffer) - (define-key map "\C-c\C-v" 'ielm-print-working-buffer) - map) - "Keymap for IELM mode.") +(defvar-keymap ielm-map + :doc "Keymap for IELM mode." + "TAB" #'ielm-tab + "RET" #'ielm-return + "M-RET" #'ielm-return-for-effect + "C-j" #'ielm-send-input + "C-M-x" #'eval-defun ; for consistency with + "M-TAB" #'completion-at-point ; lisp-interaction-mode + ;; These bindings are from `lisp-mode-shared-map' -- can you inherit + ;; from more than one keymap?? + "C-M-q" #'indent-sexp + "DEL" #'backward-delete-char-untabify + ;; Some convenience bindings for setting the working buffer + "C-c C-b" #'ielm-change-working-buffer + "C-c C-f" #'ielm-display-working-buffer + "C-c C-v" #'ielm-print-working-buffer) (easy-menu-define ielm-menu ielm-map "IELM mode menu." commit 3a773cbbf56509b18e3138c47509622d533abf37 Author: Stefan Kangas Date: Mon Dec 13 02:54:32 2021 +0100 * lisp/ielm.el (ielm-header): Show key binding for describe-mode. diff --git a/lisp/ielm.el b/lisp/ielm.el index 39820a893a..0ddd83f100 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -148,7 +148,9 @@ such as `edebug-defun' to work with such inputs." This variable is buffer-local.") (defvar ielm-header - "*** Welcome to IELM *** Type (describe-mode) for help.\n" + (substitute-command-keys + "*** Welcome to IELM *** Type (describe-mode) or press \ +\\[describe-mode] for help.\n") "Message to display when IELM is started.") (defvaralias 'inferior-emacs-lisp-mode-map 'ielm-map)