]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 months agolisp/bs.el (bs--goto-current-buffer): Fix thinko in last commit
Stefan Monnier [Thu, 8 May 2025 14:51:16 +0000 (10:51 -0400)]
lisp/bs.el (bs--goto-current-buffer): Fix thinko in last commit

(cherry picked from commit c522428b33c8a34b7309b6166f35255bc4f2447c)

2 months agoRecenter for the calendar (bug#78205)
Manuel Giraud [Thu, 1 May 2025 15:06:07 +0000 (17:06 +0200)]
Recenter for the calendar (bug#78205)

* lisp/calendar/cal-move.el (calendar-recenter-last-op): New
variable to track last recenter operation.
(calendar-recenter): New command to recenter the calendar.
* lisp/calendar/calendar.el (calendar-mode-map): Keybinding for
this command.
* doc/emacs/calendar.texi (Scroll Calendar): Document this
command.
* etc/NEWS: Announce this command.

(cherry picked from commit 0469f41ac2e8f78bfbf9500b335fa32195c0482e)

2 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Thu, 8 May 2025 06:57:18 +0000 (23:57 -0700)]
Update from Gnulib by running admin/merge-gnulib

The following changes were made by hand,
so that admin/merge-gnulib could succeed
instead of failing because the diff didn’t match.
* admin/gnulib-patches/lib/getloadavg.c.diff:
Remove, as it is no longer needed now that recent
Gnulib has been merged.
* admin/merge-gnulib (GNULIB_TOOL_FLAGS):
Remove the --local-dir="$src"admin/gnulib-patches option,
as it is no longer needed either.

(cherry picked from commit c9c6abfa81c58b4a62f4fa5fcaad94b219f5d706)

2 months agocl-lib.el (cl-generic-generalizers): Fix partial bootstrap
Stefan Monnier [Thu, 8 May 2025 03:26:40 +0000 (23:26 -0400)]
cl-lib.el (cl-generic-generalizers): Fix partial bootstrap

* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers): Tweak the
bootstrap hack to avoid a problem when dumping `bootstrap-emacs` when
`cl-lib.el` has already been compiled.

* lisp/emacs-lisp/cl-macs.el (list): Move out of `static-if` test.

(cherry picked from commit 322ed637b4c2fe826d41c5af3800b2f2e381bb0f)

2 months ago(cl-deftype): Precompute the predicate function
Stefan Monnier [Thu, 8 May 2025 03:17:41 +0000 (23:17 -0400)]
(cl-deftype): Precompute the predicate function

Always define a `cl-deftype-satisfies` predicate (if possible), so
we only need `cl-typep` to "interpret" a type specifier when we use
a compound type but never for the atomic types (e.g. never
in `cl-types-of`).

* lisp/emacs-lisp/cl-macs.el (cl-typep): Test `cl-deftype-satisfies` first.
Don't handle `real` here any more.
(base-char, character, command, keyword, natnum, real): Define with
`c-deftype`.
(cl-deftype): Precompute the predicate for the atomic derived type,
if applicable.

* lisp/emacs-lisp/cl-preloaded.el (cl--define-derived-type):
Add argument for the precomputed predicate function.

* lisp/emacs-lisp/cl-extra.el (cl-types-of): Use `cl-deftype-satisfies`
instead of `cl-type-p`.

(cherry picked from commit 777da8c3f9ea73077c00957d48d8e6b317b9657d)

2 months ago; * src/pdumper.c (dump_buffer): Update hash.
Yuan Fu [Wed, 7 May 2025 18:07:49 +0000 (11:07 -0700)]
; * src/pdumper.c (dump_buffer): Update hash.

(cherry picked from commit a918f9e640f0c652d2f908fda88ecb2905eb4c58)

2 months ago; RefTeX: Update author email
Jeremy Bryant [Wed, 16 Apr 2025 20:14:57 +0000 (21:14 +0100)]
; RefTeX: Update author email

