commit 90dca0a533707813b925bc6f9987ccf8e5318985 (HEAD, refs/remotes/origin/master) Merge: e11813d574d 6de00e4df99 Author: Stefan Kangas Date: Thu Mar 23 06:30:13 2023 +0100 Merge from origin/emacs-29 6de00e4df99 ; Fix xref-match's :version since the default value did c... db355b420b6 Use libgccjit-10-dev on EMBA 84963956535 * lisp/outline.el (outline--fix-buttons-after-change): Ad... 3d3bbaace69 Align concatenated strings to the first sibling in c-ts-mode f856468e457 Only fill the current paragraph in c-ts-common--fill-bloc... df669c5a11f Add missing indent rule for c-ts-mode commit 6de00e4df99e3b4803b2c60c4981d13e30dbf3ff (refs/remotes/origin/emacs-29) Author: Dmitry Gutov Date: Wed Mar 22 18:16:50 2023 +0200 ; Fix xref-match's :version since the default value did change diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ee4253960c5..1ae60796601 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -636,7 +636,7 @@ xref-line-number (defface xref-match '((t :inherit match)) "Face used to highlight matches in the xref buffer." - :version "27.1") + :version "28.1") (defmacro xref--with-dedicated-window (&rest body) `(let* ((xref-w (get-buffer-window xref-buffer-name)) commit e11813d574db1297a9b33ec2a4cba4dc3c6a16af Author: Sean Whitton Date: Wed Mar 22 10:28:05 2023 -0700 Make icomplete-tidy-shadowed-file-names into a defcustom lisp/icomplete.el (icomplete-tidy-shadowed-file-names): Make variable into a defcustom. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 49c0c78fe73..6ed2cbe395c 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -69,11 +69,12 @@ icomplete-hide-common-prefix :type 'boolean :version "24.4") -(defvar icomplete-tidy-shadowed-file-names nil +(defcustom icomplete-tidy-shadowed-file-names nil "If non-nil, automatically delete superfluous parts of file names. For example, if the user types ~/ after a long path name, everything preceding the ~/ is discarded so the interactive -selection process starts again from the user's $HOME.") +selection process starts again from the user's $HOME." + :type 'boolean) (defcustom icomplete-show-matches-on-no-input nil "When non-nil, show completions when first prompting for input. commit c5f369bacc414fce6a1ed17733188f4c1cdfe317 Author: Felician Nemeth Date: Wed Mar 22 18:34:03 2023 +0000 Subject: send clientInfo during the initialize request 'clientInfo' arrived in LSP 3.15.0. LSP clients can use clientInfo to identify themselves in the initialize request. This is generally useful for various debugging tasks. * lisp/progmodes/eglot.el (eglot--connect): Send clientInfo. Author: diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d21294276ad..29883aa9602 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1313,6 +1313,7 @@ eglot--connect (eq (jsonrpc-process-type server) 'network)) (emacs-pid)) + :clientInfo '(:name "Eglot") ;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py' ;; into `/path/to/baz.py', so LSP groks it. :rootPath (file-local-name commit db355b420b6d6bd3280d40f8d2b26915a7f72e02 Author: Michael Albinus Date: Wed Mar 22 18:34:23 2023 +0100 Use libgccjit-10-dev on EMBA * test/infra/Dockerfile.emba (emacs-native-comp): Use libgccjit-10-dev. (Bug#62211) * test/infra/gitlab-ci.yml (build-native-comp-speed2) (test-native-comp-speed2): Uncomment jobs. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 872591333e6..d4d80d3c751 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -75,9 +75,10 @@ RUN make bootstrap FROM emacs-base as emacs-native-comp +# The libgccjit version must correspond to the gcc version. RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ - libgccjit-6-dev \ + libgccjit-10-dev \ && rm -rf /var/lib/apt/lists/* FROM emacs-native-comp as emacs-native-comp-speed0 diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 4e11b1337b5..41778321773 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -263,23 +263,21 @@ test-filenotify-gio: # variables: # target: emacs-native-comp-speed1 -# The next two jobs are commented out due to bug#62211. - -# build-native-comp-speed2: -# stage: native-comp-images -# extends: [.job-template, .build-template, .native-comp-template] -# variables: -# target: emacs-native-comp-speed2 +build-native-comp-speed2: + stage: native-comp-images + extends: [.job-template, .build-template, .native-comp-template] + variables: + target: emacs-native-comp-speed2 -# test-native-comp-speed2: -# stage: native-comp -# extends: [.job-template, .test-template, .native-comp-template] -# needs: -# - job: build-native-comp-speed2 -# optional: true -# variables: -# target: emacs-native-comp-speed2 -# make_params: "-k -C test check SELECTOR='(not (tag :unstable))'" +test-native-comp-speed2: + stage: native-comp + extends: [.job-template, .test-template, .native-comp-template] + needs: + - job: build-native-comp-speed2 + optional: true + variables: + target: emacs-native-comp-speed2 + make_params: "-k -C test check SELECTOR='(not (tag :unstable))'" # Local Variables: # add-log-current-defun-header-regexp: "^\\([-_.[:alnum:]]+\\)[ \t]*:" commit e340354299421a1a0773e6443f7901964b5d7c6d Author: Eli Zaretskii Date: Wed Mar 22 17:26:22 2023 +0200 Fix compilation of lib-src/movemail * lib-src/movemail.c: Include timespec.h. Reported by Andreas Schwab . diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 972ab7156fa..a71be8c2099 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -62,6 +62,7 @@ Copyright (C) 1986, 1992-1994, 1996, 1999, 2001-2023 Free Software #include #include #include +#include #include #include commit 5fbda320fc17c539a054c4d48d976a10a2b3a9e6 Author: Michael Albinus Date: Wed Mar 22 15:00:15 2023 +0100 Add platform for Eglot tests on EMBA * test/infra/Dockerfile.emba (emacs-eglot): New image. * test/infra/gitlab-ci.yml (.eglot-template): New template. (build-image-eglot, test-eglot): New jobs. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 872591333e6..7451c727624 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -60,6 +60,17 @@ RUN ./autogen.sh autoconf RUN ./configure --with-file-notification=gfile RUN make bootstrap +FROM emacs-base as emacs-eglot + +# We install a recent clangd for Eglot tests. +RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + +COPY . /checkout +WORKDIR /checkout +RUN ./autogen.sh autoconf +RUN ./configure +RUN make bootstrap + FROM emacs-base as emacs-gnustep RUN apt-get update && \ diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 4e11b1337b5..b2d52117ba4 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -166,6 +166,16 @@ default: - test/lisp/autorevert-tests.el - test/lisp/filenotify-tests.el +.eglot-template: + rules: + - if: '$CI_PIPELINE_SOURCE == "web"' + - if: '$CI_PIPELINE_SOURCE == "schedule"' + changes: + - "**.in" + - lisp/progmodes/eglot.el + - test/infra/* + - test/lisp/progmodes/eglot-tests.el + .native-comp-template: rules: - if: '$CI_PIPELINE_SOURCE == "web"' @@ -229,6 +239,23 @@ test-filenotify-gio: # This is needed in order to get a JUnit test report. make_params: '-k -C test check-expensive LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log"' +build-image-eglot: + stage: platform-images + extends: [.job-template, .build-template, .eglot-template] + variables: + target: emacs-eglot + +test-eglot: + stage: platforms + extends: [.job-template, .test-template, .eglot-template] + needs: + - job: build-image-eglot + optional: true + variables: + target: emacs-eglot + # This is needed in order to get a JUnit test report. + make_params: '-k -C test check-expensive LOGFILES="lisp/progmodes/eglot-tests.log"' + # The next two jobs are commented out due to bug#62210. # build-image-gnustep: commit 103ebbf92f375cc6f44a2b49c85fbe3a6b1704d4 Author: Robert Pluim Date: Wed Mar 22 12:46:11 2023 +0100 Make eglot--clangd-version more robust * test/lisp/progmodes/eglot-tests.el (eglot--clangd-version): Check for 'version ' followed by a combination of numbers and dots to extract the clangd version. diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index c4b23bfd64e..71d9d7270dd 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -316,9 +316,10 @@ eglot--simulate-key-event (defun eglot--clangd-version () "Report on the clangd version used in various tests." - (replace-regexp-in-string - ".*version[[:space:]]+\\(.*\\)" "\\1" - (car (split-string (shell-command-to-string "clangd --version") "\n")))) + (let ((version (shell-command-to-string "clangd --version"))) + (when (string-match "version[[:space:]]+\\([0-9.]*\\)" + version) + (match-string 1 version)))) ;;; Unit tests commit 84963956535e9eff38b0d7638ce751039eb44bc2 Author: Juri Linkov Date: Wed Mar 22 09:44:02 2023 +0200 * lisp/outline.el (outline--fix-buttons-after-change): Add save-match-data. It's important for a hook in after-change-functions not to change match-data. Otherwise it breaks functions that make changes in the buffer, such as for example, successive calls to delete-region in smerge-keep-n, etc. diff --git a/lisp/outline.el b/lisp/outline.el index a89985d1990..0e90c59c285 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1877,7 +1877,7 @@ outline--fix-buttons-after-change (save-excursion (goto-char beg) (setq beg (pos-bol))) (save-excursion (goto-char end) (setq end (pos-eol))) (remove-overlays beg end 'outline-button t) - (outline--fix-up-all-buttons beg end)) + (save-match-data (outline--fix-up-all-buttons beg end))) (defvar-keymap outline-navigation-repeat-map commit 3d3bbaace692384a895ec55ff7e5a91ad66463bb Author: Yuan Fu Date: Tue Mar 21 23:27:20 2023 -0700 Align concatenated strings to the first sibling in c-ts-mode * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Change rule. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index f70869c10bb..e2705462025 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -386,7 +386,7 @@ c-ts-mode--indent-styles ((parent-is "function_definition") parent-bol 0) ((parent-is "conditional_expression") first-sibling 0) ((parent-is "assignment_expression") parent-bol c-ts-mode-indent-offset) - ((parent-is "concatenated_string") parent-bol c-ts-mode-indent-offset) + ((parent-is "concatenated_string") first-sibling 0) ((parent-is "comma_expression") first-sibling 0) ((parent-is "init_declarator") parent-bol c-ts-mode-indent-offset) ((parent-is "parenthesized_expression") first-sibling 1) commit f856468e457b76254fa3706a5ec1c8c1d4b49da3 Author: Yuan Fu Date: Tue Mar 21 22:50:03 2023 -0700 Only fill the current paragraph in c-ts-common--fill-block-comment * lisp/progmodes/c-ts-common.el: (c-ts-common--fill-block-comment): Shrink the filled region to the paragraph at point. diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index 85db39aaeae..e0a7c46508e 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el @@ -156,10 +156,12 @@ c-ts-common--fill-block-comment (goto-char (match-beginning 1)) (move-marker start-marker (point)) (replace-match " " nil nil nil 1)) + ;; Include whitespaces before /*. (goto-char start) (beginning-of-line) (setq start (point)) + ;; Mask spaces before "*/" if it is attached at the end ;; of a sentence rather than on its own line. (goto-char end) @@ -172,6 +174,7 @@ c-ts-common--fill-block-comment (setq end-len (- (match-end 1) (match-beginning 1))) (replace-match (make-string end-len ?x) nil nil nil 1)) + ;; If "*/" is on its own line, don't included it in the ;; filling region. (when (not end-marker) @@ -180,13 +183,21 @@ c-ts-common--fill-block-comment (backward-char 2) (skip-syntax-backward "-") (setq end (point)))) + ;; Let `fill-paragraph' do its thing. (goto-char orig-point) (narrow-to-region start end) - ;; We don't want to fill the region between START and - ;; START-MARKER, otherwise the filling function might delete - ;; some spaces there. - (fill-region start-marker end arg) + (let (para-start para-end) + (forward-paragraph 1) + (setq para-end (point)) + (forward-paragraph -1) + (setq para-start (point)) + ;; We don't want to fill the region between START and + ;; START-MARKER, otherwise the filling function might delete + ;; some spaces there. Also, we only fill the current + ;; paragraph. + (fill-region (max start-marker para-start) (min end para-end) arg)) + ;; Unmask. (when start-marker (goto-char start-marker) commit 2d0de863618fd0341a5a781c26bf774e304ffd45 Merge: 5904bdf5819 8b6a0de964d Author: Stefan Kangas Date: Wed Mar 22 06:30:12 2023 +0100 Merge from origin/emacs-29 8b6a0de964d Improve docstring of treesit-parent-while (bug#62301) 35648a86730 ; Delete accidental leftover '()' Eglot function 47d8e4b0d38 Eglot: report window/workDoneProgress capability to langu... 4a7a0c9a9f5 * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Impr... 4a6eefb93a5 Expand defvar-keymap documentation 7a1272168af * lisp/treesit.el (treesit-end-of-defun): Guard arg again... 263d6c38539 Comp fix calls to redefined primtives with op-bytecode (b... 6bf441ff115 Warn package authors away from keymap-unset with REMOVE 786de66ec3c Comment out jobs on EMBA eed240bc022 Improve defvar-keymap docstring. commit 5904bdf581974cb8bf88534bbc58b13cca797303 Author: Stefan Monnier Date: Tue Mar 21 21:48:24 2023 -0400 (describe-function): Load file for `...' references To fix bug#62300, we do the same for `...' as we already did for \[...] * help-fns.el (describe-function-1): Look for `...' references in addition to key substitution markup. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 50e60b68e17..6dbdb565b1b 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1138,7 +1138,7 @@ describe-function-1 ;; key substitution constructs, load the library. (and (autoloadp real-def) doc-raw help-enable-autoload - (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw) + (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]\\|`.*'" doc-raw) (autoload-do-load real-def)) (help-fns--key-bindings function) commit df669c5a11f6667de52b0467cda815a5a6e6035d Author: Yuan Fu Date: Tue Mar 21 16:24:29 2023 -0700 Add missing indent rule for c-ts-mode * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule for case. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 659db46dc12..f70869c10bb 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -434,6 +434,8 @@ c-ts-mode--indent-styles ((parent-is "while_statement") standalone-parent c-ts-mode-indent-offset) ((parent-is "do_statement") standalone-parent c-ts-mode-indent-offset) + ((parent-is "case_statement") standalone-parent c-ts-mode-indent-offset) + ,@(when (eq mode 'cpp) `(((node-is "field_initializer_list") parent-bol ,(* c-ts-mode-indent-offset 2))))))) `((gnu diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 9e28ef203fd..5cdefe2122c 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -188,6 +188,36 @@ int main() } =-=-= +Name: Switch-Case statement + +=-= +int main() { +switch (a) { +case 1: +b = c; +return 10; +case 2: +{ +a = b; +return 12 +} +} +} +=-= +int main() { + switch (a) { + case 1: + b = c; + return 10; + case 2: + { + a = b; + return 12 + } + } +} +=-=-= + Name: Multiline Block Comments 1 (bug#60270) =-= commit 8b6a0de964d61cb8d57ed3fe65086fa305a3c53e Author: Yuan Fu Date: Tue Mar 21 14:50:07 2023 -0700 Improve docstring of treesit-parent-while (bug#62301) * doc/lispref/parsing.texi (Retrieving Nodes): Improve and fix docstring for treesit-parent-until and treesit-parent-while. * lisp/treesit.el (treesit-parent-while): Improve docstring. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index fd65fa3e75b..cba323d3a56 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -859,18 +859,24 @@ Retrieving Nodes nodes. @end defun -@defun treesit-parent-until node predicate +@defun treesit-parent-until node predicate &optional include-node This function repeatedly finds the parents of @var{node}, and returns -the parent that satisfies @var{predicate}, a function that takes a -node as the argument. If no parent satisfies @var{predicate}, this -function returns @code{nil}. +the parent that satisfies @var{pred}, a function that takes a node as +the argument and returns a boolean that indicates a match. If no +parent satisfies @var{pred}, this function returns @code{nil}. + +Normally this function only looks at the parents of @var{node} but not +@var{node} itself. But if @var{include-node} is non-@var{nil}, this +function returns @var{node} if @var{node} satisfies @var{pred}. @end defun -@defun treesit-parent-while node predicate -This function repeatedly finds the parent of @var{node}, and keeps -doing so as long as the nodes satisfy @var{predicate}, a function that +@defun treesit-parent-while node pred +This function goes up the tree starting from @var{node}, and keeps +doing so as long as the nodes satisfy @var{pred}, a function that takes a node as the argument. That is, this function returns the -farthest parent that still satisfies @var{predicate}. +highest parent of @var{node} that still satisfies @var{pred}. Note +that if @var{node} satisfies @var{pred} but its immediate parent +doesn't, @var{node} itself is returned. @end defun @defun treesit-node-top-level node &optional type diff --git a/lisp/treesit.el b/lisp/treesit.el index b271a1f0c4b..e718ea1a23a 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -324,13 +324,13 @@ treesit-parent-until node)) (defun treesit-parent-while (node pred) - "Return the furthest parent of NODE that satisfies PRED. + "Return the furthest parent of NODE (including NODE) that satisfies PRED. -This function successively examines the parent of NODE, then -the parent of the parent, etc., until it finds an ancestor node -which no longer satisfies the predicate PRED; it returns the last -examined ancestor that satisfies PRED. It returns nil if no -ancestor node was found that satisfies PRED. +This function successively examines NODE, the parent of NODE, +then the parent of the parent, etc., until it finds a node which +no longer satisfies the predicate PRED; it returns the last +examined node that satisfies PRED. If no node satisfies PRED, it +returns nil. PRED should be a function that takes one argument, the node to examine, and returns a boolean value indicating whether that commit 640fd9b594fa376e6493efbe0cf083e1270ddd3f Author: Paul Eggert Date: Tue Mar 21 14:38:23 2023 -0700 Sleep less in update-game-score This is mostly to avoid interface hassles with time/srand/rand. * lib-src/update-game-score.c (main): Don’t use ‘srand’ or ‘time’. (lock_file): Don’t sleep if we unlocked the lock file. When sleeping, always just sleep 1 s. This avoids the need for calling ‘time’ and ‘rand’, the utility of which was dubious anyway. diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 83167f59b8a..4592e14d1d6 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -185,8 +185,6 @@ main (int argc, char **argv) ptrdiff_t scorecount, scorealloc; ptrdiff_t max_scores = MAX_SCORES; - srand (time (0)); - while ((c = getopt (argc, argv, "hrm:d:")) != -1) switch (c) { @@ -485,8 +483,8 @@ lock_file (const char *filename, void **state) return -1; attempts = 0; } - - sleep ((rand () & 1) + 1); + else + sleep (1); } close (fd); commit 2e8cc206f520ec9feb42273703d7afbcb32cd791 Author: Paul Eggert Date: Tue Mar 21 14:06:27 2023 -0700 Avoid backwards clock in movemail timestamps * lib-src/movemail.c (mbx_delimit_begin): Use ‘current_timespec’ instead of ‘time’ to generate the user-visible timestamp. This works around the minor glitch caused by glibc bug 30200 . diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 8119046a916..972ab7156fa 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -846,7 +846,7 @@ movemail_strftime (char *s, size_t size, char const *format, static bool mbx_delimit_begin (FILE *mbf) { - time_t now = time (NULL); + time_t now = current_timespec ().tv_sec; struct tm *ltime = localtime (&now); if (!ltime) return false; commit 4a5ff4d9c6a7d28f18cee7276a3c6febbee0c93e Author: Michael Albinus Date: Tue Mar 21 21:24:13 2023 +0100 Invert variable alias declaration in Tramp * lisp/net/tramp-sh.el (tramp-use-ssh-controlmaster-options): Invert alias declaration. (Bug#62295, Bug#62329) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 24e90447b24..401cec0e28d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -106,6 +106,9 @@ tramp-initial-end-of-output (defconst tramp-end-of-heredoc (md5 tramp-end-of-output) "String used to recognize end of heredoc strings.") +(define-obsolete-variable-alias + 'tramp-use-ssh-controlmaster-options 'tramp-use-connection-share "30.1") + (defcustom tramp-use-connection-share (not (eq system-type 'windows-nt)) "Whether to use connection share in ssh or PuTTY. Set it to t, if you want Tramp to apply respective options. These @@ -122,11 +125,6 @@ tramp-use-connection-share ;; Check with (safe-local-variable-p 'tramp-use-connection-share 'suppress) :safe (lambda (val) (and (memq val '(t nil suppress)) t))) -(defvaralias 'tramp-use-connection-share 'tramp-use-ssh-controlmaster-options) -(make-obsolete-variable - 'tramp-use-ssh-controlmaster-options - "Use `tramp-use-connection-share' instead" "30.1") - (defvar tramp-ssh-controlmaster-options nil "Which ssh Control* arguments to use. commit 0d5036061b544f5a306ccd275502f608ec9d3f25 Author: João Távora Date: Tue Mar 21 18:43:58 2023 +0000 Skip Eglot test if using very old clangd * test/lisp/progmodes/eglot-tests.el (eglot--clangd-version): New helper. (eglot-test-diagnostic-tags-unnecessary-code): Use it. diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 7ac26732737..c4b23bfd64e 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -314,6 +314,12 @@ eglot--simulate-key-event (setq last-command-event char) (call-interactively (key-binding (vector char)))) +(defun eglot--clangd-version () + "Report on the clangd version used in various tests." + (replace-regexp-in-string + ".*version[[:space:]]+\\(.*\\)" "\\1" + (car (split-string (shell-command-to-string "clangd --version") "\n")))) + ;;; Unit tests @@ -452,6 +458,7 @@ eglot-test-basic-diagnostics (ert-deftest eglot-test-diagnostic-tags-unnecessary-code () "Test rendering of diagnostics tagged \"unnecessary\"." (skip-unless (executable-find "clangd")) + (skip-unless (version<= "14" (eglot--clangd-version))) (eglot--with-fixture `(("diag-project" . (("main.cpp" . "int main(){float a = 42.2; return 0;}")))) commit dec09aaeb616e7648f4694d76090cc8e269471e0 Author: Michael Albinus Date: Tue Mar 21 16:14:40 2023 +0100 Improve Tramp backward compatibility * lisp/net/tramp-gvfs.el (while-no-input-ignore-events): Add `dbus-event' for older Emacs versions. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 7323374c607..0d23f5d88d5 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -872,6 +872,14 @@ tramp-gvfs-file-name-handler (tramp-register-foreign-file-name-handler #'tramp-gvfs-file-name-p #'tramp-gvfs-file-name-handler))) +;; Event type `dbus-event' is added to `while-no-input-ignore-events' +;; in Emacs 29.1. If it is missing, some packages like Helm report +;; problems. So we add it here. +(when (and (featurep 'dbusbind) + (not (memq 'dbus-event while-no-input-ignore-events))) + (setq while-no-input-ignore-events + (cons 'dbus-event while-no-input-ignore-events))) + ;; D-Bus helper function. commit 35648a8673010a49720476821732df96ad8fa532 Author: João Távora Date: Tue Mar 21 09:59:13 2023 +0000 ; Delete accidental leftover '()' Eglot function * lisp/progmodes/eglot.el (eglot--workspace-configuration-plist): Remove (). diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 77428c5af07..76f70ead666 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2480,7 +2480,7 @@ eglot--workspace-configuration-plist ;; Set the major mode to be the first of the managed ;; modes. This is the one the user started eglot in. (setq major-mode (car (eglot--major-modes server))) - (hack-dir-local-variables-non-file-buffer)() + (hack-dir-local-variables-non-file-buffer) (if (functionp eglot-workspace-configuration) (funcall eglot-workspace-configuration server) eglot-workspace-configuration)))) commit 47d8e4b0d3835f5e0b0b6ab76f242ef0aa25bda7 Author: João Távora Date: Tue Mar 21 09:56:30 2023 +0000 Eglot: report window/workDoneProgress capability to language server In bug#59149, LSP progress reporting was implemented, but Eglot's 'capabilities' statement to the server wasn't changed to include window/workDoneProgress. * lisp/progmodes/eglot.el (eglot-client-capabilities): Actually report workDoneProgress. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 7a076c134fc..77428c5af07 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -819,6 +819,7 @@ eglot-client-capabilities `(:valueSet [,@(mapcar #'car eglot--tag-faces)]))) + :window `(:workDoneProgress t) :general (list :positionEncodings ["utf-32" "utf-8" "utf-16"]) :experimental eglot--{}))) commit 4a7a0c9a9f521b04b23580901e9c0a662b504e32 Author: Andrea Corallo Date: Tue Mar 21 11:51:03 2023 +0100 * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Improve 263d6c38539 diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index febca8df19c..3dcbc2cca4d 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1773,7 +1773,7 @@ comp-emit-set-call-subr (maxarg (cdr arity))) (when (eq maxarg 'unevalled) (signal 'native-ice (list "subr contains unevalled args" subr-name))) - (if (not (subrp subr-name)) + (if (not (subr-primitive-p subr-name)) ;; The primitive got redefined before the compiler is ;; invoked! (bug#61917) (comp-emit-set-call `(callref funcall commit 4a6eefb93a5781b08903f27325676cda0a40321c Author: Robert Pluim Date: Tue Mar 21 10:56:07 2023 +0100 Expand defvar-keymap documentation * doc/lispref/keymaps.texi (Creating Keymaps): Describe the :repeat keyword. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 0eea696c612..fdab5075b94 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -451,9 +451,70 @@ Creating Keymaps @lisp (defvar-keymap eww-textarea-map :parent text-mode-map + :doc "Keymap for the eww text area." "RET" #'forward-line "TAB" #'shr-next-link) @end lisp + +@kindex :repeat +@kindex repeat-mode +@cindex repeatable key bindings +Each command in the keymap can be marked as `repeatable', i.e. usable +in @code{repeat-mode}, by putting a @code{repeat-map} property on it, +e.g. + +@lisp +(put 'undo 'repeat-map 'undo-repeat-map) +@end lisp + +where the value of the property is the map to be used by +@code{repeat-mode}. + +To avoid repetitive invocations of @code{put}, @code{defvar-keymap} +also has a @code{:repeat} keyword, which can be used to specify which +commands in the keymap are usable by @code{repeat-mode}. The +following values are available: + +@table @code +@item t +This means all the commands in the keymap are repeatable, and is the +most common usage. + +@item (:enter (commands ...) :exit (commands ...)) +This specifies that the commands in the @code{:enter} list enter +@code{repeat-mode}, and the commands in the @code{:exit} list exit +repeat mode. + +If the @code{:enter} list is empty, then all commands in the map enter +@code{repeat-mode}. Specifying one or more commands in this list is +useful if there is a command which doesn't exist in the map being +defined, but which should have the @code{repeat-map} property. + +If the @code{:exit} list is empty then no commands in the map exit +@code{repeat-mode}. Specifying one ore more commands in this list is +useful if the keymap being defined contains a command that should not +have the @code{repeat-map} property. +@end table + +In order to make e.g.@: @kbd{u} repeat the @code{undo} command, the +following two stanzas are equivalent: + +@lisp +(defvar-keymap undo-repeat-map + "u" #'undo) +(put 'undo 'repeat-map 'undo-repeat-map) +@end lisp + +and + +@lisp +(defvar-keymap undo-repeat-map + :repeat t + "u" #'undo) +@end lisp + +The latter is preferred when there are many commands in the map, all +of which should be repeatable. @end defmac @defun copy-keymap keymap commit 7a1272168af1a5b82979efa29451147c5d867981 Author: Dmitry Gutov Date: Mon Mar 20 20:18:42 2023 +0200 * lisp/treesit.el (treesit-end-of-defun): Guard arg against nil (bug#62158). diff --git a/lisp/treesit.el b/lisp/treesit.el index c118f5d52a4..b271a1f0c4b 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1882,6 +1882,7 @@ treesit-end-of-defun `treesit-defun-skipper'." (interactive "^p\nd") (let ((orig-point (point))) + (if (or (null arg) (= arg 0)) (setq arg 1)) (catch 'done (dotimes (_ 2) ; Not making progress is better than infloop. commit 263d6c38539691c954f4c3057cbe8d5468499b91 Author: Andrea Corallo Date: Mon Mar 20 17:24:48 2023 +0100 Comp fix calls to redefined primtives with op-bytecode (bug#61917) * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Fix compilation of calls to redefined primtives with dedicated op-bytecode. * test/src/comp-tests.el (61917-1): New test. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 283c00103b5..febca8df19c 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1773,17 +1773,25 @@ comp-emit-set-call-subr (maxarg (cdr arity))) (when (eq maxarg 'unevalled) (signal 'native-ice (list "subr contains unevalled args" subr-name))) - (if (eq maxarg 'many) - ;; callref case. - (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) - ;; Normal call. - (unless (and (>= maxarg nargs) (<= minarg nargs)) - (signal 'native-ice - (list "incoherent stack adjustment" nargs maxarg minarg))) - (let* ((subr-name subr-name) - (slots (cl-loop for i from 0 below maxarg - collect (comp-slot-n (+ i (comp-sp)))))) - (comp-emit-set-call (apply #'comp-call (cons subr-name slots)))))))) + (if (not (subrp subr-name)) + ;; The primitive got redefined before the compiler is + ;; invoked! (bug#61917) + (comp-emit-set-call `(callref funcall + ,(make-comp-mvar :constant subr-name) + ,@(cl-loop repeat nargs + for sp from (comp-sp) + collect (comp-slot-n sp)))) + (if (eq maxarg 'many) + ;; callref case. + (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) + ;; Normal call. + (unless (and (>= maxarg nargs) (<= minarg nargs)) + (signal 'native-ice + (list "incoherent stack adjustment" nargs maxarg minarg))) + (let* ((subr-name subr-name) + (slots (cl-loop for i from 0 below maxarg + collect (comp-slot-n (+ i (comp-sp)))))) + (comp-emit-set-call (apply #'comp-call (cons subr-name slots))))))))) (eval-when-compile (defun comp-op-to-fun (x) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 926ba27e563..1615b2838fc 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -532,6 +532,19 @@ 48029-1 (should (subr-native-elisp-p (symbol-function 'comp-test-48029-nonascii-žžž-f)))) +(comp-deftest 61917-1 () + "Verify we can compile calls to redefined primitives with +dedicated byte-op code." + (let ((f (lambda (fn &rest args) + (apply fn args)))) + (advice-add #'delete-region :around f) + (unwind-protect + (should (subr-native-elisp-p + (native-compile + '(lambda () + (delete-region (point-min) (point-max)))))) + (advice-remove #'delete-region f)))) + ;;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests. ;; commit 6bf441ff11540f2c49cb4f9d506597217cdc73d6 Author: Robert Pluim Date: Mon Mar 20 16:09:51 2023 +0100 Warn package authors away from keymap-unset with REMOVE * doc/lispref/keymaps.texi (Changing Key Bindings): Ask package authors to not use the REMOVE argument to `keymap-unset'. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index c17c8a2dc3f..0eea696c612 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1452,6 +1452,12 @@ Changing Key Bindings to be used. @end defun +Note: using @code{keymap-unset} with @var{remove} non-@code{nil} is +intended for users to put in their init file; Emacs packages should +avoid using it if possible, since they have complete control over +their own keymaps anyway, and they should not be altering other +packages' keymaps. + This example creates a sparse keymap and makes a number of bindings in it: commit 786de66ec3c4cff90cafd0f8a68f9bce027e9947 Author: Michael Albinus Date: Mon Mar 20 10:06:05 2023 +0100 Comment out jobs on EMBA * test/infra/gitlab-ci.yml: Comment out jobs due to bug#62210 and bug#62211. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 1c1452dcda5..4e11b1337b5 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -229,22 +229,27 @@ test-filenotify-gio: # This is needed in order to get a JUnit test report. make_params: '-k -C test check-expensive LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log"' -build-image-gnustep: - stage: platform-images - extends: [.job-template, .build-template, .gnustep-template] - variables: - target: emacs-gnustep +# The next two jobs are commented out due to bug#62210. -test-gnustep: - # This tests the GNUstep build process. - stage: platforms - extends: [.job-template, .gnustep-template] - needs: - - job: build-image-gnustep - optional: true - variables: - target: emacs-gnustep - make_params: install +# build-image-gnustep: +# stage: platform-images +# extends: [.job-template, .build-template, .gnustep-template] +# variables: +# target: emacs-gnustep + +# test-gnustep: +# # This tests the GNUstep build process. +# stage: platforms +# extends: [.job-template, .gnustep-template] +# needs: +# - job: build-image-gnustep +# optional: true +# variables: +# target: emacs-gnustep +# make_params: install + +# The next two jobs are commented out due to high workload on +# emba.gnu.org. # build-native-comp-speed0: # stage: native-comp-images @@ -258,21 +263,23 @@ test-gnustep: # variables: # target: emacs-native-comp-speed1 -build-native-comp-speed2: - stage: native-comp-images - extends: [.job-template, .build-template, .native-comp-template] - variables: - target: emacs-native-comp-speed2 +# The next two jobs are commented out due to bug#62211. -test-native-comp-speed2: - stage: native-comp - extends: [.job-template, .test-template, .native-comp-template] - needs: - - job: build-native-comp-speed2 - optional: true - variables: - target: emacs-native-comp-speed2 - make_params: "-k -C test check SELECTOR='(not (tag :unstable))'" +# build-native-comp-speed2: +# stage: native-comp-images +# extends: [.job-template, .build-template, .native-comp-template] +# variables: +# target: emacs-native-comp-speed2 + +# test-native-comp-speed2: +# stage: native-comp +# extends: [.job-template, .test-template, .native-comp-template] +# needs: +# - job: build-native-comp-speed2 +# optional: true +# variables: +# target: emacs-native-comp-speed2 +# make_params: "-k -C test check SELECTOR='(not (tag :unstable))'" # Local Variables: # add-log-current-defun-header-regexp: "^\\([-_.[:alnum:]]+\\)[ \t]*:" commit eed240bc022cef4ef0f2b12bd2ff116eb6b9581d Author: Robert Pluim Date: Mon Mar 20 09:44:33 2023 +0100 Improve defvar-keymap docstring. * lisp/keymap.el (defvar-keymap): Improve description of ':enter' and ':exit' usage for ':repeat' keyword. diff --git a/lisp/keymap.el b/lisp/keymap.el index 4f02639ffe2..dccc0a3cd31 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -579,14 +579,17 @@ defvar-keymap :repeat (:enter (commands ...) :exit (commands ...)) `:enter' specifies the list of additional commands that only -enter `repeat-mode'. When the list is empty, then by default all -commands in the map enter `repeat-mode'. This is useful when -there is a command that has the `repeat-map' symbol property, but -doesn't exist in this specific map. `:exit' is a list of -commands that exit `repeat-mode'. When the list is empty, no -commands in the map exit `repeat-mode'. This is useful when a -command exists in this specific map, but it doesn't have the -`repeat-map' symbol property on its symbol. +enter `repeat-mode'. When the list is empty, then only the +commands defined in the map enter `repeat-mode'. Specifying a +list of commands is useful when there are commands that have the +`repeat-map' symbol property, but don't exist in this specific +map. + +`:exit' is a list of commands that exit `repeat-mode'. When the +list is empty, no commands in the map exit `repeat-mode'. +Specifying a list of commands is useful when those commands exist +in this specific map, but should not have the `repeat-map' symbol +property. \(fn VARIABLE-NAME &key DOC FULL PARENT SUPPRESS NAME PREFIX KEYMAP REPEAT &rest [KEY DEFINITION]...)" (declare (indent 1))