Variable names to control indentation have never been
standardized, but over the years some conventions have naturally
arisen, mostly the use of `FOO-indent-offset`,
`FOO-basic-offset`, or `FOO-indent-level` for `FOO-mode`.
When the new TS modes were introduced, a mistake was made that
I failed to catch at the time, where those modes used
`FOO-mode-indent-offset` instead of the "standard" `FOO-indent-offset`.
In order to save packages like `editorconfig-mode` and `indent-bars-mode`
from having to cater to yet-another-convention, rename those
vars to what they should have been all along.
* lisp/editorconfig.el (editorconfig-indentation-alist): Remove the
ad-hoc entries for the deviating modes using `FOO-mode-indent-offset`.
* lisp/textmodes/toml-ts-mode.el (toml-ts-indent-offset):
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-js-css-indent-offset)
(mhtml-ts--js-css-indent-offset):
* lisp/textmodes/html-ts-mode.el (html-ts-indent-offset):
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-indent-offset):
* lisp/progmodes/php-ts-mode.el (php-ts-indent-offset)
(php-ts-js-css-indent-offset, php-ts-html-indent-offset):
* lisp/progmodes/json-ts-mode.el (json-ts-indent-offset):
* lisp/progmodes/java-ts-mode.el (java-ts-indent-offset)
(java-ts-method-chaining-indent-offset):
* lisp/progmodes/go-ts-mode.el (go-ts-indent-offset):
* lisp/progmodes/csharp-mode.el (csharp-ts-indent-offset):
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-indent-offset):
* lisp/progmodes/c-ts-mode.el (c-ts-indent-offset):
Rename `FOO-mode-indent-offset` to `FOO-indent-offset`,
with obsolete alias.
Emacs 28 started fontifying several 'composite' (non-builtin) GNU M4
macros which, while listed under '(m4) Macro index', are not defined
by GNU M4, and are included in its manual for illustrative purposes.
These macro keywords range from clearly misleading (e.g., 'example',
which the GNU M4 manual explicitly describes as nonexistent),
to common in Autoconf's M4sugar layer (e.g., 'm4_quote'),
to variations thereof (e.g., 'foreachq').
It is arguably too late to revert all of these additions, so this
patch selects a handful to remove, and categorizes the rest; this
should make it easier to hide some categories behind a font lock
level or user option in the future, if desired.
This patch reverts the Emacs 28 addition of 'example', and removes
the older 'file', 'line', and 'gnu' macros. GNU M4 renamed 'gnu' to
'__gnu__' already in 1990; and I couldn't find references to the
other two which exist as '__file__' and '__line__', respectively.
The remaining macros are partitioned into three sets: built-in,
M4sugar-like, and other (bug#80412). For discussion, see also:
https://lists.gnu.org/r/emacs-devel/2025-10/msg00357.html
* lisp/progmodes/m4-mode.el (m4-program-options): Remove stale
commentary.
(m4--macro-list): Remove, replacing with...
(m4--builtin, m4--autoconf, m4--composite): ...these new rx
definitions. All uses changed. Remove 'example', 'file', 'gnu',
and 'line' as keywords.
(m4-font-lock-keywords): For consistency with real #-comments,
fontify dnl macro with font-lock-comment-delimiter-face, and only
the rest of its line with font-lock-comment-face. Fontify argument
references with font-lock-variable-use-face rather than
font-lock-variable-name-face. Use font lock faces rather than their
eponymous but obsolete variables. Remove redundant entries for $@
and $*. Prefer shy regexp groups where applicable.
(m4-mode-syntax-table): Quote syntactically special characters.
(m4-m4-buffer): DRY using m4-m4-region.
(m4-m4-region): Take region bounds as optional arguments, as
recommended under '(elisp) The Mark'. Quote shell command.
Support non-contiguous regions.
(m4-current-defun-name): Recognize m4 backtick in addition to
Autoconf bracket. Prefer shy regexp groups where applicable.
(m4-mode): Simplify font-lock-defaults.
* test/lisp/progmodes/m4-mode-resources/font-lock.m4:
* test/lisp/progmodes/m4-mode-tests.el: New test files.
The custom Pdb class enables native completion in pdb by
wrapping the pdb's native completer. It also makes necessary
function definitions like __PYTHON_EL_* available between pdb
frames, and enables non-native completion/ffap/eldoc
functionalities when debugging inside python modules.
* lisp/progmodes/python.el (python-shell-send-setup-code): Fix
the separator between python-shell-setup-codes.
(python-shell-completion-native-setup): Move common completion
setup code ...
(python-shell-completion-setup-code): ... here.
(python-shell-completion-at-point): Enable native completion for
pdb and respect the delimiter of pdb completer.
(python-shell-pdb-setup-code): New variable.
(python-shell-comint-watch-for-first-prompt-output-filter): Send
setup codes only once.
(python-ffap-module-path, python-eldoc--get-doc-at-point): Stop
sending setup code in every function call.
* test/lisp/progmodes/python-tests.el (python-tests--pdb-1)
(python-shell-pdb-1): New test.
* etc/NEWS: Mention the change. (bug#80182)
* lisp/progmodes/project.el (vc-git-project-list-files): Prefer
git ls-files --deduplicate, available since Git 2.31 (2021), over
delete-consecutive-dups. Prefer string-prefix-p and string-suffix-p
over slower and more error-prone regexp matching. Prefer
string-match-p over string-match when either will do.
* lisp/progmodes/python.el: Since they are included in emacs 29.1,
remove the Package-Requires for seq, project, and flymake.
(require 'project): Remove 'noerror argument.
(python-shell-get-process-name): Remove (featurep 'project).
Use 'project-name'.
(run-python)
(python--import-sources): Remove (featurep 'project). (Bug#80405)
* lisp/progmodes/project.el (project--delete-zombie-projects):
Bind tramp-error-show-message-timeout to nil, to instruct Tramp
not to display the "failed to connect" and its message, hiding the
current prompt (bug#80340).
project-try-vc--search in a submodule directory tries to find the git
root directory, so the local variable root would be set to nil if it
didn't exist. Calling project--vc-merge-submodules-p on nil would lead
to a crash, so now the while loop aborts beforehand.
* lisp/progmodes/elisp-mode.el
(elisp--highlight-function-argument): Handle special usage
syntax correctly when scanning usage arguments using
'forward-sexp' (bug#8432). Before binding 'origin', skip over
blanks, so as not to highlight them, and to move immediately
before any possible opening square brackets. After binding
'origin' and before calling 'forward-sexp', skip over opening
square brackets, so as to highlight them. After calling
'forward-sexp' and before setting 'start' and 'end', skip over
closing square brackets and periods, so as to highlight them.
* lisp/progmodes/elisp-mode.el
(elisp--highlight-function-argument): Use 'forward-sexp' to move
over usage arguments, handling parenthesized argument patterns
monolithically (bug#8432). Set 'start' and 'end' to the
beginning and end, respectively, of the usage argument.
* lisp/progmodes/elisp-mode.el
(elisp--highlight-function-argument): Insert 'args' into
temporary buffer to prepare for better handling of usage
arguments (bug#8432). Move point after the first opening
parenthesis of the arguments string. In the loop, let `origin'
track the point. No functional change.
* lisp/vc/vc-hooks.el (vc-find-backend-function): Require vc for
default implementations (bug#80254). Report and fix due to
Daniel Mendler <mail@daniel-mendler.de>.
* lisp/progmodes/make-mode.el (makefile-make-font-lock-keywords)
(makefile-makepp-font-lock-keywords): Use `font-lock-*-face`
faces rather than variables.
* lisp/progmodes/project.el: Describe the new cache in Commentary,
the "VC-aware project" section.
(project-vc-cache-timeout)
(project-vc-non-essential-cache-timeout): New variables.
(project--get-cached, project--set-cached):
New functions.
(project-try-vc, project--value-in-dir): Use them.
(project--read-dir-locals): New function, extracted from the
above. Return the full alist, to be saved to cache at once.
(project--clear-cache): New function.
(project-remember-projects-under)
(project-forget-zombie-projects, project-forget-projects-under):
Use it.
(project-uniquify-dirname-transform, project-mode-line-format):
Bind 'non-essential' to choose the longer caching strategy.
(project-name-cache-timeout, project-name-cached): Remove.
(project-mode-line-format): Switch to calling 'project-name'
directly, with the new caching in use.
Co-authored-by: Juri Linkov <juri@linkov.net>
* lisp/progmodes/project.el (project--remove-from-project-list):
Don't call 'abbreviate-file-name', expect it to be abbreviated
already. The file might be on an inaccessible filesystem.
(project-current): Call abbreviate-file-name here (bug#80340).
This is an alternative language server for Haskell. Intended to be
faster and not use as much memory as haskell-language-server.
Making it a backup with lower precedence if both exist.
* lisp/progmodes/eglot.el (eglot-server-programs): Add "static-ls".
(Bug#80351)
* lisp/progmodes/python.el
(python-shell-get-project-name): New function.
(python-shell-get-process-name): Use it. (Bug#80045)
Co-authored-by: Liu Hui <liuhui1610@gmail.com>
* lisp/progmodes/etags.el (etags--xref-backend):
Move the definition to autoloads, so that etags.el doesn't have to
be loaded before it really is used.
* lisp/progmodes/xref.el (xref-find-backend):
Allow returning nil (bug#43086).
(xref-backend-definitions, xref-backend-apropos):
Signal user-error when no backend is available. The error text
suggests a few built-in Xref backends.
(xref-backend-identifier-completion-table): Default to nil.
(xref--no-backend-available): New helper function.
* lisp/progmodes/etags.el (etags--xref-backend):
Return nil when no tags table is visited.
Just because a specific request of a specific "hint" is
cancelled doesn't mean we can cancel the other's too. Also
eglot-advertise-cancellation = nil was subtly broken.
This manifested itself mostly in Eglot semantic tokens.
* lisp/progmodes/eglot.el (eglot--async-request): Fix thinkos.
* lisp/progmodes/elisp-mode.el (elisp-byte-code-syntax-propertize):
Reset point to just after the start of the previous match so that we
don't skip past the end of the lazy string, which can happen if it's
zero-length; that could lead to an infinite loop.
This is exclusively for the benefit of rust-analyzer, which
sends publishDiagnostics for all project files upfront, and
never republishes them on 'didOpen'.
See https://github.com/joaotavora/eglot/issues/1531.
* lisp/progmodes/eglot.el (eglot--flymake-handle-push): Simplify.
Don't flymake-list-only-diagnostics here.
Save original diagnostic in flymake-list-only-diagnostics setting.
(eglot--on-shutdown): Cleanup flymake-list-only-diagnostics.
(eglot--flymake-report-push+pulled): Hack in data from
flymake-list-only-diagnostics.
* lisp/progmodes/xref.el (xref--parse-hits, xref--sort-hits):
Extract from xref-matches-in-directory and xref-matches-in-files.
Use in both for better consistency between these functions.
Optionally use find and grep directly instead of going through the
Semantic framework (bug#80246).
* lisp/progmodes/project.el (project--vc-ignores): Require 'vc' to
ensure that vc-default-ignore-completion-table is available.
* lisp/progmodes/xref.el (xref-references-in-directory-function):
New user option.
(xref-references-in-directory): Call it.
(xref-references-in-directory-grep): Implementation based on find/grep.
(xref-references-in-directory-semantic): Implementation using Semantic.
(xref-matches-in-directory): Add new argument DELIMITED.
Co-authored-by: Dmitry Gutov <dmitry@gutov.dev>
* lisp/progmodes/eglot.el (eglot--format-server-message): New helper.
(eglot-handle-notification<window/showMessage>)
(eglot-handle-request<window/showMessageRequest>): Use it.
* lisp/progmodes/python.el (python-ts-mode):
Set 'treesit-sexp-thing-down-list' to 'list' to override
sexp navigation with list navigation (bug#72478).
* lisp/emacs-lisp/lisp.el (up-list): Mention 'up-list-function' in docstring.
* lisp/progmodes/json-ts-mode.el (json-ts--get-path-at-node)
(json-ts--path-to-jq, json-ts--path-to-python): New functions.
(json-ts-jq-path-at-point): New command for getting JSON path at point.
* test/lisp/progmodes/json-ts-mode-tests.el: New file.
Add tests for the utility command.
* etc/NEWS: Announce new command 'json-ts-jq-path-at-point' (bug#80190).
Some language servers request file watching for a very large number of
directories (e.g. Python virtualenvs), which can exhaust system
resources and cause slow startup.
https://github.com/joaotavora/eglot/issues/1568
* lisp/progmodes/eglot.el (eglot-max-file-watches): New variable.
(eglot--count-file-watches): New function.
(eglot--watch-globs): Use them to limit watches. Signal jsonrpc-error
when limit is reached.
(eglot-watch-files-outside-project-root): Fix docstring punctuation.
* etc/EGLOT-NEWS: Mention change.
Now also accepts file operation kinds as keys in the alist form.
* lisp/progmodes/eglot.el (eglot-confirm-server-edits): Rework
default value, docstring and defcustom type.
(eglot--confirm-server-edits): Also check for operation-kind-based
entries.
The current 2026 landscape suggests servers (especially gopls
and ocamllsp) take advantage of this, so let's give it to them
by default.
* lisp/progmodes/eglot.el (eglot-advertise-cancellation):
Default to t.
* etc/EGLOT-NEWS: Mention change.