Update Carsten's email across related reftex* files:
lisp/textmodes/reftex.el
lisp/textmodes/reftex-auc.el
lisp/textmodes/reftex-cite.el
lisp/textmodes/reftex-dcr.el
lisp/textmodes/reftex-global.el
lisp/textmodes/reftex-index.el
lisp/textmodes/reftex-parse.el
lisp/textmodes/reftex-ref.el
lisp/textmodes/reftex-sel.el
lisp/textmodes/reftex-toc.el
lisp/textmodes/reftex-vars.el
lisp/textmodes/reftex.el
(AUCTeX bug#77850)

(cherry picked from commit 0d96565d5df014d2b9454b1960dffb850feb6b7c)

2 months agoMark !%:.^~, as punctuation rather than symbol constituents
James Cherti [Fri, 11 Apr 2025 14:18:19 +0000 (10:18 -0400)]
Mark !%:.^~, as punctuation rather than symbol constituents

In Bash, the characters !%:.^~, are not valid in variable names. In sh,
they are not permitted in either function or variable names. Treating
them as punctuation is convenient, as they are rarely used in function
names and never in variable names. Even among commands, their usage is
uncommon. The only character among these that is commonly seen in
command names is '.', although it is rarely used in function names.

Marking these characters as punctuation, rather than symbol
constituents, enhances the accuracy of symbol detection.

* lisp/progmodes/sh-script.el: Mark !%:.^~, as punctuation in the
  sh-mode-syntax-table syntax table.

Copyright-paperwork-exempt: yes
(cherry picked from commit 4e1fe56e316c041ed3b07f510ecba428c6b06cd1)

2 months agoImprove support of UTF-8 encoded file names in ZIP archives
Eli Zaretskii [Wed, 7 May 2025 18:43:59 +0000 (21:43 +0300)]
Improve support of UTF-8 encoded file names in ZIP archives

* lisp/arc-mode.el (archive-zip-summarize): Support the 0x7075
UPath Unicode Path Extra Field extension of ZIP format.
(Bug#78290)

(cherry picked from commit 74e7e0f08abfe6b50ba7c2a153a989bf4910835e)

2 months ago; Skip commit 3089d822ffa7d0d5fcc1cd56b432ab80c1f6771f
Eshel Yaron [Sat, 10 May 2025 08:54:33 +0000 (10:54 +0200)]
; Skip commit 3089d822ffa7d0d5fcc1cd56b432ab80c1f6771f

2 months ago; Skip commit 839d29b81ffac1d809f76e182468f40e184cfe22
Eshel Yaron [Sat, 10 May 2025 08:54:29 +0000 (10:54 +0200)]
; Skip commit 839d29b81ffac1d809f76e182468f40e184cfe22

2 months ago(cl-deftype): Don't set `cl-deftype-handler` directly
Stefan Monnier [Wed, 7 May 2025 17:54:47 +0000 (13:54 -0400)]
(cl-deftype): Don't set `cl-deftype-handler` directly

In order to make it easier to change that in the future, let
`cl--define-derived-type` take care of storing the derived
type's function into `cl-deftype-handler`.

* lisp/emacs-lisp/cl-preloaded.el (cl--define-derived-type):
Change calling convention.  Set `cl-deftype-handler`.
* lisp/emacs-lisp/cl-macs.el (cl-deftype): Don't set `cl-deftype-handler`,
instead pass the function to `cl--define-derived-type`.

(cherry picked from commit 9f50fdf1e75040d7feaa1edb235377a33da94781)

2 months agolisp/emacs-lisp/cl-types.el: Delete file
Stefan Monnier [Wed, 7 May 2025 17:24:58 +0000 (13:24 -0400)]
lisp/emacs-lisp/cl-types.el: Delete file

(cherry picked from commit d7459da58de8bf317d7669f001c35244ba38d17b)

2 months agocl-types: The big renaming to "derived types"
Stefan Monnier [Wed, 7 May 2025 17:24:07 +0000 (13:24 -0400)]
cl-types: The big renaming to "derived types"

`cl-defstruct` also defines a type and is also in CL, so
"cl-type" is not precise enough to talk about those types
defined with `cl-deftype`.  Use the term "derived type" to be
more clear, as is done in the HyperSpec.

* doc/misc/cl.texi (Derived types): Move `cl-deftype` to this
new subsection.  Document the use of derived types as method specializers.

* lisp/emacs-lisp/cl-extra.el (cl--types-of-memo): Rename from
`cl--type-unique`.
(cl--derived-type-dispatch-list): Rename from `cl--type-dispatch-list`.
(cl--derived-type-generalizer): Rename from `cl--type-generalizer`.
(cl--derived-type-generalizers): Rename from `cl--type-generalizers`.

* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers) <derived-types>:
Rename from <cl-types-of>.  Catch but don't hide errors when a derived
type cannot be used as an atomic type specifier.

* lisp/emacs-lisp/cl-preloaded.el (cl--derived-type-list): Rename from
`cl--type-list`.
(cl-derived-type-class): Rename from `cl-type-class`.
(cl--derived-type-class-make): Rename from `cl--type-class-make`.
(cl--define-derived-type): Rename from `cl--type-deftype`.

(cherry picked from commit b13044dae3db9c449a93f52fecfd848a3e7dd67d)

2 months ago(cl-types-of): Fix two plain bugs
David Ponce [Wed, 7 May 2025 16:24:00 +0000 (12:24 -0400)]
(cl-types-of): Fix two plain bugs

* lisp/emacs-lisp/cl-extra.el (cl-types-of): Fix error handling.
Don't mutate `found` since it's stored as key in the hash-table.

(cherry picked from commit f6f35644b7f49732fe38fac3c199ef3a6a22abe7)

2 months ago; Skip commit 5fee8a04335c0699d6072a9d775df2b197ad7c41
Eshel Yaron [Sat, 10 May 2025 08:53:44 +0000 (10:53 +0200)]
; Skip commit 5fee8a04335c0699d6072a9d775df2b197ad7c41

2 months agoUpdate the default value of 'diff-outline-regexp'.
Juri Linkov [Wed, 7 May 2025 06:31:01 +0000 (09:31 +0300)]
Update the default value of 'diff-outline-regexp'.

* lisp/vc/diff-mode.el (diff-outline-regexp): Change the default value
to match the diff command name in recursive diff.  Move after
'diff-hunk-header-re' variable definition used in the new value.
(diff-setup-buffer-type): Change setq of 'diff-outline-regexp'
to buffer-local (bug#78269).

(cherry picked from commit 47b075e24b65b0c07ea3e887b9c6d46ba8fbaa78)

2 months agoDon't ignore errors in diff-syntax-fontify-hunk.
Juri Linkov [Wed, 7 May 2025 06:20:18 +0000 (09:20 +0300)]
Don't ignore errors in diff-syntax-fontify-hunk.

* lisp/nxml/nxml-mode.el (nxml-extend-region):
Protect against error "Invalid search bound (wrong side of point)".

* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk):
Use 'with-demoted-errors' instead of 'ignore-errors'.

(cherry picked from commit ddc7bd547a2b422c4b8dca30076c0d9b70de09ad)

2 months ago(cl-generic-generalizers): Fix typo in last change
Stefan Monnier [Wed, 7 May 2025 03:04:46 +0000 (23:04 -0400)]
(cl-generic-generalizers): Fix typo in last change

(cherry picked from commit 2eb90d43e6e3b8325503d56c7778b9245b930d88)

2 months ago(cl-generic-generalizers): Skip types that need arguments
Stefan Monnier [Wed, 7 May 2025 02:53:01 +0000 (22:53 -0400)]
(cl-generic-generalizers): Skip types that need arguments

* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers) "cl-types-of":
make sure the atomic derived type is valid.

(cherry picked from commit 147113b3b5a89b401448424dd01c4ac915ea6081)

2 months agoFix compilation on Android 35 and on Termux
Po Lu [Tue, 6 May 2025 14:29:46 +0000 (22:29 +0800)]
Fix compilation on Android 35 and on Termux

* configure.ac (gl_cv_onwards_func_tzalloc): Define to "future
OS version" on Android API 35 and later.
Detect posix_spawn* by means of gl_CHECK_FUNCS_ANDROID.

* src/conf_post.h (tzalloc, tzfree): Define to non-conflicting
names on Android 35 and later.

(cherry picked from commit fa05cfd4455f2883d16992e5f1323a8945956987)

2 months ago; Skip commit 852d50ecfcfa505ca245be8d82123b27cc967f73
Eshel Yaron [Sat, 10 May 2025 08:53:21 +0000 (10:53 +0200)]
; Skip commit 852d50ecfcfa505ca245be8d82123b27cc967f73

2 months agocl-types: Integrate into CL-Lib
Stefan Monnier [Tue, 6 May 2025 03:18:56 +0000 (23:18 -0400)]
cl-types: Integrate into CL-Lib

* lisp/emacs-lisp/cl-extra.el (cl--type-unique, cl-types-of)
(cl--type-dispatch-list, cl--type-generalizer): Move to `cl-extra.el`.
(cl--type-generalizers): New function extracted from "cl-types-of"
method of `cl-generic-generalizers`.

* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers): New method to
dispatch on derived types.  Use `cl--type-generalizers`.

* lisp/emacs-lisp/cl-macs.el (cl-deftype): Move from `cl-types.el`
and rename from `cl-deftype2`.
(extended-char): Tweak definition to fix bootstrapping issues.

* lisp/emacs-lisp/cl-preloaded.el (cl--type-list, cl-type-class)
(cl--type-deftype): Move from `cl-types.el`.

* lisp/emacs-lisp/oclosure.el (oclosure): Don't abuse `cl-deftype` to
register the predicate function.

* test/lisp/emacs-lisp/cl-extra-tests.el: Move tests from
`cl-type-tests.el`.

(cherry picked from commit fc4d8ce9514dd45ab34dbef6f023347b42ee9fef)

2 months agocl-types: Simplify a bit further
Stefan Monnier [Mon, 5 May 2025 18:57:05 +0000 (14:57 -0400)]
cl-types: Simplify a bit further

Mostly, get rid of `cl--type-flag` and rely only on the presence/absence
of the type on `cl--types-list` to "flag" erroring-types.
Also, don't try and catch errors during dispatch.

* lisp/emacs-lisp/cl-types.el (cl--type-dispatch-list): Move to the
relevant section.
(cl--type-parents): Inline into sole caller.
(cl--type-deftype): Add `arglist` argument.
Don't signal an error if the type already existed but wasn't in
`cl--type-list` since that's normal and we can fix it.
Don't touch `cl--type-flag` any more.
Don't add to `cl--type-list` if it can't be used without arguments.
(cl-deftype2): Adjust call accordingly.
(cl--type-error): Inline into sole caller.
(cl-types-of): Be more careful to preserve ordering of types
before passing them to `merge-ordered-lists`.
Add `types` argument for use by dispatch.
Don't bother skipping the `root-type` since that's a built-in type,
so it should never happen anyway.
Don't catch errors if called from dispatch.
Don't bother with `cl--type-flag`.
(cl--type-generalizer): Use new arg of `cl-types-of` instead of
let-binding `cl--type-list`, in case `cl-types-of` ends up (auto)loading
a file or some such thing which needs to use/modify `cl--type-list`.
(cl--type-undefine): Move to end of file.

