aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Better way to fix bug#70036João Távora2024-04-181-5/+12
| | | | | | | | | | | | | | Cache a new eglot--cached-tdi var per buffer, which contains value to return from eglot--TextDocumentIdentifier. This avoids frequent expensive recomputation of a value that requires potentially many 'file-truename' calls. This technique is used in a number of other cases already, like eglot--recent-changes or eglot--versioned-identifier. * lisp/progmodes/eglot.el (eglot--cached-tdi): New variable. (eglot--TextDocumentIdentifier): Tweak. (eglot--signal-textDocument/didOpen): Clear eglot--cached-tdi.
* Revert "Don't use file-truepath in Eglot (bug#70036)"João Távora2024-04-181-24/+18
| | | | | | | | | | | | | | | | | This reverts commit 08c80c45ddea17df87fc768a39dff353ccc13d3b. It introduces bugs when a project contains symlinked files. The server will be informed of duplicate documents which are really the same and it frequently has no means to deduplicate such information. This leads to bugs such as excessive textDocument/references to a function. * lisp/progmodes/eglot.el (eglot-lsp-server): Revert change. (eglot-uri-to-path): Revert change. (eglot--on-shutdown): Revert change. (eglot--managed-mode): Revert change. (eglot-handle-notification textDocument/publishDiagnostics): Revert change.
* ; Alphabetize go-ts-mode's treesit-font-lock-feature-listRandy Taylor2024-04-181-1/+1
| | | | | * lisp/progmodes/go-ts-mode.el (go-ts-mode): Rearrange features to keep alphabetical order. (Bug#70362)
* Add YANG LSP support to EglotSiddharth Sharma2024-04-181-1/+2
| | | | | | | * lisp/progmodes/eglot.el (eglot-server-programs): Add 'yang-language-server' and 'json-ts-mode'. (Bug#70364) Copyright-paperwork-exempt: yes
* ; Minor change in last commitEli Zaretskii2024-04-181-10/+10
| | | | | * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Rearrange features to keep alphabetical order. (Bug#70362)
* Add font-locking for Go built-in functions in go-ts-modeNoah Peart2024-04-181-1/+16
| | | | | | * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Add font-locking for Go built-in functions to 'go-ts-mode'. (Bug#70362)
* Flymake support for indicating errors in marginElias G. B. Perez2024-04-181-15/+119
| | | | | | | | | | | | | | | | | | | | | | Add optional support for display flymake error in margin, this allow displaying error indicators in both graphical and terminal frames. * doc/misc/flymake.texi (Customizable variables) (Flymake error types): Document new margin indicator. * etc/NEWS: Announce the new Flymake user option for margin indicators. * lisp/progmodes/flymake.el (flymake-indicator-type) (flymake-margin-indicators-string, flymake-autoresize-margins) (flymake-margin-indicator-position): New user options. (flymake--original-margin-width): Add buffer-local variable for store original buffer margin width. (flymake-error, flymake-warning, flymake-note): Use new margin value. (flymake--indicator-overlay-spec): Rework and Rename from flymake--fringe-overlay-spec. (flymake--resize-margins): Add new function for resize margin width. (flymake--highlight-line, flymake-mode): Rework.
* Fix sending input to SQL when point is not at EOBEli Zaretskii2024-04-181-0/+2
| | | | | | * lisp/progmodes/sql.el (sql-send-string): Move point to EOB before sending input to the SQL process. Suggested by Gary Hollis <ghollisjr@gmail.com>. (Bug#69420)
* Document earlier change in eglot-report-progressTheodor Thornhill2024-04-171-1/+4
| | | | | | * lisp/progmodes/eglot.el (eglot-report-progress): Document the changed behavior. * etc/EGLOT-NEWS (https): Mention the change.
* eglot.el: Remove accidentally included debugging codeStefan Monnier2024-04-171-3/+0
| | | | | * lisp/progmodes/eglot.el (eglot--signal-textDocument/didChange): Remove leftover debug message.
* track-changes.el: Minor changes for version 1.0Stefan Monnier2024-04-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Arrange for the library to be usable on older Emacsen, which includes reducing the noise when `before/after-change-functions` are badly paired or missing. Also, since the signal function receives the distance (for `:disjoint`), we don't need `track-changes--disjoint-threshold`: the signal function can simply do nothing when the distance is smaller than the threshold it wants to use. * lisp/emacs-lisp/track-changes.el: Prepare header for ELPA. (track-changes--tracker, track-changes--state): Don't use `:noinline`, so as to be compatible with Emacs<27. (track-changes-record-errors): New variable. (track-changes--recover-from-error): Use it. Record only the last 20 keys and the last 50 stack frames in the error log. (track-changes--disjoint-threshold): Delete variable. (track-changes--before): Don't use it any more. * lisp/progmodes/eglot.el (eglot--track-changes-signal): Coalesce disjoint changes nearer than what used to be coalesced because of `track-changes--disjoint-threshold`.
* ; Improvements to PEG documentation (second attempt)Eric Abrahamsen2024-04-161-3/+4
| | | | | | | * doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to clarify the relationships between the various macros and functions. * lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be a single list of rules.
* Revert "; Improvements to PEG documentation"Mattias Engdegård2024-04-161-4/+3
| | | | | This reverts commit 930c578c1042e6372e5433e31b2ea801315c01c9. Looks like an editing mistake ate a large part of the text.
* Add font-locking for operators in go-ts-mode (bug#70361)Noah Peart2024-04-151-0/+4
| | | | | * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Add font-locking rule for Go operators.
* ; Improvements to PEG documentationEric Abrahamsen2024-04-151-3/+4
| | | | | | | * doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to clarify the relationships between the various macros and functions. * lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be a single list of rules.
* ; Capitalize 'project' in project-name's docstringDmitry Gutov2024-04-151-1/+1
|
* CC Mode: Don't start fontifying in the middle of an identifierAlan Mackenzie2024-04-141-1/+1
| | | | | | | | This fixes bug#70367. * lisp/progmodes/cc-mode.el (c-fl-decl-start): After searching backwards for the end of the previous statement, check whether or not we found it.
* peg-tests.el: Fix test failuresStefan Monnier2024-04-131-8/+6
| | | | | | | | | | | | | * lisp/progmodes/peg.el (peg-parse): Refine heuristic since unknown terminals are resolved at run-time rather than compile-time now. (peg--macroexpand) <stack-action>: Avoid generating a `let` with an empty body. (peg--translate-rule-body): Adjust to name change of `macroexp-warn-and-return` and the fact that it's always available. * test/lisp/progmodes/peg-tests.el (peg-parse-string): Add `indent` declaration. (peg-test): Check that the compiler emits the warnings we expect.
* Merge branch 'track-changes'Stefan Monnier2024-04-131-4/+60
|\
| * lisp/emacs-lisp/track-changes.el: New file (bug#70077)Stefan Monnier2024-04-131-4/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new package provides an API that is easier to use right than our `*-change-functions` hooks. The patch includes changes to `diff-mode.el` and `eglot.el` to make use of this new package. * lisp/emacs-lisp/track-changes.el: New file. * test/lisp/emacs-lisp/track-changes-tests.el: New file. * doc/lispref/text.texi (Tracking changes): New subsection. * lisp/progmodes/eglot.el: Require `track-changes`. (eglot--virtual-pos-to-lsp-position): New function. (eglot--track-changes): New var. (eglot--managed-mode): Use `track-changes-register` i.s.o `after/before-change-functions` when available. (eglot--track-changes-signal): New function, partly extracted from `eglot--after-change`. (eglot--after-change): Use it. (eglot--track-changes-fetch): New function. (eglot--signal-textDocument/didChange): Use it. * lisp/vc/diff-mode.el: Require `track-changes`. Also require `easy-mmode` before the `eval-when-compile`s. (diff-unhandled-changes): Delete variable. (diff-after-change-function): Delete function. (diff--track-changes-function): Rename from `diff-post-command-hook` and adjust to new calling convention. (diff--track-changes): New variable. (diff--track-changes-signal): New function. (diff-mode, diff-minor-mode): Use it with `track-changes-register`.
* | ; Additional fixup for truncation of long lines in compilation buffersPhil Sainty2024-04-141-4/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/compile.el (compilation--insert-abbreviated-line): Handle long lines that end in a newline. (Bug#70236) The fix in commit 8f93cba324e4d4022a9422b8c56186213ba2de8d resulted in the previous "Don't hide the final newline" code causing an off-by-one error. With the new code the value of point is what is wanted in both cases.
* | Merge from origin/emacs-29Eli Zaretskii2024-04-132-3/+14
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f0300fb0597 ; Tweak "(emacs)Bug Reference" formatting/wording. ea62a14ea3b Fix display of vscrolled windows 4cefa3c0b1f ; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#... db7b571aaaf ; Improve documentation of 'world-clock' 6a0bb7beae3 * doc/emacs/misc.texi (emacsclient Options): Suggest forw... 859b4227e3d Update go-ts-mode to support latest tree-sitter-go grammar 407e85ce139 Fix c++-ts-mode defun navigation (bug#65885) aca5064f128 ; Fix last change. 55aab2d4710 ; * etc/PROBLEMS: An entry about focus issues with XFCE (... 19cee16576e ; * doc/emacs/misc.texi (emacsclient Options): Fix typo. ... 2a41b6ba514 ; * src/filelock.c (Flock_file): Doc fix (bug#70216).
| * | Update go-ts-mode to support latest tree-sitter-go grammarYuan Fu2024-04-091-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tree-sitter-go changed method_spec to method_elem in https://github.com/tree-sitter/tree-sitter-go/commit/b82ab803d887002a0af11f6ce63d72884580bf33 * lisp/progmodes/go-ts-mode.el: (go-ts-mode--method-elem-supported-p): New function. (go-ts-mode--font-lock-settings): Conditionally use method_elem or method_spec in the query.
| * | Fix c++-ts-mode defun navigation (bug#65885)Yuan Fu2024-04-081-1/+3
| | | | | | | | | | | | | | | * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add BOL and EOL marker in the regexp.
* | | Mark Flymake regions more accurately in 'lua-ts-mode'john muhl2024-04-131-27/+26
| | | | | | | | | | | | | | | | | | * lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use the end position provided by Luacheck rather than relying on 'thing-at-point' to guess where the end should be. (Bug#70167)
* | | (emacs-lisp-mode-syntax-table): Fix bug#24542Stefan Monnier2024-04-121-3/+4
| | | | | | | | | | | | | | | * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table): Remove `p` from the flags of `@`.
* | | etags-regen--tags-generate: Handle spaces in project root nameEli Zaretskii2024-04-111-1/+1
| | | | | | | | | | | | | | | * lisp/progmodes/etags-regen.el (etags-regen--tags-generate): Quote the tags file name (bug#70329).
* | | Don't hide flymake diagnostics on empty first line (bug#70310)Mattias Engdegård2024-04-111-2/+7
| |/ |/| | | | | | | | | | | | | A diagnostic first in the buffer, typically the lexical cookie warning, got lost if that line was empty. * lisp/progmodes/elisp-mode.el (elisp-flymake--byte-compile-done): Make sure the location interval doesn't go beyond the buffer bounds.
* | ; Minor copy editsDmitry Gutov2024-04-092-2/+2
| |
* | Add Flymake backend to rust-ts-mode using ClippyDmitry Gutov2024-04-091-1/+79
| | | | | | | | | | | | | | | | | | * lisp/progmodes/rust-ts-mode.el (rust-ts-flymake-command): New option (bug#70260). (rust-ts--flymake-proc): New variable. (rust-ts-flymake--helper): New function. (rust-ts-flymake): New function. (rust-ts-mode): Add it to flymake-diagnostic-functions.
* | Merge branch 'mouse-wheel-buttons'Stefan Monnier2024-04-091-8/+10
|\ \
| * | (mouse-wheel-buttons): Map old-style wheel buttons to actual wheel eventsStefan Monnier2024-04-091-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the handling of the old X11 convention that uses mouse-4/5/6/7 events to represent wheel events: instead of asking downstream packages to use the `mouse-wheel-*-event` variables to know which events represent wheel events, use new var `mouse-wheel-buttons` to directly convert those events into the standard `wheel-up/down/left/right` events used everywhere else. This will simplify the work of packages which can thus just bind their commands to `wheel-up/down/left/right`. * lisp/mouse.el (mouse-wheel-buttons): New custom variable. * src/keyboard.c (make_lispy_event): Adjust for "wheel-clicks" on the tab-bar. * src/xterm.c (x_construct_mouse_click): Add `xi2` argument and obey `mouse-wheel-buttons` variable. (handle_one_xevent): Adjust calls accordingly. (syms_of_xterm): Define the `mouse-wheel-buttons` and the `wheel-up/down/left/right`symbols. * lisp/xt-mouse.el: Don't require `mwheel` any more. (xterm-mouse--same-button-p): Delete function. (xterm-mouse--read-event-sequence): Use `mouse-wheel-buttons`. * lisp/mwheel.el (mouse-wheel-up-event, mouse-wheel-down-event) (mouse-wheel-left-event, mouse-wheel-right-event): Make obsolete. (mouse-wheel-obey-old-style-wheel-buttons): Delete variable. * lisp/completion-preview.el (completion-preview--mouse-map): * lisp/progmodes/flymake.el (flymake--mode-line-counter-map): * lisp/edmacro.el (edmacro-fix-menu-commands): Silence warnings.
* | | Inhibit flymake lexical cookie warning in *scratch* (bug#70068)Mattias Engdegård2024-04-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a hack to prevent flymake from complaining about a missing lexical cookie when enabled in *scratch*. * lisp/emacs-lisp/bytecomp.el (bytecomp--inhibit-lexical-cookie-warning): New variable. (byte-compile-file): Use it to gate the warning. * lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile): Set the inhibitor when spawning a check in lisp-interaction-mode.
* | | Fix truncation of long lines in compilation buffersEli Zaretskii2024-04-071-18/+23
| | | | | | | | | | | | | | | | | | * lisp/progmodes/compile.el (compilation--insert-abbreviated-line): Handle long lines that end in a newline. (Bug#70236)
* | | Merge from origin/emacs-29Eli Zaretskii2024-04-061-1/+9
|\ \ \ | | |/ | |/| | | | | | | 46b8746b38e Fix warning-suppress for list type "warning type" 910ea5f1e55 Make object init more robust (bug#69571)
| * | Make object init more robust (bug#69571)Theodor Thornhill2024-03-311-1/+9
| | | | | | | | | | | | | | | | | | * lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Make the regex same as before, but conditionally check other heuristics rather than crazy regex shenanigans.
* | | (project-current): Fix the previous changeSpencer Baugh2024-04-051-2/+2
| |/ |/| | | | | | | * lisp/progmodes/project.el (project-current): Fix the previous change (bug#69584).
* | Don't use file-truepath in Eglot (bug#70036)Theodor Thornhill2024-04-031-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `file-truepath' is slow because of recursive calls and being implemented in lisp. It seems to not be needed in eglot, but it is used behind the scenes in `find-buffer-visiting', thus appearing in profiles. Moving the implementation to a hash map will yield similar performance benefits, but wouldn't require us to rewrite `file-truename' in C. * lisp/progmodes/eglot.el (eglot-lsp-server): Convert 'managed-buffers' to a hashmap. (eglot-uri-to-path): Don't use file-truepath, as it is too slow to be included in the hot path. (eglot--on-shutdown): Use buffers from buffer map. (eglot--managed-mode): Add buffer to map, rather than list. Also remove it from the map on deactivation. (eglot-handle-notification): Expose server and get buffer from the buffer map.
* | (scheme-syntax-propertize-sexp-comment): Allow `#;` in stringsPo Lu2024-04-011-12/+21
| | | | | | | | | | | | * lisp/progmodes/scheme.el (scheme-syntax-propertize-sexp-comment): Don't get confused by `#;` inside strings and (normal) comments. (scheme-sexp-comment-syntax-table): Comment-out, unused.
* | Native JSON support is always availableMattias Engdegård2024-04-011-7/+1
| | | | | | | | | | | | * lisp/progmodes/sh-script.el (sh--json-read): Remove. (sh-shellcheck-flymake): Call json-parse-buffer directly. * test/src/json-tests.el: Don't check for function availability.
* | (scheme-syntax-propertize-sexp-comment): Handle nested sexp-commentsStefan Monnier2024-04-011-10/+33
| | | | | | | | | | | | | | | | | | Well, I'm not completely sure this will work right in all cases, because I've been confused about this in the past. It works in my test case, at least. * lisp/progmodes/scheme.el (scheme-syntax-propertize-sexp-comment): Look for nested `#;` and mark them appropriately.
* | (scheme-syntax-propertize-sexp-comment): Remove unused argumentniceume2024-04-011-3/+3
| | | | | | | | | | | | * lisp/progmodes/scheme.el (scheme-syntax-propertize-sexp-comment): Remove first arg, unused. (scheme-syntax-propertize): Adjust calls accordingly.
* | scheme.el: Enable dealing with regular expression literalniceume2024-04-011-1/+26
| | | | | | | | | | * lisp/progmodes/scheme.el (scheme-syntax-propertize-regexp): New function. (scheme-syntax-propertize): Use it.
* | Add peg.el as a built-in libraryEric Abrahamsen2024-03-301-0/+944
| | | | | | | | | | | | * lisp/progmodes/peg.el: New file, taken from ELPA package. * test/lisp/peg-tests.el: Package tests. * doc/lispref/peg.texi: Documentation.
* | Disable workDoneProgress if defcustom is nilTheodor Thornhill2024-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | There is no need to receive the $/progress notifications from the server if we don't want to render them. Because they are effectively ignored when eglot-report-progress is nil we'd rather not waste cycles on serde of the messages. * lisp/progmodes/eglot.el (eglot-client-capabilities): use value from defcustom to decide whether or not to advertise to server.
* | Fix typo in docstringTheodor Thornhill2024-03-301-1/+1
| | | | | | | | | | * lisp/progmodes/eglot.el (eglot-lsp-server): eglot-current-server is now exposed.
* | Merge from origin/emacs-29Eli Zaretskii2024-03-301-0/+1
|\ \ | |/ | | | | | | | | 946d4aad1df Avoid errors in Info-search-case-sensitively in DIR buffers fbf68302999 Add test for previous change (bug#70023) bcf6dd6e266 Add typescript-ts-mode indentation for interface bodies (...
| * Add typescript-ts-mode indentation for interface bodies (bug#70023)Noah Peart2024-03-281-0/+1
| | | | | | | | | | | | * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Add indentation rule for interface bodies.
* | Fix a typo in flymake.elEli Zaretskii2024-03-281-1/+1
| | | | | | | | | | * lisp/progmodes/flymake.el (flymake--update-eol-overlays): Use 'save-restriction', not 'save-excursion'. (Bug#69984)
* | (project-current): Add binding for 'non-essential'Dmitry Gutov2024-03-281-1/+2
| | | | | | | | | | * lisp/progmodes/project.el (project-current): Add binding for 'non-essential' (bug#69584).