commit c436d4eff97b3919c9f8cdec504272d6f7ed393f (HEAD, refs/remotes/origin/master) Author: Yuan Fu Date: Mon Oct 7 17:24:32 2024 -0700 Set treesit-primary-parser for tree-sitter modes I debated whether to do this, since technically speaking it's not needed for single-language modes. But ultimately it's better to be explicit and set a good example with builtin modes. * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode): * lisp/progmodes/csharp-mode.el (csharp-ts-mode): * lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode): * lisp/progmodes/go-ts-mode.el (go-ts-mode): (go-mod-ts-mode): * lisp/progmodes/heex-ts-mode.el (heex-ts-mode): * lisp/progmodes/json-ts-mode.el (json-ts-mode): * lisp/progmodes/lua-ts-mode.el (lua-ts-mode): * lisp/progmodes/python.el (python-ts-mode): * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode): * lisp/progmodes/sh-script.el: * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode): (tsx-ts-mode): * lisp/textmodes/css-mode.el (css-ts-mode): * lisp/textmodes/html-ts-mode.el (html-ts-mode): * lisp/textmodes/toml-ts-mode.el (toml-ts-mode): * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): Set treesit-primary-parser. diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index 854adf4ade7..597ef69d9b8 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el @@ -208,7 +208,7 @@ Return nil if there is no name or if NODE is not a defun node." :syntax-table cmake-ts-mode--syntax-table (when (treesit-ready-p 'cmake) - (treesit-parser-create 'cmake) + (setq treesit-primary-parser (treesit-parser-create 'cmake)) ;; Comments. (setq-local comment-start "# ") diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 1f86527191a..b86555b1d87 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -1049,7 +1049,7 @@ Key bindings: (error "Tree-sitter for C# isn't available")) ;; Tree-sitter. - (treesit-parser-create 'c-sharp) + (setq treesit-primary-parser (treesit-parser-create 'c-sharp)) ;; Comments. (c-ts-common-comment-setup) diff --git a/lisp/progmodes/dockerfile-ts-mode.el b/lisp/progmodes/dockerfile-ts-mode.el index e31fd86bbdf..42fa7482a87 100644 --- a/lisp/progmodes/dockerfile-ts-mode.el +++ b/lisp/progmodes/dockerfile-ts-mode.el @@ -133,7 +133,7 @@ Return nil if there is no name or if NODE is not a stage node." :syntax-table dockerfile-ts-mode--syntax-table (when (treesit-ready-p 'dockerfile) - (treesit-parser-create 'dockerfile) + (setq treesit-primary-parser (treesit-parser-create 'dockerfile)) ;; Comments. (setq-local comment-start "# ") diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index cb9a58e33b5..6fa8049e5e7 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -262,7 +262,7 @@ :syntax-table go-ts-mode--syntax-table (when (treesit-ready-p 'go) - (treesit-parser-create 'go) + (setq treesit-primary-parser (treesit-parser-create 'go)) ;; Comments. (setq-local comment-start "// ") @@ -539,7 +539,7 @@ what the parent of the node would be if it were a node." :syntax-table go-mod-ts-mode--syntax-table (when (treesit-ready-p 'gomod) - (treesit-parser-create 'gomod) + (setq treesit-primary-parser (treesit-parser-create 'gomod)) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el index b527d96b579..84fd513525c 100644 --- a/lisp/progmodes/heex-ts-mode.el +++ b/lisp/progmodes/heex-ts-mode.el @@ -148,7 +148,7 @@ With ARG, do it many times. Negative ARG means move backward." :group 'heex-ts (when (treesit-ready-p 'heex) - (treesit-parser-create 'heex) + (setq treesit-primary-parser (treesit-parser-create 'heex)) ;; Comments (setq-local treesit-thing-settings diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 1fb96555010..7409c6be833 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -128,7 +128,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'json) (error "Tree-sitter for JSON isn't available")) - (treesit-parser-create 'json) + (setq treesit-primary-parser (treesit-parser-create 'json)) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index a1dae0628d4..20bc1f3e158 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -750,7 +750,7 @@ Calls REPORT-FN directly." (use-local-map lua-ts-mode-map) (when (treesit-ready-p 'lua) - (treesit-parser-create 'lua) + (setq treesit-primary-parser (treesit-parser-create 'lua)) ;; Comments. (setq-local comment-start "--") diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a75317b3b0e..6d57517cd25 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -7182,7 +7182,7 @@ implementations: `python-mode' and `python-ts-mode'." \\{python-ts-mode-map}" :syntax-table python-mode-syntax-table (when (treesit-ready-p 'python) - (treesit-parser-create 'python) + (setq treesit-primary-parser (treesit-parser-create 'python)) (setq-local treesit-font-lock-feature-list '(( comment definition) ( keyword string type) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index adcdf15c7ad..aff0b8911b9 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1127,7 +1127,7 @@ leading double colon is not added." (unless (treesit-ready-p 'ruby) (error "Tree-sitter for Ruby isn't available")) - (treesit-parser-create 'ruby) + (setq treesit-primary-parser (treesit-parser-create 'ruby)) (setq-local add-log-current-defun-function #'ruby-ts-add-log-current-function) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index b7a52b06b24..e52ea3b125a 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -511,7 +511,7 @@ See `prettify-symbols-compose-predicate'." :syntax-table rust-ts-mode--syntax-table (when (treesit-ready-p 'rust) - (treesit-parser-create 'rust) + (setq treesit-primary-parser (treesit-parser-create 'rust)) ;; Syntax. (setq-local syntax-propertize-function diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index a348e9ba6fd..8ba64100203 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1623,7 +1623,7 @@ not written in Bash or sh." (add-hook 'flymake-diagnostic-functions #'sh-shellcheck-flymake nil t) (add-hook 'hack-local-variables-hook #'sh-after-hack-local-variables nil t) - (treesit-parser-create 'bash) + (setq treesit-primary-parser (treesit-parser-create 'bash)) (setq-local treesit-font-lock-feature-list '(( comment function) ( command declaration-command keyword string) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index b1288f17d86..ef5dbe51ada 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -515,7 +515,7 @@ This mode is intended to be inherited by concrete major modes." :syntax-table typescript-ts-mode--syntax-table (when (treesit-ready-p 'typescript) - (treesit-parser-create 'typescript) + (setq treesit-primary-parser (treesit-parser-create 'typescript)) ;; Indent. (setq-local treesit-simple-indent-rules @@ -553,7 +553,7 @@ at least 3 (which is the default value)." :syntax-table typescript-ts-mode--syntax-table (when (treesit-ready-p 'tsx) - (treesit-parser-create 'tsx) + (setq treesit-primary-parser (treesit-parser-create 'tsx)) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index f5a20e0ca0e..c8da28187ee 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1814,7 +1814,7 @@ can also be used to fill comments. (setq-local font-lock-fontify-region-function #'css--fontify-region) ;; Tree-sitter specific setup. - (treesit-parser-create 'css) + (setq treesit-primary-parser (treesit-parser-create 'css)) (setq-local treesit-simple-indent-rules css--treesit-indent-rules) (setq-local treesit-defun-type-regexp "rule_set") (setq-local treesit-defun-name-function #'css--treesit-defun-name) diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index 235e1055fa9..f78fbdde1da 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -92,7 +92,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'html) (error "Tree-sitter for HTML isn't available")) - (treesit-parser-create 'html) + (setq treesit-primary-parser (treesit-parser-create 'html)) ;; Indent. (setq-local treesit-simple-indent-rules html-ts-mode--indent-rules) diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 3c4533a7fea..806f045c23b 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el @@ -124,7 +124,7 @@ Return nil if there is no name or if NODE is not a defun node." :syntax-table toml-ts-mode--syntax-table (when (treesit-ready-p 'toml) - (treesit-parser-create 'toml) + (setq treesit-primary-parser (treesit-parser-create 'toml)) ;; Comments (setq-local comment-start "# ") diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index 210835585fe..42d7c2e1798 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el @@ -148,7 +148,7 @@ boundaries. JUSTIFY is passed to `fill-paragraph'." :syntax-table yaml-ts-mode--syntax-table (when (treesit-ready-p 'yaml) - (treesit-parser-create 'yaml) + (setq treesit-primary-parser (treesit-parser-create 'yaml)) ;; Comments. (setq-local comment-start "# ") commit 2a6f1527f6b3080c3879e6159424b824c86801a7 Author: Alan Mackenzie Date: Mon Oct 14 21:27:04 2024 +0000 CC Mode: Correct and simplify quoted number regexps C++ Mode now gives correct fontification when \' is inserted between the adjacent apostrophes in the number 0xde'adb''eef. * lisp/progmodes/cc-mode.el (c-maybe-quoted-number-head): Simplify and correct. (c-maybe-quoted-number-tail, c-maybe-quoted-number): Simplify. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 35516a53bae..fe3ddaa170f 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1774,14 +1774,14 @@ position of `after-change-functions'.") (defconst c-maybe-quoted-number-head (concat "\\(0\\(" - "\\([Xx]\\([[:xdigit:]]\\('[[:xdigit:]]\\|[[:xdigit:]]\\)*'?\\)?\\)" + "[Xx]\\([[:xdigit:]]\\('?[[:xdigit:]]\\)*\\)?" "\\|" - "\\([Bb]\\([01]\\('[01]\\|[01]\\)*'?\\)?\\)" + "[Bb]\\([01]\\('?[01]\\)*\\)?" "\\|" - "\\('[0-7]\\|[0-7]\\)*'?" + "\\('?[0-7]\\)*" "\\)" "\\|" - "[1-9]\\('[0-9]\\|[0-9]\\)*'?" + "[1-9]\\('?[0-9]\\)*" "\\)") "Regexp matching the head of a numeric literal, including with digit separators.") @@ -1808,11 +1808,11 @@ position of `after-change-functions'.") (defconst c-maybe-quoted-number-tail (concat "\\(" - "\\([xX']?[[:xdigit:]]\\('[[:xdigit:]]\\|[[:xdigit:]]\\)*\\)" + "\\([xX']?[[:xdigit:]]\\('?[[:xdigit:]]\\)*\\)" "\\|" - "\\([bB']?[01]\\('[01]\\|[01]\\)*\\)" + "\\([bB']?[01]\\('?[01]\\)*\\)" "\\|" - "\\('?[0-9]\\('[0-9]\\|[0-9]\\)*\\)" + "\\('?[0-9]\\)+" "\\)") "Regexp matching the tail of a numeric literal, including with digit separators. Note that this is a strict tail, so won't match, e.g. \"0x....\".") @@ -1828,14 +1828,14 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") (defconst c-maybe-quoted-number (concat "\\(0\\(" - "\\([Xx][[:xdigit:]]\\('[[:xdigit:]]\\|[[:xdigit:]]\\)*\\)" + "\\([Xx][[:xdigit:]]\\('?[[:xdigit:]]\\)*\\)" "\\|" - "\\([Bb][01]\\('[01]\\|[01]\\)*\\)" + "\\([Bb][01]\\('?[01]\\)*\\)" "\\|" - "\\('[0-7]\\|[0-7]\\)*" + "\\('?[0-7]\\)*" "\\)" "\\|" - "[1-9]\\('[0-9]\\|[0-9]\\)*" + "[1-9]\\('?[0-9]\\)*" "\\)") "Regexp matching a numeric literal, including with digit separators.") commit 6864ac2bc3bee1add508872b756693a6fbe0c2e7 Author: Michael Albinus Date: Sun Oct 13 18:05:39 2024 +0200 Describe how to add an ELPA package to Tramp * doc/misc/tramp.texi: Use @dots{} where appropriate. (External packages): Rename subsection "Timers, process filters, process sentinels, redisplay". (Extension packages): New node. (Top, Files directories and localnames): Add it to @menu. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 19a2668e76c..1b40ce6fa62 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -167,6 +167,7 @@ How file names, directories and localnames are mangled and managed * Temporary directory:: Where temporary files are kept. * Localname deconstruction:: Breaking a localname into its components. * External packages:: Integration with external Lisp packages. +* Extension packages:: Adding new methods to @value{tramp}. @end detailmenu @end menu @@ -2665,7 +2666,7 @@ will help: @example @group if test "$TERM" = "dumb"; then - ... + @dots{} fi @end group @end example @@ -5047,8 +5048,8 @@ An archive file name could be a remote file name, as in Since all file operations are mapped internally to @acronym{GVFS} operations, remote file names supported by @code{tramp-gvfs} perform better, because no local copy of the file archive must be downloaded -first. For example, @samp{/sftp:user@@host:...} performs better than -the similar @samp{/scp:user@@host:...}. See the constant +first. For example, @samp{/sftp:user@@host:@dots{}} performs better +than the similar @samp{/scp:user@@host:@dots{}}. See the constant @code{tramp-archive-all-gvfs-methods} for a complete list of @code{tramp-gvfs} supported method names. @@ -6260,6 +6261,7 @@ programs. * Temporary directory:: Where temporary files are kept. * Localname deconstruction:: Splitting a localname into its component parts. * External packages:: Integrating with external Lisp packages. +* Extension packages:: Adding new methods to @value{tramp}. @end menu @@ -6377,7 +6379,7 @@ root directory, it is most likely sufficient to make the @code{default-directory} of the process buffer as the root directory. -@subsection Timers +@subsection Timers, process filters, process sentinels, redisplay @vindex remote-file-error Timers run asynchronously at any time when Emacs is waiting for @@ -6396,6 +6398,133 @@ wrapping the timer function body as follows: @end group @end lisp +A similar problem could happen with process filters, process +sentinels, and redisplay (updating the mode line). + + +@node Extension packages +@section Adding new methods to @value{tramp} + +There are two ways to add new methods to @value{tramp}: writing a new +backend including an own file name handler, or adding the new method, +using the existing @code{tramp-sh-file-name-handler}. The former +shall happen inside the @value{tramp} repository, and it isn't +discussed here. The latter means usually a new ELPA package. +@pxref{Customizing Methods} for some examples. + + +@subsection Writing an own ELPA package + +An external ELPA package @file{foo-tramp.el}, which intends to +provide a new @value{tramp} method, say @option{foo}, must add this +new method to the variable @code{tramp-methods}. This variable is an +alist with elements @code{(@var{name} @var{param1} @var{param2} +@dots{})}. + +@var{name} is the method name, @t{"foo"} in this case. +@var{param}@t{x} is a pair of the form @code{(@var{key} @var{value})}. +See the docstring of variable @code{tramp-methods} for possible +@var{key}s and @var{value}s. An example would be + +@lisp +@group +(add-to-list + 'tramp-methods + `("foo" + (tramp-login-program ,foo-tramp-executable) + (tramp-login-args (("exec") ("%h") ("--") ("su - %u"))) + (tramp-remote-shell "/bin/sh") + (tramp-remote-shell-args ("-i" "-c")))) +@end group +@end lisp + +@code{foo-tramp-executable} in this example would be a Lisp constant, +which is the program name of @command{foo}. + +Another initialization could tell @value{tramp} which are the default +user and host name for method @option{foo}. This is done by calling +@code{tramp-set-completion-function}: + +@lisp +@group +(tramp-set-completion-function + "foo" + '((tramp-foo--completion-function @var{arg}))) +@end group +@end lisp + +@code{tramp-foo--completion-function} is a function, which returns +completion candidates. @var{arg}, a string, is the argument for the +completion function, for example a file name to read from. +@pxref{Customizing Completion} for details. + +Finally, it might also be helpful to define default user or host names +for method @option{foo}, in case a remote file name leaves them empty. +This can be performed by calling + +@lisp +@group +(add-to-list 'tramp-default-user-alist '("foo" nil "root")) +(add-to-list 'tramp-default-host-alist '("foo" nil "localhost")) +@end group +@end lisp + +@pxref{Default User} and @ref{Default Host} explaining the user options +@code{tramp-default-user-alist} and @code{tramp-default-host-alist}. + + +@subsection Making a customized method optional + +The settings of the previous subsection are global in the package +@file{foo-tramp.el}, meaning they are activated when loading +@code{foo-tramp}. Sometimes, it is desired to make these settings +available without loading the whole package @code{foo-tramp}, but +declaring the new method @option{foo} as optional method only. In +this case, declare a function @code{tramp-enable-foo-method} which +collects the initialization. This function must be auto loaded. + +@lisp +@group +;;;###autoload +(defun tramp-enable-foo-method () + (add-to-list 'tramp-methods '("foo" @dots{})) + (tramp-set-completion-function "foo" @dots{}) + (add-to-list 'tramp-default-user-alist '("foo" @dots{})) + (add-to-list 'tramp-default-host-alist '("foo" @dots{}))) +@end group +@end lisp + +Then, you can activate method @option{foo} by calling @kbd{M-x +tramp-enable-method @key{RET} foo @key{RET}}. @pxref{Optional methods}. + + +@subsection Activating a customized method without loading the package + +If you want to make method @option{foo} known after loading +@value{tramp}, without loading the package @file{foo-tramp.el}, you +must autoload the implementation of function +@code{tramp-enable-foo-method}. Add the following code in +@file{foo-tramp.el}: + +@lisp +@group +;;;###autoload +(progn + (defun tramp-enable-foo-method () + (add-to-list 'tramp-methods '("foo" @dots{})) + (tramp-set-completion-function "foo" @dots{}) + (add-to-list 'tramp-default-user-alist '("foo" @dots{})) + (add-to-list 'tramp-default-host-alist '("foo" @dots{})))) + +;;;###autoload +(with-eval-after-load 'tramp (tramp-enable-method "foo")) +@end group +@end lisp + +The trick is to wrap the function definition of +@code{tramp-enable-foo-method} with @code{progn} for the +@code{;;;###autoload} cookie. + @node Traces and Profiles @chapter How to Customize Traces commit 19f929aaa33a3bd8cc02a7fdfa0d8dc4c2fa8fc3 Author: Michael Albinus Date: Sun Oct 13 15:40:42 2024 +0200 Adapt gitlab-ci.yml * test/infra/gitlab-ci.yml (variables): Set GIT_DEPTH: 0. (.job-template): Remove cache:policy. (.build-template): Add needs and cache:policy. (.test-template): Add cache:policy. (.tree-sitter-template): Add files in changes. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index de70e10870f..8292fb1b729 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -42,6 +42,7 @@ workflow: - when: always variables: + GIT_DEPTH: 0 GIT_STRATEGY: fetch EMACS_EMBA_CI: 1 EMACS_TEST_JUNIT_REPORT: junit-test-report.xml @@ -75,7 +76,6 @@ default: cache: key: ${CI_COMMIT_SHA} paths: [] - policy: pull-push # These will be saved for followup builds. artifacts: expire_in: 24 hrs @@ -98,6 +98,9 @@ default: - find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null .build-template: + needs: [] + cache: + policy: push rules: - if: '$CI_PIPELINE_SOURCE == "web"' when: always @@ -128,6 +131,8 @@ default: - docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} .test-template: + cache: + policy: pull artifacts: name: ${test_name} public: true @@ -185,7 +190,9 @@ default: - lisp/progmodes/csharp-mode.el - lisp/progmodes/js.el - lisp/progmodes/python.el + - lisp/progmodes/sh-script.el - lisp/textmodes/*-ts-mode.el + - lisp/textmodes/css-mode.el - lisp/treesit.el - src/treesit.{h,c} - test/infra/* commit 29bf0a8b31baf4ece85fb8f0698525547b2fe70e Author: Michael Albinus Date: Sun Oct 13 15:40:07 2024 +0200 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index daaae54d7d3..4346fb4aedd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -36,7 +36,7 @@ incorrectly in rare cases. This disables the GC mark trace buffer for about 5 % better garbage collection performance. Doing so may make it more difficult for Emacs developers to help finding GC-related bugs that you run into, which is -why it the mark trace buffer is enabled by default. +why the mark trace buffer is enabled by default. * Startup Changes in Emacs 31.1 @@ -45,11 +45,12 @@ why it the mark trace buffer is enabled by default. * Changes in Emacs 31.1 ** Etags + +++ -New command-line options for handling unrecognized programming languages. +*** New command-line options for handling unrecognized programming languages. The new command-line option '--no-fallback-lang' disables attempts to parse as Fortran or C/C++ files whose programming language 'etags' could -not determine. This allows to avoid false positives and reduce the time +not determine. This allows to avoid false positives and reduces the time required to scan directories with many such files. Another new option '--no-empty-file-entries' disables generation of file entries in tags tables for files in which no tags were found. @@ -61,7 +62,8 @@ The 'find-function', 'find-library', 'find-face-definition', and usual minibuffer history commands. Each command has a separate history. --- -** New minor mode find-function-mode replaces the old find-function-setup-keys. +** New minor mode 'find-function-mode'. +It replaces the old 'find-function-setup-keys'. ** Minibuffer and Completions @@ -144,7 +146,7 @@ example, the reason or the context why the project is asked for. *** New functions 'buffer-to-register' and 'file-to-register'. These allow users to interactively store file and buffers in registers. -Killed buffers stored in a register using buffer-to-register are +Killed buffers stored in a register using 'buffer-to-register' are automatically converted to a file-query value if the buffer was visiting a file. @@ -152,10 +154,10 @@ a file. * Editing Changes in Emacs 31.1 ** Commands for keyboard translation. -`key-translate' is now interactive. It prompts for a key to translate -from, and another to translate to, and sets `keyboard-translate-table'. -The new command `key-translate-remove' prompts for a key/translation -pair with completing-read, and removes it from the translation table. +'key-translate' is now interactive. It prompts for a key to translate +from, and another to translate to, and sets 'keyboard-translate-table'. +The new command 'key-translate-remove' prompts for a key/translation +pair with 'completing-read', and removes it from the translation table. ** Internationalization @@ -175,7 +177,7 @@ exactly below the text after the prefix on the first line. --- ** New commands 'unix-word-rubout' and 'unix-filename-rubout'. Unix-words are words separated by whitespace regardless of the buffer's -syntax table. In a Unix terminal or shell, C-w kills by Unix-word. +syntax table. In a Unix terminal or shell, 'C-w' kills by Unix-word. The new commands 'unix-word-rubout' and 'unix-filename-rubout' allow you to bind keys to operate more similarly to the terminal. @@ -200,10 +202,11 @@ other matching delimiters at once with Electric Pair mode, by providing a prefix argument when inserting one of the delimiters. +++ -** You can now use M-~ during C-x s ('save-some-buffers'). -Typing M-~ while saving some buffers means not to save the buffer and +** You can now use 'M-~' during 'C-x s' ('save-some-buffers'). +Typing 'M-~' while saving some buffers means not to save the buffer and also to mark it as unmodified. This is an alternative way to mark a buffer as unmodified which doesn't require switching to that buffer. + * Changes in Specialized Modes and Packages in Emacs 31.1 @@ -295,27 +298,27 @@ will now automatically turn on 'visual-wrap-prefix-mode' in addition to near window edge and the continuation lines are indented using prefixes computed from surrounding context. -** CC Mode +** CC mode +++ *** New type of 'c-offsets-alist' element. -The cdr of such an alist element may now be a syntactic symbol. A -source line with a syntactic element whose symbol is the car of that -alist element is indented as though it were the cdr. +The 'cdr' of such an alist element may now be a syntactic symbol. A +source line with a syntactic element whose symbol is the 'car' of that +alist element is indented as though it were the 'cdr'. +++ *** Enums now have their own syntactic symbols. The new symbols 'enum-open', 'enum-close', 'enum-intro' and 'enum-entry' are used in the analysis of enum constructs. Previously they were given 'brace-list-open', etc. These are fully described in -the CC Mode manual. +the "(ccmode) Enum Symbols" node of the CC mode manual. +++ *** Enums are now, by default, indented like classes, not brace-lists. To get the old behavior back, add an element '(enum-open -. brace-list-open)' to 'c-offsets-alist' in your CC Mode style, or amend -'c-offsets-alist' likewise in any of the other ways detailed in the CC -Mode manual page "Config Basics". +. brace-list-open)' to 'c-offsets-alist' in your CC mode style, or amend +'c-offsets-alist' likewise in any of the other ways detailed in the +"(ccmode) Config Basics" node of the CC mode manual. ** Go-ts mode @@ -394,14 +397,14 @@ back to real DocView buffer if it still exists. +++ *** New commands to save and restore pages in buffer-local registers. -Docview can store current page to buffer-local registers with the new +Docview can store the current page to buffer-local registers with the new command 'doc-view-page-to-register' (bound to 'm'), and later the stored page can be restored with 'doc-view-jump-to-register' (bound to '''). +++ -*** Docview can generate imenu index for DjVu and ODF documents. -When the 'djvused' program is available, Docview can now generate imenu -index for DjVu files from its outline. Index for Open Document Format +*** Docview can generate imenu indices for DjVu and ODF documents. +When the 'djvused' program is available, Docview can now generate an imenu +index for DjVu files from its outline. Indices for Open Document Format (ODF) files as used by OpenOffice and LibreOffice are generated using the 'mutool' program after their initial conversion to PDF format. The name of the 'djvused' program can be customized by changing the user @@ -426,7 +429,7 @@ to the original text. If the selected range extends a hunk, the command attempts to look up and copy the text in-between the hunks. +++ -*** New command 'diff-revert-and-kill-hunk' bound to C-c M-r. +*** New command 'diff-revert-and-kill-hunk' bound to 'C-c M-r'. This command reverts the hunk at point (i.e., applies the reverse of the hunk), and then removes the hunk from the diffs. This is useful to undo or revert changes, committed and uncommitted, when @@ -439,9 +442,9 @@ is after the corresponding file or hunk header, but not when inside it. Now they will always move to the start of the current header. +++ -*** New command 'diff-delete-other-hunks' bound to C-c RET n. +*** New command 'diff-delete-other-hunks' bound to 'C-c RET n'. This command deletes all hunks other than the current hunk. It is -useful to prepare a *vc-diff* buffer for committing a single hunk. +useful to prepare a "*vc-diff*" buffer for committing a single hunk. When the region is active, it deletes all hunks that the region does not overlap. @@ -453,7 +456,7 @@ They suggest the previous revision as the default for REV1, not the last one as before. This makes them different from 'vc-diff' and 'vc-root-diff' when those are called without a prefix argument. -** php-ts-mode +** PHP-ts mode --- *** 'php-ts-mode-run-php-webserver' can now accept a custom "php.ini" file. @@ -494,7 +497,7 @@ be set as a connection-local variable. +++ *** Grep results can be edited to reflect changes in the originating file. -Like Occur Edit mode, typing 'e' in the '*grep*' buffer will now make +Like Occur Edit mode, typing 'e' in the "*grep*" buffer will now make the 'grep' results editable. The edits will be reflected in the buffer visiting the originating file. Typing 'C-c C-c' will leave the Grep Edit mode. @@ -502,7 +505,7 @@ Edit mode. ** TeX modes +++ -*** New xref backend for TeX modes. +*** New Xref backend for TeX modes. The new backend ('tex-etags') is on by default, and improves the functionality of the standard 'xref' commands in TeX buffers. You can restore the standard 'etags' backend with the 'M-x xref-etags-mode' @@ -511,9 +514,9 @@ toggle. ** Midnight mode --- -*** Change for activating the mode -Putting (require 'midnight) in your init file no longer activates the -mode. Now, one needs to say (midnight-mode +1) instead. +*** Change for activating the mode. +Putting '(require 'midnight)' in your init file no longer activates the +mode. Now, one needs to say '(midnight-mode +1)' instead. ** Python mode @@ -527,13 +530,13 @@ customize these variables to "python3" if you want to use Python 3 instead. --- -*** Support 'electric-layout-mode'. +*** Support of 'electric-layout-mode' added. ** Tmm Menubar --- *** A new shortcut to navigate to previous menu. -The hardcoded "^" shortcut gets you back to the previous menu. +The hardcoded '^' shortcut gets you back to the previous menu. ** Foldout @@ -573,7 +576,7 @@ sup-mouse.el, terminal.el, vi.el, vip.el, ws-mode.el, and yow.el. * Lisp Changes in Emacs 31.1 +++ -** The 'defcustom' :local keyword can now be 'permanent-only'. +** The 'defcustom' ':local' keyword can now be 'permanent-only'. This means that the variable's 'permanent-local' property is set to t, without marking it as automatically buffer-local. @@ -687,7 +690,6 @@ and later versions. ** Emacs on MS-Windows now supports drag-n-drop of text into a buffer. This is in addition to drag-n-drop of files, that was already supported. - ---------------------------------------------------------------------- This file is part of GNU Emacs. commit 9a110c390dce9600ce8323ce8e87b14d379736e4 Author: Stephen Berman Date: Sun Oct 13 11:30:11 2024 +0200 Prevent void-variable error in python-mode (bug#73773) * lisp/progmodes/python.el: Define 'subword-mode' before its use in 'python-mode-map' so invoking menu-bar-open in a python-mode buffer does not cause a void-variable error when subword-mode is not loaded, menu-bar-mode is disabled and debug-on-error is enabled. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 812e28268c2..a75317b3b0e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -361,6 +361,8 @@ To customize the Python interpreter for interactive use, modify ;; Utilities " " #'completion-at-point) +(defvar subword-mode nil) + (easy-menu-define python-menu python-mode-map "Menu used for ´python-mode'." '("Python" commit da048c6927020e71b7c3d0f39e0d37cdb3ae76ab Author: Stephen Berman Date: Sun Oct 13 11:19:02 2024 +0200 Fix case problem with 'sql-magic-go' (bug#73499) * lisp/progmodes/sql.el (sql-electric-stuff): Use :initialize and :set arguments to control presence of 'sql-magic-go' in 'post-self-insert-hook'. (sql-interactive-mode-map): Remove key bindings for 'sql-magic-go'. (sql-magic-go): Reimplement as a non-interactive function restricted to 'sql-interactive-mode' and instead of using 'self-insert-command' check value of 'last-command-event'. diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index a0b350ce54f..13bf5e874b0 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -869,7 +869,13 @@ current input in the SQLi buffer to the process." :type '(choice (const :tag "Nothing" nil) (const :tag "The semicolon `;'" semicolon) (const :tag "The string `go' by itself" go)) - :version "20.8") + :initialize #'custom-initialize-default + :set (lambda (symbol value) + (custom-set-default symbol value) + (if (eq value 'go) + (add-hook 'post-self-insert-hook 'sql-magic-go) + (remove-hook 'post-self-insert-hook 'sql-magic-go))) + :version "31.1") (defcustom sql-send-terminator nil "When non-nil, add a terminator to text sent to the SQL interpreter. @@ -1359,8 +1365,6 @@ Based on `comint-mode-map'." :parent comint-mode-map "C-j" #'sql-accumulate-and-indent "C-c C-w" #'sql-copy-column - "O" #'sql-magic-go - "o" #'sql-magic-go ";" #'sql-magic-semicolon "C-c C-l a" #'sql-list-all "C-c C-l t" #'sql-list-table) @@ -3067,16 +3071,16 @@ displayed." ;;; Small functions -(defun sql-magic-go (arg) +(defun sql-magic-go () "Insert \"o\" and call `comint-send-input'. `sql-electric-stuff' must be the symbol `go'." - (interactive "P") - (self-insert-command (prefix-numeric-value arg)) - (if (and (equal sql-electric-stuff 'go) - (save-excursion - (comint-bol nil) - (looking-at "go\\b"))) - (comint-send-input))) + (and (eq major-mode 'sql-interactive-mode) + (equal sql-electric-stuff 'go) + (or (eq last-command-event ?o) (eq last-command-event ?O)) + (save-excursion + (comint-bol nil) + (looking-at "go\\b")) + (comint-send-input))) (put 'sql-magic-go 'delete-selection t) (defun sql-magic-semicolon (arg) commit f36d059cded88b0b6dafcc4a21a478ef0aaacf81 Author: Alex Bochannek Date: Fri Oct 11 20:32:41 2024 -0700 vc-src-working-revision: Call string-trim-right on command output * lisp/vc/vc-src.el (vc-src-working-revision): Call string-trim-right on command output (bug#73763). diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el index 27f58cb3369..ff19b0f7696 100644 --- a/lisp/vc/vc-src.el +++ b/lisp/vc/vc-src.el @@ -222,8 +222,9 @@ This function differs from `vc-do-command' in that it invokes `vc-src-program'." (defun vc-src-working-revision (file) "SRC-specific version of `vc-working-revision'." (let ((result (ignore-errors - (with-output-to-string - (vc-src-command standard-output file "list" "-f{1}" "@"))))) + (string-trim-right + (with-output-to-string + (vc-src-command standard-output file "list" "-f{1}" "@")))))) (if (zerop (length result)) "0" result))) ;;; commit a58dc58fec8dc146cf10454c6a2b3174d1b4c2f8 Author: Martin Rudalics Date: Sun Oct 13 09:48:05 2024 +0200 Fix bug when splitting a frame's root window (Bug#73627) * lisp/window.el (split-window): Split main window of WINDOW's frame when that frame has side windows (Bug#73627). diff --git a/lisp/window.el b/lisp/window.el index 1b95b5c9500..b50770cbd7e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5599,6 +5599,13 @@ frame. The selected window is not changed by this function." (setq atom-root (window-atom-root window)) (not (eq atom-root window))) (throw 'done (split-window atom-root size side pixelwise))) + ;; If WINDOW's frame has a side window and WINDOW specifies the + ;; frame's root window, split the frame's main window instead + ;; (Bug#73627). + ((and (eq window (frame-root-window frame)) + (window-with-parameter 'window-side nil frame)) + (throw 'done (split-window (window-main-window frame) + size side pixelwise))) ;; If WINDOW is a side window or its first or last child is a ;; side window, throw an error unless `window-combination-resize' ;; equals 'side.