1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-12 18:01:46 -07:00
Commit graph

12822 commits

Author SHA1 Message Date
Eli Zaretskii
69ac58b5d2 ; Avoid byte-compiler warnings in python.el
* lisp/progmodes/python.el (treesit-node-prev-sibling)
(treesit-node-field-name-for-child): Declare.
2025-09-25 20:06:12 +03:00
Yuan Fu
202425f934
Fix infloop in python-ts-mode string fontification (bug#79457)
* lisp/progmodes/python.el (python--treesit-fontify-string):
Make sure there's no infloop.
2025-09-24 19:59:05 -07:00
Yuan Fu
7b8c17d527
Fix python-ts-mode font-lock breakage by grammar change (bug#79457)
* lisp/progmodes/python.el (python--treesit-fontify-string): Use
new algorithm.
2025-09-22 16:41:06 -07:00
Roi Martin
85c42b3a87 Fix font lock in php-ts-mode
Fix font lock in php-ts-mode when the tree-sitter grammars are
automatically installed.  Also, update php-ts-mode to call the new
`mhtml-ts-mode--treesit-font-lock-settings' function.

* lisp/progmodes/php-ts-mode.el (php-ts-mode--keywords)
(php-ts-mode--operators): Generate the lists after the tree-sitter
grammars are installed.
(php-ts-mode--font-lock-settings, php-ts-mode--font-lock-settings-cached)
(php-ts-mode--custom-html-font-lock-settings)
(php-ts-mode--custom-html-font-lock-settings-cached): Evaluate the rules
after the tree-sitter grammars are installed.  Also, add cache for the
rules.
(php-ts-mode): Call the new
`php-ts-mode--custom-html-font-lock-settings' function.  (Bug#79363)
2025-09-22 18:11:39 +03:00
Po Lu
36635b934e Fix bootstrap and prevent browse-url from preloading numerous files
* lisp/keymap.el (read-only-keymap-filter)
(read-only-keymap-bind): New functions, removed from
browse-url.el.

* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): Move to keymap.el.  All callers
changed.
2025-09-22 09:42:34 +08:00
Juri Linkov
8a501c47a4 Support 'RET' for visiting URLs in read-only buffers (bug#74792)
* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): New functions.
(browse-url-button-map): Bind "C-c RET" to 'browse-url-button-open'
and rebind "RET" with the filter 'browse-url-keymap-bind'.

* lisp/ansi-osc.el (ansi-osc-hyperlink-map):
* lisp/net/goto-addr.el (goto-address-highlight-keymap):
* lisp/progmodes/bug-reference.el (bug-reference-map):
Bind "RET" with the filter 'browse-url-keymap-bind'.
2025-09-21 20:52:02 +03:00
Roi Martin
203faa6e42 Suffix tree-sitter cache variables with "-cached"
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--indent-rules)
(cmake-ts-mode--indent-rules-cached, cmake-ts-mode--font-lock-settings)
(cmake-ts-mode--font-lock-settings-cached):
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings)
(go-ts-mode--font-lock-settings-cached):
* lisp/progmodes/js.el (js--treesit-indent-rules)
(js--treesit-indent-rules-cached, js--treesit-font-lock-settings)
(js--treesit-font-lock-settings-cached): Suffix tree-sitter cache
variables with "-cached" (bug#79363).
2025-09-21 19:49:20 +03:00
Juri Linkov
49d8302b40 * lisp/progmodes/js.el: Obsolete 'js--treesit-sexp-nodes'.
(js--treesit-sexp-nodes): Set the default value to nil and make obsolete.
(js--treesit-thing-settings): Instead of using
'js--treesit-sexp-nodes', define a list of named and anonymous nodes
that don't match the 'sexp' thing (bug#79465).
2025-09-20 21:20:04 +03:00
Elías Gabriel Pérez
071cdb66fd Add hideable indicators for hideshow. (Bug#79294)
* doc/emacs/programs.texi (Hideshow): Update documentation.
* etc/NEWS: Announce changes.
* lisp/progmodes/hideshow.el (hs-show-indicators)
(hs-indicator-type, hs-indicator-maximum-buffer-size): New user
options.
(hs-indicator-hide, hs-indicator-show): New icons.
(hs-block-positions, hs--make-indicators-overlays)
(hs-indicator-mouse-toggle-hidding, hs--add-indicators)
(hs--refresh-indicators): New functions.
(hs-hide-block-at-point): Use hs-block-positions.
(hs-inside-comment-p): Use 'get-char-property' instead of
'hs-overlay-at'.
(hs-minor-mode): Rework.
2025-09-20 12:58:31 +03:00
Alan Mackenzie
ea01e59eb1 CC Mode: Don't indent a construct in a class after a template
This fixes bug#79438.

* lisp/progmodes/cc-align.el (c-lineup-class-field-cont): New
function.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Change the
entry for class-field-cont from + to
c-lineup-class-field-cont.

* doc/misc/cc-mode.texi (Misc Line-Up): Add a new entry for
c-lineup-class-field-cont.
2025-09-19 20:51:45 +00:00
Roi Martin
79b7c7b1d3 Fix font lock and indentation in js-ts-mode
Fix font lock and indentation in js-ts-mode when the tree-sitter grammar
is automatically installed (Bug#79363).
* lisp/progmodes/js.el (js--treesit-indent-rules)
(js--treesit-font-lock-settings): Evaluate the rules only after the
tree-sitter grammar is installed.
(js-ts-mode): Call the new `js--treesit-indent-rules' and
`js--treesit-font-lock-settings' functions.
2025-09-18 09:20:56 +03:00
Jostein Kjønigsen
2135e7aa01
Fixes for csharp-ts-mode fontification (bug#79406)
- hightlight reserved keywords agressively, dont allow misuse as
  variables etc (the compiler will fail!)
- highlight lambda-valued variables as funtions.
- improve semantics of function/class annotations using attributes
  (maps closer to using-something than declaring it). also: rename to
  "attribute". "property" has a different, defined meaning in C#.
- better highlight variable-use in different scenarios (function-calls,
  if-statements, assignment-expressions, property-use, anonymous object
  initializers).
- better highlight for property-use (anonymous object initializers).
- highlight field-declaration using font-lock-variable-face.
- fontify attributes using new face csharp-ts-mode-attribute-face
  (defaults to font-lock-property-use-face).
- remove extensive use of "override" making evalutation hard-to-reason about.

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules):
Update indent rules.
(csharp-ts-mode-faces): New group.
(csharp-ts-mode-attribute-face): New face.
(csharp-ts-mode--font-lock-settings): Rule updates.
(csharp-ts-mode): Change property feature to attribute
2025-09-16 19:07:16 -07:00
Michael Albinus
0000d9b7b1 ; Fix last change in php-ts-mode.el
* lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist):
Fix quoting.
2025-09-16 09:10:04 +02:00
Dmitry Gutov
76f50fa55c ruby-syntax-propertize: Add exception for /=
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Create an exception for assign-division operator not to be
recognized as regexp start (bug#79454).

* test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add example.
2025-09-16 02:17:13 +03:00
Vincenzo Pupillo
3438e15e31 Fix tree-sitter ABI version incompatibility in php-ts-mode
* lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist):
For ABI version < 15 add the recommended version "v0.23.12" (full hash
"f7cf7348737d8cff1b13407a0bfedce02ee7b046").
2025-09-15 21:20:52 +02:00
Eli Zaretskii
0dd6e5f642 Fix gdb-mi startup when asking user about debuginfod
* lisp/progmodes/gdb-mi.el (gdb-init-1): Delay processing of GDB
responses while waiting for the user to answer the question about
enabling debuginfod.  (Bug#79403)
2025-09-14 08:55:44 +03:00
Vincenzo Pupillo
abfd8a454a Add support for PHP 8.5 in 'php-ts-mode.el'
* lisp/progmodes/php-ts-mode.el: Doc string update.
(php-ts-mode--language-source-alist): PHP grammar update.
(php-ts-mode-find-sibling-rules): Doc string fix.
(php-ts-mode--parent-html-heuristic): Handled the case where there
is no HTML between two blocks of PHP code.
(php-ts-mode--array-element-heuristic): Fix typo.
(php-ts-mode--pipe-heuristic): New function that handle PHP's new
pipe operator.
(php-ts-mode--indent-styles): Removed commented code.  More
accurate indentation of ‘member_call_expression’.  Use of new
function to handle pipe operator indentation.  New rule for
indenting ‘property_hook_list’.
(php-ts-mode--test-yield-from-p): New predicate to check whether
the 'yield from' keyword is supported by the PHP grammar.
(php-ts-mode--test-pipe-p): New predicate to check whether the
‘pipe’ operator is supported by the PHP grammar.
(php-ts-mode--keywords): Use the new predicate
'php-ts-mode--test-yield-from-p'.  Now it is a var instead of a
const.
(php-ts-mode--operators): Use the new predicate
'php-ts-mode--test-pipe-p'.  Now it is a var instead of a const.
(php-ts-mode--font-lock-settings): New rules for
'nullsafe_member_access_expression', 'callable' primitive type.
New rule for the 'php_end_tag' if supported by the grammar.
More precise rules for 'scoped_call_expression' and
'member_call_expression'.
(php-ts-mode--inferior-php-process): Removed this unnecessary
variable.
(inferior-php-ts-mode-startup): Removed the use of
'php-ts-mode--inferior-php-process'.
(php-ts-mode-inferior--write-history): Removed the use of
'php-ts-mode--inferior-php-process'.
(Bug#79339)
2025-09-13 12:41:55 +03:00
Stefan Monnier
2954234f8f (scheme-mode-variables): Fix bug#79282
* lisp/progmodes/scheme.el (scheme-mode-variables): Re-install
`lisp-font-lock-syntactic-face-function` mistakenly removed
in commit 0a5cfeeecb.
2025-09-10 19:05:15 -04:00
Dmitry Gutov
a060bdec82 Better 'project-buffer' completion category defaults in Emacs <= 30
* lisp/progmodes/project.el: Fall back to adding 'project-buffer'
to 'completion-category-defaults' if 'define-completion-category'
is not available (bug#79409).
2025-09-10 02:26:31 +03:00
Eshel Yaron
6b6cfa8e40
; * lisp/progmodes/project.el: Restore backward compatibility. 2025-09-08 17:30:52 +02:00
Sean Whitton
15939846a0 Make C-x v w w work in Log View mode, to change working directory
* lisp/vc/diff-mode.el (diff-find-matching-buffer): Rename ...
* lisp/progmodes/project.el
(project-change-to-matching-directory): ... to here.  All uses
changed.
* lisp/vc/log-view.el (project-change-to-matching-directory):
Declare.
(log-view-mode): Use it.
* doc/emacs/vc1-xtra.texi (Other Working Trees): Document the
change.
2025-09-08 11:50:36 +01:00
Jostein Kjønigsen
5be32aa047 csharp-mode: indentation fixes (bug#79398)
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules):
Adjust rules to fix the following incorrect behaviours:
- in multiline expressions/method call chains;
- in object initialization expressions;
- in array creation expressions.
2025-09-07 20:55:06 +03:00
Roi Martin
765dfb225a Fix grammar installation in elixir-ts-mode and heex-ts-mode
Fix tree-sitter grammar installation issues in elixir-ts-mode and
heex-ts-mode (Bug#79363).
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings):
Check that tree-sitter is available.
(elixir-ts-mode): If the user answers "no" to installing the heex
tree-sitter grammar, do not ask again.  Group heex settings.
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode): Ensure that elixir
tree-sitter grammar is installed.
2025-09-07 20:43:41 +03:00
Roi Martin
445d6d5921 Fix font lock in go-ts-mode
Fix font lock in go-ts-mode when the tree-sitter grammar is
automatically installed (Bug#79363).
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Evaluate the rules only after the tree-sitter grammar is installed.
(go-ts-mode): Call the new `go-ts-mode--font-lock-settings' function.
2025-09-07 20:43:39 +03:00
Roi Martin
86cc48e45e Fix font lock and indentation in cmake-ts-mode
Fix font lock and indentation in cmake-ts-mode when the tree-sitter
grammar is automatically installed (Bug#79363).
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--indent-rules)
(cmake-ts-mode--font-lock-settings): Evaluate the rules only after the
tree-sitter grammar is installed.
(cmake-ts-mode): Call the new `cmake-ts-mode--indent-rules' and
`cmake-ts-mode--font-lock-settings' functions.
2025-09-07 20:43:36 +03:00
Dmitry Gutov
c36259e479 project--read-project-buffer: Fix creating new buffer
* lisp/progmodes/project.el (project--read-project-buffer):
Fix the case of entering new buffer name (bug#77312).
2025-09-07 04:56:00 +03:00
Spencer Baugh
2a1f9f8dfe Fix nil value of 'elisp-flymake-byte-compile-executable'
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile--executable): Properly check for
nil, and simplify code.  (Bug#79380)
2025-09-06 18:33:32 +03:00
Brian Leung
e06684067d Eglot: Really fix neocmakelsp invocation
* lisp/progmodes/eglot.el (eglot-server-programs): Remove an
incorrect extra layer of parentheses.  (Bug#79394)
2025-09-06 16:42:33 +03:00
Eli Zaretskii
ab5e0f5359 Fix command keys in doc string of 'inferior-python-mode'
* lisp/progmodes/python.el (inferior-python-mode): Mention the
correct mode-map in the doc string.  (Bug#79386)
2025-09-06 12:20:58 +03:00
Gustav Hållberg
7b09f8bb7c "M-x lldb": bugfix source code location without column
* lisp/progmodes/gud.el (gud-lldb-marker-filter): Fix problem
where the source code location ends up at the last character of
the previous line if no (or zero) column is reported by lldb.
(Bug#79360)

Copyright-paperwork-exempt: yes
2025-09-06 12:04:30 +03:00
Eli Zaretskii
20a9129349 ; Fix 'elisp-flymake-byte-compile-executable' defcustom
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile-executable): Fix :type.
2025-09-05 14:29:37 +03:00
Eshel Yaron
60a22185b7
Support completion category inheritance
* lisp/minibuffer.el (define-completion-category): New function.
(completion-category-get): New function, implements completion
category property lookup with (multiple) inheritance.
(completion-metadata-get, completion--styles)
(completion--cycle-threshold): Use it.
(completion-category-defaults): Mention it in docstring.
Remove entry for 'project-buffer' category, and instead...
* lisp/progmodes/project.el: ...have 'project-buffer' inherit
from 'buffer'.
* test/lisp/minibuffer-tests.el
(completion-category-inheritance): New test.
* etc/NEWS: Announce support for category inheritance.
2025-09-03 21:01:43 +02:00
João Távora
5db70442e5 Eglot: really fix bug#79259
The previous change actually introduced a bug in a closely
related but distinct place.  We need to address the off-by-one
in the 'substring' call, not the 'add-face-text-property'.

* lisp/progmodes/eglot.el (eglot--sig-info): Fixup.
2025-09-03 08:16:15 +01:00
Eli Zaretskii
90350729be ; Improve error message in elisp-mode.el
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile--executable): Improve the error message.
2025-09-02 17:45:46 +03:00
Eli Zaretskii
a6dd36e9b1 ; Fix last change
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile-executable): Doc fix.
2025-09-02 14:05:14 +03:00
Spencer Baugh
45c5b636ce Add 'elisp-flymake-byte-compile-executable' defcustom
The correct Emacs executable to use for
'elisp-flymake-byte-compile' is not necessarily the running
Emacs.  For example, when editing trunk with Emacs 30,
various Lisp changes will cause spurious flymake warnings.
Add 'elisp-flymake-byte-compile-executable' to allow
customizing this.
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile-executable)
(elisp-flymake-byte-compile--executable): Add.  (Bug#79342)
(elisp-flymake-byte-compile): Invoke
'elisp-flymake-byte-compile--executable'.

* etc/NEWS: Announce the change.
2025-09-02 13:58:46 +03:00
João Távora
53f5a07beb Eglot: fix likely off-by-1 in LabelOffsetSupport feature (bug#79259)
This feature was tweaked and last tested with a 2019 edition of
the 'ccls' LSP.  The spec does not clearly specify this number
to be 0-indexed, but it would make sense that it would be so.
So there's not need to 1+ - correct the numbers at all before
using them in substring.  This would fix the Haskell server use
of this feature (which is bug#79259)

* lisp/progmodes/eglot.el (eglot--sig-info): Fix likely off-by-1.
2025-08-30 11:44:56 +01:00
Steven Allen
4ab16d701e Eglot: escape literal % characters in URIs
Escape literal % characters in Eglot URIs

Otherwise, a literal % in a file-name will be interpreted (by the
language server) as if it were a part of a percent-encoded sequence.

See Bug#78984 for context on why `url-path-allowed-chars' cannot be
changed to escape literal % characters.

* lisp/progmodes/eglot.el (eglot--uri-path-allowed-chars): Escape %,
remove the redundant variable definition.
* test/lisp/progmodes/eglot-tests.el (eglot-test-path-to-uri-escape):
test it.
2025-08-30 11:19:19 +01:00
john muhl
34f3ac6c5b Fontify all comment delimiters in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts--comment-font-lock):
Apply 'font-lock-comment-delimiter-face' to the entire span of
initial dashes.  In particular, this improves the appearance of
LuaCATS and EmmyLua style annotations which use "---".
* test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua:
Add tests.  (Bug#79258)
2025-08-30 11:31:34 +03:00
Juri Linkov
b8ad7c38ae * lisp/progmodes/python.el: Use 'treesit-major-mode-remap-alist'.
(python-ts-mode): Don't duplicate 'auto-mode-alist' and
'interpreter-mode-alist' settings in Emacs 31 (bug#79180).
Add ts-mode mapping to 'treesit-major-mode-remap-alist'.
2025-08-29 19:27:32 +03:00
john muhl
bba28b744c Make 'lua-prefix-key' option a 'key-sequence'
This fixes a failure in 'test-custom-opts' caused by both strings
and integers being used for 'lua-prefix-key'.

* lisp/progmodes/lua-mode.el (lua-prefix-key): Convert option to
'key-sequence' type.
(lua-mode-map, lua-prefix-key-update-bindings, lua-set-prefix-key)
(lua--customize-set-prefix-key): Adjust to the change of type for
'lua-prefix-key'.
(lua-prefix-mode-map): Use 'defvar-keymap'.  (Bug#79335)
2025-08-29 09:47:24 +02:00
Dmitry Gutov
088c531754 ruby-flymake-simple: Refine further
* lisp/progmodes/ruby-mode.el (ruby-flymake-simple):
Relax regexp but limit allowed characters (bug#79257).
2025-08-28 03:18:56 +03:00
john muhl
f908d854d6 ; Various code cleanup in 'lua-mode' (Bug#79309)
* lisp/progmodes/lua-mode.el (lua-indent-level): Contemporary Lua
style guides no longer recommend 3 as default. Change type to
'natnum'.
(lua-always-show, lua-get-block-token-info)
(lua--backward-up-list-noerror, lua-make-indentation-info-pair)
(lua-accumulate-indentation-info)
(lua-calculate-indentation-block-modifier): Quote function names.
(lua-toggle-electric-state): Re-format to avoid confusion.
(lua-is-continuing-statement-p-1): Fix typo.
(lua--builtins): Move docstring to correct location.
(lua-is-continuing-statement-p-1): Remove unnecessary 'or'.
(lua-make-lua-string): Remove excessive backslashes and
unnecessary use of a temporary buffer.
(lua-find-matching-token-word): Make it clear that 'goto-char' is
only used only for its side-effect.
2025-08-27 10:05:49 +02:00
john muhl
6b0b70233a ; ruby-flymake-simple: Only match relative file name (bug#79257) 2025-08-27 00:09:41 +03:00
john muhl
54bd2264d3 Fix 'ruby-flymake-simple' for Ruby 3.4 (Bug#79257)
* lisp/progmodes/ruby-mode.el (ruby-flymake-simple): Update
regular expression to handle new versions of Ruby including the
location of the executable in the output.
2025-08-26 02:21:10 +03:00
Andre A. Gomes
e1ee5c6289 Pass remote name explicitly in bug-reference-try-setup-from-vc.
* lisp/progmodes/bug-reference.el (bug-reference-setup-from-vc-alist):
Add comment explaining the meaning of the nil argument when calling
vc-call-backend.  Even though "origin" and nil are equivalent when using
the git backend, it is more intelligible to see "upstream" and "origin"
passed explicitly (bug#79276).
2025-08-25 16:09:53 +02:00
Juri Linkov
c934a4188b * lisp/progmodes/lua-ts-mode.el: Simplify non-ts/ts mode mapping.
(lua-ts-mode-maybe): Remove since lua-mode is added to core.
2025-08-25 09:33:10 +03:00
john muhl
c042611106 Add warn to 'lua-mode' builtins
* lisp/progmodes/lua-mode.el (lua--builtins): Include warn.
2025-08-25 09:59:04 +08:00
john muhl
22e3ba30fa ; Improve compliance of 'lua-mode'
* lisp/progmodes/lua-mode.el: Fix byte-compiler warnings, placate
checkdoc and improve consistency of comment formatting.
2025-08-25 09:59:04 +08:00
john muhl
7fabc65484 ; Update comments & requires in 'lua-mode' 2025-08-25 09:59:04 +08:00