aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use the new error API functionsfeature/error-APIStefan Monnier2 days1-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/epa-file.el (epa-file--find-file-not-found-function): Use `error-slot-value` and `error-data`. (epa-file-insert-file-contents): Use `error-has-type-p`, `error-slot-value`, and `error-data`. * lisp/jka-compr.el (jka-compr-insert-file-contents): Use `error-has-type-p` and `error-slot-value` as well as new re-signaling form of `signal`. * lisp/simple.el (minibuffer-error-function): Use `error-has-type-p`. * lisp/startup.el (startup--load-user-init-file): Use `error-message-string`. (command-line): Use `error-has-type-p` and `error-message-string`. * lisp/type-break.el (type-break-demo-life): Use `error-message-string`. * lisp/emacs-lisp/bytecomp.el (batch-byte-compile-file): Use `error-message-string` and `error-has-type-p`. * lisp/emacs-lisp/edebug.el (edebug-safe-eval, edebug-report-error) (edebug-eval-expression): * lisp/emacs-lisp/debug.el (debugger-eval-expression): Use `error-message-string`. * lisp/emacs-lisp/ert.el (ert--should-error-handle-error): Use `error-has-type-p` and `error-type`. * lisp/net/sasl.el (sasl-error): Use `define-error`. * lisp/net/tramp-compat.el (tramp-error-type-p): New function. (tramp-permission-denied, tramp-compat-permission-denied): Use it. * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Use `error-type-p`.
* Improve Python setup codes to avoid leaving global nameskobarity4 days1-13/+21
| | | | | * lisp/progmodes/python.el (python-shell-setup-code) (python-shell-readline-detect): Improve Python code. (Bug#80551)
* (flymake-start): Give a bit more info in the logStefan Monnier7 days1-2/+4
| | | | | * lisp/progmodes/flymake.el (flymake-start): Log the reason why it's disabled when not starting a backend.
* Rename 'any' to 'member-if' and deprecate 'cl-member-if'Sean Whitton7 days1-7/+7
| | | | | | | | | | | | * lisp/subr.el (any): Rename from this ... (member-if): ... to this. All uses changed. (any): New function alias. * lisp/emacs-lisp/cl-seq.el (cl-member-if): Mark obsolete. * lisp/obsolete/cl.el (member-if): Delete obsolete function alias. * doc/lispref/lists.texi (List Elements): * doc/misc/cl.texi (Lists as Sets): * etc/NEWS: Document the change.
* Revert "Rename 'any' to 'member-if' and deprecate 'cl-member-if'"Mattias Engdegård8 days1-7/+7
| | | | | | This reverts commit 2bdf15f6d8293b21234cd236f39ce68f62e1f6c3. There is no consensus for this change.
* Merge branch 'master' of git.sv.gnu.org:/srv/git/emacsMichael Albinus8 days3-40/+52
|\
| * eglot.el: Avoid `%s` for composite objectsStefan Monnier8 days1-18/+21
| | | | | | | | | | | | | | | | | | | | * lisp/progmodes/eglot.el (eglot--check-object, eglot--check-dspec) (eglot-shutdown-all, eglot--connect, eglot--lsp-position-to-point) (eglot--read-server, eglot-handle-notification, eglot-handle-request): Avoid `%s` for composite objects. (eglot--connect, eglot--format): Use `fboundp` rather than `functionp` to check if something is defined. (eglot--sig-info): Prefer `point-min`.
| * CC Mode: Handle mixed symbols and non-symbols in regexpsAlan Mackenzie8 days1-15/+24
| | | | | | | | | | | | | | | | | | This fixes bug#80507. * lisp/progmodes/cc-defs.el (c-make-keywords-re): When a mixed list of symbols and non-symbols is presented to this function, put "\_< .... \_>" brackets around the part which handles the symbols in the resulting regexp.
| * Rename 'any' to 'member-if' and deprecate 'cl-member-if'Sean Whitton8 days1-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/subr.el (any): Rename from this ... (member-if): ... to this. All uses changed. Implement '&key KEY-FN' for backwards compatibility. (any): New function alias. * lisp/emacs-lisp/cl-seq.el (cl-member-if): Make an alias for 'member-if'. * lisp/obsolete/cl.el (member-if): Delete obsolete function alias. * doc/lispref/lists.texi (List Elements): * doc/misc/cl.texi (Lists as Sets): * etc/NEWS: Document the change.
* | Fix grep defaultsMichael Albinus8 days1-16/+19
|/ | | | | * lisp/progmodes/grep.el (grep-compute-defaults): Quote "xargs" only for local hosts, running MS Windows. (Bug#80489)
* sh-script: Mark + and * as punctuation rather than a symbol constituentJames Cherti9 days1-0/+2
| | | | | | | | | | | | | | | | In Bash, the characters + and * are not valid in variable names. In sh, they are also disallowed in both function and variable names. Treating them as punctuation is appropriate, as they most commonly appear as operators. Examples: . Arithmetic: $((var1*var2)) . Compound assignment: list_name+=("item") * lisp/progmodes/sh-script.el (sh-mode-syntax-table): Mark + and * as punctuation in the syntax table. (Bug#80280) Copyright-paperwork-exempt: yes
* ; Explain some details about rust-panic rule (bug#80403)Mattias Engdegård10 days1-1/+5
|
* Add Rust panic message pattern (bug#80403)Jacek Świerk10 days1-0/+12
| | | | | | | | | | * etc/compilation.txt: Add example. * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): New rule. * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data) (compile-test-error-regexps): Add test case. Copyright-paperwork-exempt: yes
* Better project-find-file error in empty projectBasil L. Contovounesios11 days1-1/+4
| | | | | | | | | * lisp/progmodes/project.el (project--read-file-name): Signal a user-error and don't call project-read-file-name-function if the file name collection is empty, since the default options for project-read-file-name-function expect a cons (bug#80509). (project-find-file-in): Avoid redundant consing for vc-directory-exclusion-list in default case of include-all=nil.
* ; Avoid byte-compilation warning in c-ts-common.elEli Zaretskii13 days1-6/+6
| | | | | * lisp/progmodes/c-ts-common.el (c-ts-common-comment-start-skip): Move up to avoid byte-compiler warning.
* Make c-ts-common-comment-start-skip publicYuan Fu13 days1-4/+4
| | | | | | | * lisp/progmodes/c-ts-common.el: (c-ts-common-comment-start-skip): Change to public. (c-ts-common-comment-2nd-line-anchor): (c-ts-common-comment-setup): Use it.
* c-ts-mode: Don't assume comment-start-skip is setArsen Arsenović13 days1-4/+8
| | | | | | | | | | | | | | | | | | | This patch makes it easier to use the existing C and C++ language support in other languages. Without this patch, if the outer mode sets some specific and more accurate comment-start-skip value, or perhaps leaves it unset, indentation will break. * lisp/progmodes/c-ts-common.el (c-ts-common--comment-start-skip): Declare to the value c-ts-common-comment-setup used to set as comment-start-skip. (c-ts-common-comment-setup): Use it, rather than hardcoding. (c-ts-common-comment-2nd-line-anchor): Use it, rather than comment-start-skip. This makes it easier to reuse C/++ indentation rules in other TS modes for embedding C/++ segments in other languages. Copyright-paperwork-exempt: yes
* Fix arguments to project--buffer-check when reading a project bufferSteven Allen2026-02-231-4/+4
| | | | | | * lisp/progmodes/project.el (project--read-project-buffer): Pass the buffer object to `project--buffer-check', not the (BUF-NAME . BUF-OBJ) cons.
* Fix broken `FOO-mode-indent-offset` conventionStefan Monnier2026-02-229-213/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Improve m4-mode font lockBasil L. Contovounesios2026-02-221-46/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use a custom Pdb class in the Python shellLiu Hui2026-02-211-127/+155
| | | | | | | | | | | | | | | | | | | | | | | | 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)
* Use git ls-files --deduplicate in project.el (bug#80409)Basil L. Contovounesios2026-02-201-13/+14
| | | | | | | | * 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.
* Remove (featurep 'project) guards in python.elkobarity2026-02-191-10/+5
| | | | | | | | | | * 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)
* project--delete-zombie-projects: Bind tramp-error-show-message-timeout to nilDmitry Gutov2026-02-171-9/+11
| | | | | | | * 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.el: Fix in submodules with nonexistent git root (bug#80402)Heinz Fridolin2026-02-151-0/+1
| | | | | | | 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.
* elisp--highlight-function-argument: Handle special syntax correctlyVili Aapro2026-02-151-0/+3
| | | | | | | | | | | | | * 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.
* elisp--highlight-function-argument: Use forward-sexpVili Aapro2026-02-151-4/+7
| | | | | | | | * 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.
* elisp--highlight-function-argument: Use temporary bufferVili Aapro2026-02-151-26/+30
| | | | | | | | | * 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.
* Fix project-buffers error on buffers with nil default-directoryYikai Zhao2026-02-151-3/+3
| | | | | * lisp/progmodes/project.el (project-buffers): Check that default-directory is non-nil (bug#80390).
* vc-find-backend-function: Require vc for default implementationsSean Whitton2026-02-141-1/+1
| | | | | | * 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>.
* Fix 'eglot-imenu'Eli Zaretskii2026-02-141-1/+1
| | | | | | | | * lisp/progmodes/eglot.el (eglot--imenu-SymbolInformation): Fix call to 'plist-get'. Patch by Lester Longley <lester@ieee.org>. (Bug#80367) Copyright-paperwork-exempt: yes
* Eglot: fix neocmakelsp invocationJoão Távora2026-02-131-1/+1
| | | | | | See https://github.com/joaotavora/eglot/issues/1578 * lisp/progmodes/eglot.el (eglot-server-programs): Fix neocmakelsp
* Revert "Use 'project-name-cached' in 'python-shell-get-process-name'"kobarity2026-02-131-12/+5
| | | | | | | This reverts commit 482748592f61abed6f675e7b62b2d56e4e18a146. Commit 583a112169f0c964552b94f84ea0c942377a14e6 removed 'project-name-cached' and also resolved bug#80045.
* make-mode.el: Avoid obsolete font-lock-*-face` variablesStefan Monnier2026-02-111-9/+9
| | | | | | * lisp/progmodes/make-mode.el (makefile-make-font-lock-keywords) (makefile-makepp-font-lock-keywords): Use `font-lock-*-face` faces rather than variables.
* Improve project-vc-*cache-timeout docstringsDmitry Gutov2026-02-101-4/+6
| | | | | * lisp/progmodes/project.el: (project-vc-cache-timeout) (project-vc-non-essential-cache-timeout): Improve docstrings (bug#78545).
* Do cache and timed invalidation in "VC-aware" project backendDmitry Gutov2026-02-101-35/+98
| | | | | | | | | | | | | | | | | | | | | | | * 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>
* Amend previous to avoid remote call in project--remove-from-project-listDmitry Gutov2026-02-101-2/+3
| | | | | | | * 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).
* project--delete-zombie-projects: Handle "Tramp failed to connect"Dmitry Gutov2026-02-091-1/+6
| | | | | * lisp/progmodes/project.el (project--delete-zombie-projects): Handle file-error when DIR is remote and unreachable (bug#80340).
* Eglot: Add "static-ls" to Haskell LSP listMatthew Bauer2026-02-081-1/+2
| | | | | | | | 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)
* Change the type of 'python-eldoc-function-timeout' to numberkobarity2026-02-071-1/+1
| | | | | | * etc/NEWS: Announce the change. * lisp/progmodes/python.el (python-eldoc-function-timeout): Change the type. (Bug#80045)
* Use 'project-name-cached' in 'python-shell-get-process-name'kobarity2026-02-071-5/+12
| | | | | | | | * 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>
* Revert "Performance improvement of 'python-shell-get-process'"kobarity2026-02-071-20/+1
| | | | | | This reverts commit 83b4f1ba26844c178e57ecb93ea8db36e8e6fa89. We concluded that it is better to use 'project-name-cached'. (Bug#80045)
* etags-regen--build-program-options: Expand the error message textDmitry Gutov2026-02-071-1/+1
| | | | | * lisp/progmodes/etags-regen.el (etags-regen--build-program-options): Expand the error message text.
* etags--xref-backend: Move the definition to autoloadsDmitry Gutov2026-02-071-1/+5
| | | | | | * 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.
* Allow using xref-find-references without visiting a tags tableDmitry Gutov2026-02-062-10/+17
| | | | | | | | | | | | | * 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.
* Eglot: fix thinko in eglot--async-requestJoão Távora2026-02-051-12/+15
| | | | | | | | | | 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: slightly better rescanning pointMattias Engdegård2026-02-011-1/+1
| | | | Suggested by Stefan Monnier.
* Fix lazy doc string fontify bug in elisp-byte-code-mode (bug#80292)Mattias Engdegård2026-01-311-1/+3
| | | | | | | * 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.
* Eglot: recall diagnostics froms unopened files on session startJoão Távora2026-01-301-9/+24
| | | | | | | | | | | | | | | 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/eglot.el (eglot-server-programs): Use "elp" for erlang-mode.Juri Linkov2026-01-301-1/+1
| | | | | erlang_ls has been archived in favour of erlang-language-platform. Suggested by Alan & Kim Zimmerman <alan.zimm@gmail.com> (bug#79943).