* test/lisp/emacs-lisp/cl-types-tests.el (cl-types-test): Remove DAG
test since we don't detect such errors any more.
Relax ordering test when the order is not guaranteed
by parent-relationships.

(cherry picked from commit 68a50324a70bd794d7f3228290310093f1515f7b)

2 months ago(comment-setup-function): Make it usable with `add-function`
Stefan Monnier [Mon, 5 May 2025 18:05:36 +0000 (14:05 -0400)]
(comment-setup-function): Make it usable with `add-function`

* lisp/newcomment.el (comment-setup-function): Give it a non-nil default.
(comment-normalize-vars): Call it unconditionally.

(cherry picked from commit a64a56fbf03d5ece647254c8920fe5af59cdf3cd)

2 months agoNew variable 'comment-setup-function' for multi-language modes.
Juri Linkov [Mon, 5 May 2025 16:57:29 +0000 (19:57 +0300)]
New variable 'comment-setup-function' for multi-language modes.

* lisp/newcomment.el (comment-setup-function): New variable.
(comment-normalize-vars): Call non-nil 'comment-setup-function'.

* lisp/textmodes/mhtml-ts-mode.el
(mhtml-ts-mode--comment-current-lang): New internal variable.
(mhtml-ts-mode--comment-setup): New function.
(mhtml-ts-mode): Set 'comment-setup-function' to
'mhtml-ts-mode--comment-setup' instead of using
'c-ts-common-comment-setup' only for JavaScript.

https://lists.gnu.org/archive/html/emacs-devel/2025-05/msg00025.html
(cherry picked from commit 61cb73a2dbe756b060d4256c3b7ebe09f71ed2b7)

2 months ago* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Add 'ignore-errors'.
Juri Linkov [Mon, 5 May 2025 16:52:28 +0000 (19:52 +0300)]
* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Add 'ignore-errors'.

(cherry picked from commit e5746d3677b86ef3d0ba0d7f1e916180cc4b6f69)

2 months ago* lisp/outline.el (outline-minor-mode-highlight-buffer): Adjust match data.
Juri Linkov [Mon, 5 May 2025 16:50:24 +0000 (19:50 +0300)]
* lisp/outline.el (outline-minor-mode-highlight-buffer): Adjust match data.

After a successful call to 'outline-search-function'
set the end of the match data to the end of the line
that is equivalent to adding ".*" in the regexp.
This accompanies the recent change in 'outline-font-lock-keywords'.

(cherry picked from commit 6c3a995ed535f9fb492461a53442e4d8bd4deb17)

2 months agocl-types.el: Speed up deftype and dispatch
David Ponce [Mon, 5 May 2025 15:03:56 +0000 (11:03 -0400)]
cl-types.el: Speed up deftype and dispatch

* lisp/emacs-lisp/cl-types.el (cl--type-list): Doc string.
(cl--type-dispatch-list): New variable.
(cl--type-parents): Make it a plain defun.
(cl--type-children, cl--type-dag): Remove.
(cl--type-undefine): Remove duplicate test for `cl--type-p'.  Use
`cl--class-children'.  Clear `cl--type-flag' instead of
`cl--type-error'.  Also remove type from the dispatch list.
(cl--type-deftype): Doc string.  Remove useless safeguard of
data on error.  Fix some error messages.  Clear `cl--type-flag'
when a type is (re)defined.  Just push new types on
`cl--type-list'.
(cl--type-error): Set `cl--type-flag' to the symbol `error' and
remove type in error from the dispatch list.
(cl-types-of): Doc string.  Remove useless check for
`cl-type-class-p'.  Skip types which we are sure will not match.
Simplify creation of the DAG.
(cl--type-generalizer): In the tagcode-function, check only types
that can be dispatched.
(cl-generic-generalizers): Populate the dispatch list.

(cherry picked from commit 8f649c42702144dbbacba180c78ab0df04951807)

2 months ago; More fixes for treesit tests
Eli Zaretskii [Mon, 5 May 2025 12:16:43 +0000 (15:16 +0300)]
; More fixes for treesit tests

* test/src/treesit-tests.el (treesit-parse-string)
(treesit-parser-tracking-line-column-p)
(treesit-tracking-line-column-p, treesit--linecol-at)
(treesit--linecol-cache-set, treesit--linecol-cache)
(treesit-languages-require-line-column-tracking): Declare.

(cherry picked from commit cc6e604da6f274aafeda1476b2e1e2083063c20e)

2 months ago; Fix recently added treesit tests
Eli Zaretskii [Mon, 5 May 2025 12:07:28 +0000 (15:07 +0300)]
; Fix recently added treesit tests

* test/src/treesit-tests.el (treesit-linecol-basic)
(treesit-linecol-search-back-across-newline)
(treesit-linecol-col-same-line): Skip tests if tree-sitter is not
available.

(cherry picked from commit b84e306be765d5071577f81a12f9557e64732ecf)

2 months agoFix test-regressions in python-ts-mode
Jostein Kjønigsen [Mon, 5 May 2025 07:45:36 +0000 (09:45 +0200)]
Fix test-regressions in python-ts-mode

* lisp/progmodes/python.el (python--treesit-settings): Use more
specific selectors for constants.

* test/lisp/progmodes/python-tests.el
(python-ts-mode-nested-types-face-1)
(python-ts-mode-union-types-face-1)
(python-ts-mode-union-types-face-2): None is now a constant.

(cherry picked from commit 9261d353ccc0f94da8049faaade025f338d75354)

2 months agowhitespace.el: Collaborate better with `combine-after-change-calls`
Stefan Monnier [Mon, 5 May 2025 03:42:12 +0000 (23:42 -0400)]
whitespace.el: Collaborate better with `combine-after-change-calls`

* lisp/whitespace.el: Remove redundant `:group` arguments.
Prefer #' to quote function names.
(whitespace-buffer-changed): Delete function.
(whitespace-color-on): Don't touch `before-change-functions`.
(whitespace--update-bob-eob): Set `whitespace-buffer-changed` here, instead.
(whitespace-post-command-hook): Apply De Morgan.
(whitespace--empty-at-bob-matcher, whitespace-post-command-hook)
(whitespace--update-bob-eob): Use `point-min` and `point-max`.

(cherry picked from commit 7cb7e96a5cca6778054cf74fd2c7548ca40f0691)

2 months agoSynchronize Android and Haiku terminal frontends with X
Po Lu [Mon, 5 May 2025 00:51:42 +0000 (08:51 +0800)]
Synchronize Android and Haiku terminal frontends with X

* src/androidterm.c (handle_one_android_event):

* src/haikuterm.c (haiku_read_socket): Port recent changes to
handle_one_xevent.

(cherry picked from commit b97b3b057ca8128cb479f8d3893816d146cfef59)

2 months agoAvoid duplication in defining tree-sitter grammar sources.
Juri Linkov [Sun, 4 May 2025 17:50:40 +0000 (20:50 +0300)]
Avoid duplication in defining tree-sitter grammar sources.

* lisp/progmodes/php-ts-mode.el: Require 'html-ts-mode'.
(php-ts-mode--language-source-alist): Remove duplicate source info
for html, css, javascript, jsdoc.
(php-ts-mode-install-parsers): Install pre-defined grammars.
(php-ts-mode): Move 'require' to the top.

* lisp/textmodes/mhtml-ts-mode.el
(mhtml-ts-mode--language-source-alist): Remove variable
since 'treesit-language-source-alist' is pre-filled by
requiring 'html-ts-mode', 'css-mode', 'js'.
(mhtml-ts-mode-install-parsers): Install pre-defined grammars.

* test/infra/Dockerfile.emba: Remove 'mhtml-ts-mode'
that doesn't define own grammars.

(cherry picked from commit 815dea7b59392d83ca8f9e98d1569484aea605ad)

2 months ago* lisp/textmodes/markdown-ts-mode.el: Improve.
Juri Linkov [Sun, 4 May 2025 17:03:32 +0000 (20:03 +0300)]
* lisp/textmodes/markdown-ts-mode.el: Improve.

(markdown-ts-list-marker): Inherit from 'shadow' like in non-ts mode.
(markdown-ts-block-quote): Inherit from 'italic' like in non-ts mode.
(markdown-ts--treesit-settings): Use 'shadow' for parens in
'markdown-inline' only under 'inline_link' and 'image'.
Use @markdown-ts-block-quote for 'block_quote'.
Override with 'append' for links.
(markdown-ts--range-settings): Use global html parser for 'html_tag'
since its ranges are interconnected.
(markdown-ts-setup): Create the 'html' parser.

(cherry picked from commit 9e75d1815125178b4b8584faa02569d6b84fc0b5)

2 months agoEglot: allow other keys in window/logMessage (bug#77948)
João Távora [Sun, 4 May 2025 07:27:13 +0000 (08:27 +0100)]
Eglot: allow other keys in window/logMessage (bug#77948)

* lisp/progmodes/eglot.el (eglot-handle-notification window/logMessage): Fix.

(cherry picked from commit 660ebdddf6583e447b50f6574dca4ca8ff42ef60)

2 months agoFix support of 'mouse-highlight' on X (bug#78218)
Gerd Möllmann [Sun, 4 May 2025 06:17:27 +0000 (08:17 +0200)]
Fix support of 'mouse-highlight' on X (bug#78218)

* src/xterm.c (handle_one_xevent): Fix comparison with tool-bar
and tab-bar window.

(cherry picked from commit 6ccfc8977821d02e8d589c801e6cad2e74ab699b)

2 months agoAdd line-column tracking for tree-sitter
Yuan Fu [Wed, 19 Mar 2025 00:26:26 +0000 (17:26 -0700)]
Add line-column tracking for tree-sitter

Add line-column tracking for tree-sitter parsers.  Copied from
comments in treesit.c:

   Technically we had to send tree-sitter the line and column
   position of each edit.  But in practice we just send it dummy
   values, because tree-sitter doesn't use it for parsing and
   mostly just carries the line and column positions around and
   return it when e.g. reporting node positions[1].  This has
   been working fine until we encountered grammars that actually
   utilizes the line and column information for
   parsing (Haskell)[2].

   [1] https://github.com/tree-sitter/tree-sitter/issues/445
   [2] https://github.com/tree-sitter/tree-sitter/issues/4001

   So now we have to keep track of line and column positions and
   pass valid values to tree-sitter.  (It adds quite some
   complexity, but only linearly; one can ignore all the linecol
   stuff when trying to understand treesit code and then come
   back to it later.)  Eli convinced me to disable tracking by
   default, and only enable it for languages that needs it.  So
   the buffer starts out not tracking linecol.  And when a
   parser is created, if the language is in
   treesit-languages-require-line-column-tracking, we enable
   tracking in the buffer, and enable tracking for the parser.
   To simplify things, once a buffer starts tracking linecol, it
   never disables tracking, even if parsers that need tracking
   are all deleted; and for parsers, tracking is determined at
   creation time, if it starts out tracking/non-tracking, it
   stays that way, regardless of later changes to
   treesit-languages-require-line-column-tracking.

   To make calculating line/column positons fast, we store
   linecol caches for begv, point, and zv in the
   buffer (buf->ts_linecol_cache_xxx); and in the parser object,
   we store linecol cache for visible beg/end of that parser.

   In buffer editing functions, we need the linecol for
   start/old_end/new_end, those can be calculated by scanning
   newlines (treesit_linecol_of_pos) from the buffer point
   cache, which should be always near the point.  And we usually
   set the calculated linecol of new_end back to the buffer
   point cache.

   We also need to calculate linecol for the visible_beg/end for
   each parser, and linecol for the buffer's begv/zv, these
   positions are usually far from point, so we have caches for
   all of them (in either the parser object or the buffer).
   These positions are far from point, so it's inefficient to
   scan newlines from point to there to get up-to-date linecol
   for them; but in the same time, because they're far and
   outside the changed region, we can calculate their change in
   line and column number by simply counting how much newlines
   are added/removed in the changed
   region (compute_new_linecol_by_change).

* doc/lispref/parsing.texi (Using Parser): Mention line-column
tracking in manual.
* etc/NEWS: Add news.
* lisp/treesit.el:
(treesit-languages-need-line-column-tracking): New variable.
* src/buffer.c: Include treesit.h (for TREESIT_EMPTY_LINECOL).
(Fget_buffer_create):
(Fmake_indirect_buffer): Initialize new buffer fields.
(Fbuffer_swap_text): Add new buffer fields.
* src/buffer.h (ts_linecol): New struct.
(buffer): New buffer fields.
(BUF_TS_LINECOL_BEGV):
(BUF_TS_LINECOL_POINT):
(BUF_TS_LINECOL_ZV):
(SET_BUF_TS_LINECOL_BEGV):
(SET_BUF_TS_LINECOL_POINT):
(SET_BUF_TS_LINECOL_ZV): New inline functions.
* src/casefiddle.c (casify_region): Record linecol info.
* src/editfns.c (Fsubst_char_in_region):
(Ftranslate_region_internal):
(Ftranspose_regions): Record linecol info.
* src/insdel.c (insert_1_both):
(insert_from_string_1):
(insert_from_gap_1):
(insert_from_buffer):
(replace_range):
(del_range_2): Record linecol info.
* src/treesit.c (TREESIT_BOB_LINECOL):
(TREESIT_EMPTY_LINECOL):
(TREESIT_TS_POINT_1_0): New constants.
(treesit_debug_print_linecol):
(treesit_buf_tracks_linecol_p):
(restore_restriction_and_selective_display):
(treesit_count_lines):
(treesit_debug_validate_linecol):
(treesit_linecol_of_pos):
(treesit_make_ts_point):
(Ftreesit_tracking_line_column_p):
(Ftreesit_parser_tracking_line_column_p): New functions.
(treesit_tree_edit_1): Accept real TSPoint and pass to
tree-sitter.
(compute_new_linecol_by_change): New function.
(treesit_record_change_1): Rename from treesit_record_change,
handle linecol if tracking is enabled.
(treesit_linecol_maybe): New function.
(treesit_record_change): New wrapper around
treesit_record_change_1 that handles some boilerplate and sets
buffer state.
(treesit_sync_visible_region): Handle linecol if tracking is
enabled.
(make_treesit_parser): Setup parser's linecol cache if tracking
is enabled.
(Ftreesit_parser_create): Enable tracking if the parser's
language requires it.
(Ftreesit__linecol_at):
(Ftreesit__linecol_cache_set):
(Ftreesit__linecol_cache): New functions for debugging and
testing.
(syms_of_treesit): New variable
Vtreesit_languages_require_line_column_tracking.
* src/treesit.h (Lisp_TS_Parser): New fields.
(TREESIT_BOB_LINECOL):
(TREESIT_EMPTY_LINECOL): New constants.
* test/src/treesit-tests.el (treesit-linecol-basic):
(treesit-linecol-search-back-across-newline):
(treesit-linecol-col-same-line):
(treesit-linecol-enable-disable): New tests.
* src/lisp.h: Declare display_count_lines.
* src/xdisp.c (display_count_lines): Remove static keyword.

(cherry picked from commit 1897da0b599cc3ea1e4aa626e47ac8943a7b6833)

2 months agoFix support of 'mouse-highlight' on NS (bug#78218)
Gerd Möllmann [Sun, 4 May 2025 04:39:22 +0000 (06:39 +0200)]
Fix support of 'mouse-highlight' on NS (bug#78218)

* src/nsterm.m: ([EmacsView keyDown:]): Add missing '!' in
if-condition.  Check tab_bar_window as other window systems do.

(cherry picked from commit 159e3a981ed5482393182b036e38818d42405c90)

2 months ago; Skip commit f41ab0b425c7cfb2c337deb28ef2d7e4bd339394
Eshel Yaron [Sat, 10 May 2025 08:48:57 +0000 (10:48 +0200)]
; Skip commit f41ab0b425c7cfb2c337deb28ef2d7e4bd339394

2 months agoAvoid warnings about 'lexical-binding' in 'eval-buffer'
Eli Zaretskii [Sat, 3 May 2025 13:26:44 +0000 (16:26 +0300)]
Avoid warnings about 'lexical-binding' in 'eval-buffer'

* src/lread.c (Feval_buffer): Don't emit a lexbind warning if the
buffer already has a local value of 'lexical-binding'.  Doc fix.
(Bug#77883)

(cherry picked from commit 8a097aede53dfb8f595d79824c784c188b210093)

2 months agoFix quoted local file name parts in Tramp
Michael Albinus [Sat, 3 May 2025 13:00:18 +0000 (15:00 +0200)]
Fix quoted local file name parts in Tramp

* lisp/net/tramp.el (tramp-handle-directory-file-name):
* lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay):
Handle quoted local file name part.

(cherry picked from commit 28a276efe8744227e15a8077f6333974eda157bb)

2 months agoFix support of 'mouse-highlight' on MS-Windows console
Eli Zaretskii [Sat, 3 May 2025 11:07:27 +0000 (14:07 +0300)]
Fix support of 'mouse-highlight' on MS-Windows console

* src/w32inevt.c (w32_console_read_socket): Support numerical
value of 'mouse-highlight'.  (Bug#78218)

(cherry picked from commit c31f23016c6db449c646c12352e9207a19f5b70f)

2 months ago; * lisp/textmodes/markdown-ts-mode.el (treesit-node-child): Declare.
Eli Zaretskii [Sat, 3 May 2025 10:24:59 +0000 (13:24 +0300)]
; * lisp/textmodes/markdown-ts-mode.el (treesit-node-child): Declare.

(cherry picked from commit 790c475ec57b2f3c72f00be3ba186caee1538ebf)

2 months agoAdd `next-error' support for flymake diagnostics buffers
Matthew Tromp [Tue, 22 Apr 2025 19:27:58 +0000 (15:27 -0400)]
Add `next-error' support for flymake diagnostics buffers

This adds `next-error' support for flymake diagnostics buffers.
Buffers created with `flymake-show-buffer-diagnostics' and
`flymake-show-project-diagnostics' are now next-error enabled,
and `next-error' and `previous-error' will navigate through
their listed diagnostics.
* lisp/progmodes/flymake.el (flymake-current-diagnostic-line)
(flymake--diagnostics-next-error): Add.
(flymake-show-diagnostic, flymake-show-buffer-diagnostics)
(flymake-show-project-diagnostics): Set next-error-last-buffer.
(flymake--tabulated-setup): Set next-error-function.
(Bug#77809)

Copyright-paperwork-exempt: yes
(cherry picked from commit ee8b4eaca12af0ef6bf0d37780efaa558c25d45e)

2 months ago; * doc/misc/ert.texi (erts files): Improve indexing.
Eli Zaretskii [Sat, 3 May 2025 07:34:43 +0000 (10:34 +0300)]
; * doc/misc/ert.texi (erts files): Improve indexing.

(cherry picked from commit 1f998d11a585a9915cc6e8b67050dc1bb9191107)

2 months agoFix 'Skip' behavior in erts files (bug#76839)
Roi Martin [Thu, 6 Mar 2025 19:26:46 +0000 (20:26 +0100)]
Fix 'Skip' behavior in erts files (bug#76839)

* lisp/emacs-lisp/ert.el (ert-test--erts-test): Fix 'Skip'
behavior in erts files, so only the test case where it is
specified is skipped.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-erts-skip-one)
(ert-test-erts-skip-last): Add test cases.

(cherry picked from commit d164116aa52b10bdfe8242dd1089406d4e557f32)

2 months agoImprove native--compile-skip-on-battery-p
Sean Whitton [Sat, 3 May 2025 02:32:42 +0000 (10:32 +0800)]
Improve native--compile-skip-on-battery-p

* lisp/emacs-lisp/comp-run.el
(native--compile-skip-on-battery-p): Look at %L, %b and %B
format characters.  Add commentary.

(cherry picked from commit f180e4c9cb676e771acdaed7b0fd76c1c83dd485)

2 months ago(decode_coding): Avoid nested *-change-functions (bug#78042)
Stefan Monnier [Fri, 2 May 2025 20:59:17 +0000 (16:59 -0400)]
(decode_coding): Avoid nested *-change-functions (bug#78042)

* src/coding.c (decode_coding): Avoid nested *-change-functions (bug#78042).

* test/src/editfns-tests.el (sanity-check-change-functions-before)
(sanity-check-change-functions-after): Record notifications in
`sanity-check-change-functions-op`.
(sanity-check-change-functions-with-op): Don't rely on
`sanity-check-change-functions-op` always holding only the `op`.
(sanity-check-change-functions-errors): Include the sequence of
notifications in the error info.
(editfns-tests--before/after-change-functions): Add tests for (bug#78042).

(cherry picked from commit 9048fcf22c3ec3b5cc77dbb98993a53f5f9b7cd5)

2 months ago; Skip commit 99ca41b6ef300653a0d15b73a0c0d446a9a9e059
Eshel Yaron [Sat, 10 May 2025 06:56:54 +0000 (08:56 +0200)]
; Skip commit 99ca41b6ef300653a0d15b73a0c0d446a9a9e059

2 months agoFix completion boundaries for TRAMP file names
Spencer Baugh [Fri, 2 May 2025 12:47:37 +0000 (14:47 +0200)]
Fix completion boundaries for TRAMP file names

Previously, we assumed (roughly) that substitute-in-file-name
always returns a suffix of the original string.  But
substitute-in-file-name on "/ssh:user@host:/~/" returns
"/ssh:user@host:~/", preserving the TRAMP magic prefix.  Weaken
the assertion in completion--sifn-boundaries to allow this; the
new assertion is more clear about the property we care about,
anyway.

* lisp/minibuffer.el (completion--sifn-boundaries): Weaken
assertion slightly.

* test/lisp/net/tramp-tests.el (tramp--test-emacs31-p)
(tramp--split-on-boundary)
(tramp-test51-file-name-completion-boundaries): Add.

(cherry picked from commit d56d7ca35cf3c0185fe42bf7f64e3aa6a5281e3e)

2 months ago; * lisp/battery.el (battery-status-function): Doc fix.
Eli Zaretskii [Fri, 2 May 2025 12:07:35 +0000 (15:07 +0300)]
; * lisp/battery.el (battery-status-function): Doc fix.

(cherry picked from commit 52183c9596cc4d346c872ad81ecbcf695e636f0b)

2 months ago; * lisp/progmodes/cc-fonts.el (cl-delete-duplicates): Declare.
Eli Zaretskii [Fri, 2 May 2025 05:59:14 +0000 (08:59 +0300)]
; * lisp/progmodes/cc-fonts.el (cl-delete-duplicates): Declare.

(cherry picked from commit 3f8f738d1d6b583415aa5d5584299794838316ca)

2 months agoMove documentation of this-command buffer display condition entry
Sean Whitton [Fri, 2 May 2025 04:49:35 +0000 (12:49 +0800)]
Move documentation of this-command buffer display condition entry

* doc/lispref/buffers.texi (Buffer List): Document this-command
buffer display condition entry.
* doc/lispref/windows.texi (Choosing Window): Give an example of
using this-command buffer display condition entry in
display-buffer-alist.
(Buffer Display Action Alists):
* lisp/window.el (display-buffer): Delete documentation of
this-command buffer display condition entry from these locations
because it is not a buffer display action alist entry.
* lisp/subr.el (buffer-match-p): Update cross reference.

(cherry picked from commit d32ab06145a6055f5e39d348bddba72c3f705d75)

2 months agoNew user option native-comp-async-on-battery-power
Sean Whitton [Fri, 2 May 2025 04:04:26 +0000 (12:04 +0800)]
New user option native-comp-async-on-battery-power

* lisp/emacs-lisp/comp-run.el
(native-comp-async-on-battery-power): New option.
(battery-status-function): Declare.
(native--compile-skip-on-battery-p): New function.
(comp--run-async-workers): Call it.
* etc/NEWS: Announce the new option.

(cherry picked from commit 6b11687555cdd1d6896bad5eb09af217b28d6076)

2 months ago; * etc/DEBUG: Grammar fix.
Sean Whitton [Fri, 2 May 2025 02:26:08 +0000 (10:26 +0800)]
; * etc/DEBUG: Grammar fix.

(cherry picked from commit dc3e79a80ee5b958ab0f6ffc6861fb5ac9418bab)

2 months agoEmbed html, yaml and toml in markdown-ts-mode.
Juri Linkov [Thu, 1 May 2025 18:23:33 +0000 (21:23 +0300)]
Embed html, yaml and toml in markdown-ts-mode.

* lisp/textmodes/markdown-ts-mode.el (markdown-ts--treesit-settings):
Use @italic on the whole 'block_quote'.
(markdown-ts-outline-predicate): New function.
(markdown-ts--range-settings): Embed 'yaml' in host 'markdown',
embed 'toml' in host 'markdown', embed 'html' in host 'markdown-inline',
and use local 'html_block'.
(markdown-ts-setup): Append html/yaml/toml to treesit-font-lock-settings
and treesit-font-lock-feature-list when their grammars are ready.
(markdown-ts-mode): Set comment-start/comment-end.
Set treesit-outline-predicate to 'markdown-ts-outline-predicate'.

* lisp/textmodes/toml-ts-mode.el
(toml-ts-mode--font-lock-feature-list): New variable.
(toml-ts-mode): Use it.

* lisp/textmodes/yaml-ts-mode.el
(yaml-ts-mode--font-lock-feature-list): New variable.
(yaml-ts-mode): Use it.
(yaml-ts-mode--outline-nodes): New variable.
(yaml-ts-mode--outline-predicate): Use it.

* lisp/treesit-x.el (liquid-generic-ts-mode):
Use 'treesit-ready-p' on optional 'yaml' grammar.
Merge 'yaml-ts-mode--font-lock-feature-list'.

(cherry picked from commit 1b0fe9b387ee4021b86f6fb120f5f7ed05367a9d)

2 months agoImprove elixir-ts--thing-settings.
Juri Linkov [Thu, 1 May 2025 18:03:34 +0000 (21:03 +0300)]
Improve elixir-ts--thing-settings.

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--thing-settings):
Add extra grouping "keywords" to named sexp nodes.
Add "," to anonymous sexp nodes.  Use bos/eos.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Use bos/eos for anonymous sexp nodes for better disambiguation.

* test/lisp/progmodes/heex-ts-mode-tests.el
(heex-ts-mode-test-indentation): Skip the test when 'elixir' is
missing since 'heex-ts-mode' depends on the 'elixir' grammar.

(cherry picked from commit cd557d6f6480cae81c39a451b2a2aaee720ba985)

2 months ago; * lisp/international/mule.el (define-coding-system): Doc fix.
Eli Zaretskii [Thu, 1 May 2025 18:02:39 +0000 (21:02 +0300)]
; * lisp/international/mule.el (define-coding-system): Doc fix.

(cherry picked from commit 7d02ffe87b401048fe10958cdc463f3bf7676ffd)

2 months agoAvoid adding duplicate items to 'treesit-language-source-alist'.
Juri Linkov [Thu, 1 May 2025 17:55:33 +0000 (20:55 +0300)]
Avoid adding duplicate items to 'treesit-language-source-alist'.

* lisp/textmodes/mhtml-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
Use 'add-to-list' on items in language-source-alist
that should check for duplicate items.

* test/infra/Dockerfile.emba: Move multi-language mhtml-ts-mode and
php-ts-mode to the end to give their dependent grammars a lower priority.

* test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation):
Skip the test when 'jsdoc' is missing since 'js-ts-mode' depends
on the 'jsdoc' grammar.

(cherry picked from commit 5684a3808677fb701833c83325cd3bc8de475561)

2 months ago; Skip commit 311ea96ccfae813f5cb55a5bc9a13be19c0a4127
Eshel Yaron [Sat, 10 May 2025 06:54:37 +0000 (08:54 +0200)]
; Skip commit 311ea96ccfae813f5cb55a5bc9a13be19c0a4127

2 months agoImplement C23 features:
Alan Mackenzie [Thu, 1 May 2025 16:12:18 +0000 (16:12 +0000)]
Implement C23 features:

Improve the handling of #error and #warning in C and C++ Modes.

* lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute)
(c-enclosing-c++-attribute, c-forward-sws, c-backward-sws):
Handle attributes in C as they have been handled in C++.
(c-forward-align-clause-throw-if-invalid): New macro.
(c-forward-type): Handle alignas, alignof, and _BitInt, putting
a catch block around most of the function to catch invalid uses
of these new keywords.
(c-in-id-arglist): New function.
(c-forward-decl-or-cast-1): Recognize a "maybe" type identifier
as a type in arglists when there is no parameter identifier
associated with it.

* lisp/progmodes/cc-fonts.el (c-font-lock-cpp-messages): New
function.
(c-cpp-matchers): Move the handling of "invalid" comment
delimiters outside of the block handling CPP directives.
Remove the inline handling of #error and #warning, using the
new function c-font-lock-cpp-messages instead.
(c-get-fontification-context): Handle alignof, alignas,
_BitInt.
(c-font-lock-declarations): Adapt fontification of K&R
parameters to the C23 nameless parameter scheme.

* lisp/progmodes/cc-langs.el (c-has-quoted-numbers)
(c-stmt-boundary-skip-chars)
(c-recognize-post-brace-list-type-p, c-modifier-kwds)
(c-constant-kwds): Handle C the same as the existing C++
handling.
(c-cpp-message-directives-re, noncontinued-line-end)
(c-cpp-messages-re, c-cpp-message-match-no): New
c-lang-consts/vars.
(c-cpp-include-directives): New directive embed.
(c-cpp-expr-directives): New directives elifdef, elifndef.
(c-primitive-type-kwds): New types, _Decimal*, bool, char*_t,
nullptr_t.
(c-typeof-kwds): New keyword typeof_unqual.
(c-type-with-paren-kwds, c-type-with-paren-key): New
c-lang-const/vars.
(c-type-modifier-with-parens-kwds)
(c-type-modifier-with-parens-key, c-type-internal-paren-kwds)
(c-type-internal-paren-key): New c-lang-const/vars.
(c-type-modifier-prefix-kwds, c-type-start-kwds): Amend with
the above new c-lang-consts.
(c-no-type-with-equals-kwds, c-no-type-with-equals-key): New
c-lang-const/vars.
(c-modifier-kwds): Add constexpr, auto, and thread_local to the
C value.
(c-paren-nontype-kwds): Add static_assert to the C value.
(c-constant-kwds): Add nullptr to the C value.
(c-regular-keywords-regexp): Include c-type-with-paren-kwds.
(c-recognize-nameless-type-decls): New c-lang-const/var.

* lisp/progmodes/cc-mode.el (c-leave-cc-mode-mode): Also clear
c-digit-separator properties.

(cherry picked from commit 8ddb8b0e45f150a5866c86af8ed2054b792761ff)

2 months ago; Fix last change
Michael Albinus [Thu, 1 May 2025 14:49:35 +0000 (16:49 +0200)]
; Fix last change

(cherry picked from commit b589fa9e23d896ce76b64016e0a5750f2131c393)

2 months ago; Fix wording of recently added documentation
Eli Zaretskii [Thu, 1 May 2025 14:42:12 +0000 (17:42 +0300)]
; Fix wording of recently added documentation

* lisp/window.el (display-buffer):
* doc/lispref/windows.texi (Buffer Display Action Alists): Fix wording.

(cherry picked from commit 75870a7ad184be7a8fe0a8e0497665a3b04cd6fa)

2 months ago; Fix sectioning of recent changes in the Emacs user manual
Eli Zaretskii [Thu, 1 May 2025 14:35:47 +0000 (17:35 +0300)]
; Fix sectioning of recent changes in the Emacs user manual

* doc/emacs/maintaining.texi (VC-Aware Project Backend):
* doc/emacs/emacs.texi (Top): Fix recent changes.

(cherry picked from commit 5cdcebc2ad0e55fa7b7e938a6860505a13f408bf)

2 months agoNew this-command buffer display action alist entry
Sean Whitton [Thu, 1 May 2025 12:55:56 +0000 (20:55 +0800)]
New this-command buffer display action alist entry

* lisp/subr.el (buffer-match-p): New this-command cons cell
condition to implement new this-command buffer display action
alist entry (bug#78082).
* lisp/window.el (display-buffer):
* doc/lispref/windows.texi (Buffer Display Action Alists):
* etc/NEWS: Document the new buffer display action alist entry.

(cherry picked from commit 343f0c44f35c41b93c66f67da0ddeceb98bbdb93)

2 months ago; Skip commit 7ae86074231159647d9bcb579dc5ea5a569acf0d
Eshel Yaron [Sat, 10 May 2025 06:53:28 +0000 (08:53 +0200)]
; Skip commit 7ae86074231159647d9bcb579dc5ea5a569acf0d

2 months agoImprove treesitter tests on emba
Michael Albinus [Thu, 1 May 2025 10:47:44 +0000 (12:47 +0200)]
Improve treesitter tests on emba

* test/infra/Dockerfile.emba (emacs-tree-sitter): Print language
versions.

* test/infra/gitlab-ci.yml (.job-template): Pass ${http_proxy},
${https_proxy} and ${no_proxy} to the docker call.
(.tree-sitter-template): Add some dependencies.

(cherry picked from commit ab67f684e92489da84bc6bb559e0d2dc0456d949)

2 months ago; Skip commit b9632a9049d07de3a0d6f0ae005a28b38825ff82
Eshel Yaron [Sat, 10 May 2025 06:53:15 +0000 (08:53 +0200)]
; Skip commit b9632a9049d07de3a0d6f0ae005a28b38825ff82

2 months agoImprove python-ts-mode fontification (bug#78129)
Jostein Kjønigsen [Thu, 20 Mar 2025 09:39:31 +0000 (10:39 +0100)]
Improve python-ts-mode fontification (bug#78129)

Fontification based on selectors & code-conventions:

- Lambda parameters: variable declarations
- For in statements: variable declarations
- Import statements: variable declerations
- Constants: All upper case alphanumerical identifiers
- Types: CamelCase alphanumerical identifiers
- Enums: Enum-values as constants.

* lisp/progmodes/python.el:
(python--treesit-settings): Improve queries.

(cherry picked from commit 2964d51c9cd9b55e60901069c378d0e8277d60f9)

2 months agoImprove csharp-ts-mode fontification (bug#78130)
Jostein Kjønigsen [Tue, 29 Apr 2025 12:23:56 +0000 (14:23 +0200)]
Improve csharp-ts-mode fontification (bug#78130)

Improves:
- fontification of generic types with namespace-prefixes
- function-call parameters
- variable use in string interpolation
- implicitly typed parameters in lambda-expressions
- index-expressions
- variables used in return-statements
- variables used in binary expressions

* lisp/progmodes/csharp-mode.el:
(csharp-ts-mode--font-lock-settings): Improve queries.

(cherry picked from commit 6c35ae082770c1bb875e870f83c3eff4a3197283)

2 months ago; Skip commit 15e77fe03a816e839a6af326cb7837518de0fd23
Eshel Yaron [Sat, 10 May 2025 06:52:56 +0000 (08:52 +0200)]
; Skip commit 15e77fe03a816e839a6af326cb7837518de0fd23

2 months agoFix compilation-mode matches for csharp-mode (bug#78128)
Jostein Kjønigsen [Fri, 25 Apr 2025 13:29:31 +0000 (15:29 +0200)]
Fix compilation-mode matches for csharp-mode (bug#78128)

* lisp/progmodes/csharp-mode.el:
(csharp-compilation-re-dotnet-error):
(csharp-compilation-re-dotnet-warning): Ignore leading whitespace.

(cherry picked from commit ebeaa728b66d0674fa499bf0bf2ae573ec9984aa)

2 months ago; Skip commit 1acb6454329ab66ef9f4b3f4a1937a7ab38121f7
Eshel Yaron [Sat, 10 May 2025 06:52:41 +0000 (08:52 +0200)]
; Skip commit 1acb6454329ab66ef9f4b3f4a1937a7ab38121f7

2 months ago; Skip commit eb6a50d3e3f3c348a7fbdb2dfcbf87425ca6e5cd
Eshel Yaron [Sat, 10 May 2025 06:52:11 +0000 (08:52 +0200)]
; Skip commit eb6a50d3e3f3c348a7fbdb2dfcbf87425ca6e5cd

2 months ago; Skip commit e1e052501b38e486343fc04fb5f5a6e29b3bcd11
Eshel Yaron [Sat, 10 May 2025 06:52:08 +0000 (08:52 +0200)]
; Skip commit e1e052501b38e486343fc04fb5f5a6e29b3bcd11

2 months ago(cl-types-of): Speed up by caching more of its work
David Ponce [Tue, 29 Apr 2025 14:48:37 +0000 (10:48 -0400)]
(cl-types-of): Speed up by caching more of its work

* lisp/emacs-lisp/cl-types.el (cl--type-parents): Make it a proper function.
(cl--type-children): Use `cl--class-children` and make it a `defsubst`.
(cl--type-dag): η-reduce and make it a `defsubst`.
(cl--type-undefine): Also reset `cl--type-error`.
(cl--type-deftype): Modify `cl--type-list` atomically so we never need
to restore it upon error.  Don't test bogus parent here.
(cl-deftype2): Test bogus parent here instead.  Also, better preserve
the declarations for the lambda.
(cl-types-of): Do less uncached work.

(cherry picked from commit 4323ff209f2f73ca4e6d389de69eb310988c0b1f)

2 months agolisp/emacs-lisp/cl-types.el: New file
Stefan Monnier [Mon, 28 Apr 2025 19:47:46 +0000 (15:47 -0400)]
lisp/emacs-lisp/cl-types.el: New file

* test/lisp/emacs-lisp/cl-types-tests.el: Also, new file.

(cherry picked from commit dfbeb7478ecd817f888927154858c380fb60390f)

2 months agoMinor cleanups
Eshel Yaron [Sat, 10 May 2025 06:50:13 +0000 (08:50 +0200)]
Minor cleanups

2 months agoEglot: tweak previous change (clear Flymake 'Wait' state)
João Távora [Wed, 30 Apr 2025 21:44:56 +0000 (22:44 +0100)]
Eglot: tweak previous change (clear Flymake 'Wait' state)

When we don't have anything to give to Flymake, we still want to
signal we're alive so the mode-line doesn't show a confusing
'Wait'.

* lisp/progmodes/eglot.el (eglot--report-to-flymake): Clear 'Wait'
state.

(cherry picked from commit dd5ae0f3ba56e762ae1265b0cb0fe9f2a28281ec)

2 months ago; Skip commit d6755ff1e146979731689585dc25a6e61fb4000e
Eshel Yaron [Thu, 1 May 2025 08:32:38 +0000 (10:32 +0200)]
; Skip commit d6755ff1e146979731689585dc25a6e61fb4000e

2 months ago; Skip commit ef5c7ec4990a603ff476e2266c31ea055ac0b609
Eshel Yaron [Thu, 1 May 2025 08:32:37 +0000 (10:32 +0200)]
; Skip commit ef5c7ec4990a603ff476e2266c31ea055ac0b609

2 months ago; Skip commit 4226eb2b20408ba49787195bbc59bb0066c9c9e4
Eshel Yaron [Thu, 1 May 2025 08:32:35 +0000 (10:32 +0200)]
; Skip commit 4226eb2b20408ba49787195bbc59bb0066c9c9e4

2 months ago; Skip commit b81f937e60b2fb499820e708d1ff4ba349df5f1a
Eshel Yaron [Thu, 1 May 2025 08:32:31 +0000 (10:32 +0200)]
; Skip commit b81f937e60b2fb499820e708d1ff4ba349df5f1a

2 months agoFix typo in bug#19867 correction (CC Mode indentation bugs)
Alan Mackenzie [Wed, 30 Apr 2025 18:51:37 +0000 (18:51 +0000)]
Fix typo in bug#19867 correction (CC Mode indentation bugs)

* lisp/progmodes/cc-align.el (c-lineup-item-after-paren-at-boi):
Replace an erroneous skip-syntax-backward with
skip-chars-backward.

(cherry picked from commit 766adfa8a731683c221630c3fee5aa5ace22428e)

2 months agoFix the match data in elisp-outline-search.
Juri Linkov [Wed, 30 Apr 2025 17:34:52 +0000 (20:34 +0300)]
Fix the match data in elisp-outline-search.

* lisp/progmodes/elisp-mode.el (elisp-outline-search):
Add 'save-match-data' since 'syntax-ppss' garbles the match data.

(cherry picked from commit b06046edcfceb6ba426880444894373f21ea4a79)

2 months ago* test/infra/Dockerfile.emba: Avoid duplication of tree-sitter data.
Juri Linkov [Wed, 30 Apr 2025 17:30:14 +0000 (20:30 +0300)]
* test/infra/Dockerfile.emba: Avoid duplication of tree-sitter data.

Require ts-mode files in order to add their tree-sitter grammar sources
to 'treesit-language-source-alist'.

(cherry picked from commit 85cd476a1408d2d87714d076144f9ad11cf3f31c)

2 months agoAdd python tree-sitter grammar data to 'treesit-language-source-alist'.
Juri Linkov [Wed, 30 Apr 2025 17:28:05 +0000 (20:28 +0300)]
Add python tree-sitter grammar data to 'treesit-language-source-alist'.

* lisp/progmodes/python.el (python-ts-mode):
Use 'treesit-ensure-installed' when it's fboundp.

(cherry picked from commit dbd168823794ef2173bb6eb894174bc0c1685cd9)

2 months ago; Skip commit 1284b6f1187be768e1af013339d7a228c6a8e84d
Eshel Yaron [Thu, 1 May 2025 08:32:05 +0000 (10:32 +0200)]
; Skip commit 1284b6f1187be768e1af013339d7a228c6a8e84d

2 months ago; Skip commit 826a83112964189b6049e288dbe8344a7362f29c
Eshel Yaron [Thu, 1 May 2025 08:31:57 +0000 (10:31 +0200)]
; Skip commit 826a83112964189b6049e288dbe8344a7362f29c

2 months ago; Skip commit b2904e064d023c3a6d19af58ffd8ce21342c794c
Eshel Yaron [Thu, 1 May 2025 08:31:44 +0000 (10:31 +0200)]
; Skip commit b2904e064d023c3a6d19af58ffd8ce21342c794c

2 months ago; Skip commit c43964d27aacc05be9cd6f42a1d8295a9b661551
Eshel Yaron [Thu, 1 May 2025 08:31:36 +0000 (10:31 +0200)]
; Skip commit c43964d27aacc05be9cd6f42a1d8295a9b661551

2 months ago; Skip commit 0fc6bd5c76a5e55401cf086e3b8fc6ed8eb32b94
Eshel Yaron [Thu, 1 May 2025 08:31:28 +0000 (10:31 +0200)]
; Skip commit 0fc6bd5c76a5e55401cf086e3b8fc6ed8eb32b94

2 months ago; Skip commit 1143a5273860fd6402aaf3fb6e1df39c31a3cc41
Eshel Yaron [Thu, 1 May 2025 08:30:51 +0000 (10:30 +0200)]
; Skip commit 1143a5273860fd6402aaf3fb6e1df39c31a3cc41

2 months ago; Skip commit 3044d16b81b80e79339faf30560d4db4c59b3a97
Eshel Yaron [Thu, 1 May 2025 08:30:29 +0000 (10:30 +0200)]
; Skip commit 3044d16b81b80e79339faf30560d4db4c59b3a97

2 months ago; Skip commit 573b377e8c57d60ea4fa881641ed0f851858fe8e
Eshel Yaron [Thu, 1 May 2025 08:30:12 +0000 (10:30 +0200)]
; Skip commit 573b377e8c57d60ea4fa881641ed0f851858fe8e

2 months ago; Skip commit 215246108e1d35f5172c76549c71ffae901ab840
Eshel Yaron [Thu, 1 May 2025 08:29:05 +0000 (10:29 +0200)]
; Skip commit 215246108e1d35f5172c76549c71ffae901ab840

2 months ago; Skip commit 3bc1c13661a334fedd8967188715cf85ef2af992
Eshel Yaron [Thu, 1 May 2025 08:28:48 +0000 (10:28 +0200)]
; Skip commit 3bc1c13661a334fedd8967188715cf85ef2af992

2 months ago; Skip commit fcaec1ff0d6be18d4fa3682401ced30741be6243
Eshel Yaron [Thu, 1 May 2025 08:28:43 +0000 (10:28 +0200)]
; Skip commit fcaec1ff0d6be18d4fa3682401ced30741be6243