summaryrefslogtreecommitdiff
path: root/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Bump Eglot version to 1.10João Távora2022-12-161-2/+2
| | | | | * lisp/progmodes/eglot.el (Version): Bump to 1.10 (Package-Requires): Bump required versions of jsonrpc and project.
* Eglot: fix discrepant eglot-guess-contact/eglot-command-historyJoão Távora2022-12-161-1/+1
| | | | | | | | | | | | | | | | Due to a typo, the defvar eglot--command-history wasn't actually used in eglot-guess-contact as intended. That function used a single-dash-name version of the variable instead. This worked fine, except that two variables were created instead of one, and the one actually being used didn't have any docstring. Rename the variable to eglot-command-history to fix this. It's better than renaming the reference in eglot-guess-contact which would lose user's history for M-x eglot. * lisp/progmodes/eglot.el (eglot-command-history): Rename from eglot--command-history.
* Avoid recursive process filters in lisp/jsonrpc.el (bug#60088)João Távora2022-12-161-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | jsonrpc.el may lose JSON-RPC messages because of recursive process filters. The problem happens in jsonrpc.el's jsonrpc--process-filter. The code of the process filter didn't expect to be called recursively and fails in that case. But that can happen if the three conditions are verified. 1. the client code invoked by its jsonrpc--connection-receive inside the process filter callee immediately sends follow-up input to process within the same Lisp stack. This is a common scenario, especially during LSP initialiation sequence used by Eglot, a jsonrpc.el client. 2. that follow-up message is large enough for process-send-string to send the input in bunches (output from processes can arrive in between bunches). 3. the process happens to have already some more output ready The fix in this commit detects recursive invocations and immediately re-schedules them as non-recursive calls to the jsonrpc--process-filter (but started from timers). * lisp/jsonrpc.el (jsonrpc--process-filter): Rework. (Version): Bump to 1.0.16.
* ; Fix typosStefan Kangas2022-12-1611-15/+15
|
* Add lambda_expression-rule to java-ts-mode (bug#60091)Theodor Thornhill2022-12-151-0/+1
| | | | | * lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New rule.
* eglot: Add support for new language server csharp-lsJostein Kjønigsen2022-12-161-1/+3
| | | | | | | | C# has two popular language servers: Omnisharp Roslyn (already supported) and csharp-ls (newer, more performant). * lisp/progmodes/eglot.el: Add new C# language server csharp-ls. (Bug#60089)
* Use the new tree-sitter commandsYuan Fu2022-12-153-42/+66
| | | | | | | | | | | | * lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-valid-p) (c-ts-mode--defun-skipper): New functions. (c-ts-base-mode): Setup defun navigation. * lisp/progmodes/sh-script.el (bash-ts-mode): Setup defun navigation. * lisp/treesit.el (treesit-beginning-of-defun) (treesit-end-of-defun): Change to new implementation, which is intended to be used as commands. (treesit-major-mode-setup): Setup remap for beginning/end-of-defun commands.
* Add "function" feature to python-ts-mode (bug#59977)Yuan Fu2022-12-151-3/+11
| | | | | | * lisp/progmodes/python.el (python--treesit-settings): Add feature. (python-ts-mode): Add feature. And fix indentation for the python-indent-guess-indent-offset code.
* Add go-ts-mode and go-mod-ts-mode (Bug#60025)Randy Taylor2022-12-152-1/+356
| | | | | | | | | * admin/notes/tree-sitter/build-module/batch.sh: * admin/notes/tree-sitter/build-module/build.sh: Add go-mod support. * etc/NEWS: Mention them. * lisp/progmodes/eglot.el (eglot-server-programs): Add them. * lisp/progmodes/go-ts-mode.el: New major modes with tree-sitter support.
* Add basic support for hideshow in python-ts-mode (bug#60044)Yuan Fu2022-12-151-13/+15
| | | | | * lisp/progmodes/python.el (python-base-mode): Add setup for python-ts-mode.
* Add "this" keyword to java-ts-mode (bug#60086)Theodor Thornhill2022-12-151-3/+4
| | | | | | * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): Add the node to the keyword feature.
* When completing relative project file names, use relative historyDmitry Gutov2022-12-161-1/+9
| | | | | | | | | | * lisp/progmodes/project.el: Require 'cl-lib'. * lisp/progmodes/project.el (project--read-file-cpd-relative): Pre-process history entries around completing-read (bug#58447). This includes both filtering by common-parent-directory prefix and mapping into relative names.
* Avoid segfaults due to invalid selected-window's bufferEli Zaretskii2022-12-152-2/+7
| | | | | | | | * lisp/startup.el (initial-scratch-message): Don't use \\[...] commands for substitute-command-keys. * lisp/simple.el (get-scratch-buffer-create): Don't call substitute-command-keys on initial-scratch-message, to avoid signaling an error in rare cases. (Bug#60096)
* Revert 21b387c39bd with last-minute hasty changes (bug#60048).Juri Linkov2022-12-151-71/+1
| | | | | * lisp/simple.el (completion-list-mode-map): Unbind [up] and [down]. (previous-line-completion, next-line-completion): Remove.
* Replace an erroneous eq with an equal in cc-defs.elAlan Mackenzie2022-12-151-1/+1
| | | | | * lisp/progmodes/cc-defs.el (c-looking-at-non-alphnumspace): Replace eq with equal in the XEmacs branch.
* * lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.Juri Linkov2022-12-151-1/+1
| | | | | This helps to avoid the error in 'where-is-internal' that should not call :filter unnecessarily (bug#9923).
* compile.el: Fix regression with nb of errors in modelineStefan Monnier2022-12-151-0/+1
| | | | | * lisp/progmodes/compile.el (compilation-mode-line-errors): Mark it as risky-local, like `defconst` used to do for us.
* Make tab-bar-tab-group-format-function backwards-compatible (bug#60073)Juri Linkov2022-12-151-10/+17
| | | | | | * lisp/tab-bar.el (tab-bar--format-tab-group): Add condition-case with wrong-number-of-arguments for backwards-compatibility. (tab-bar-tab-group-format-default): Simplify.
* Make tab-bar-tab-group-format-function also handle current groupGabriel do Nascimento Ribeiro2022-12-151-11/+11
| | | | | | | * lisp/tab-bar.el (tab-bar--format-tab-group): Call 'tab-bar-tab-group-format-default' to format current group tab. (tab-bar-tab-group-format-default): Update function to also handle current group tab (bug#60073).
* Ensure package directories for source packages from checkoutsPhilip Kaludercic2022-12-151-0/+1
| | | | | | * lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout): Set the :dir entry, since `package-vc--unpack-1' assumes the field is set, as is the case when invoking `package-vc--unpack'.
* Fix bug#60060 in TrampMichael Albinus2022-12-151-0/+1
| | | | | * lisp/net/tramp-sh.el (tramp-sh-handle-file-local-copy): Delete `tmpfile' in case of error. (Bug#60060)
* ; * lisp/net/tramp-crypt.el: Fix comment.Michael Albinus2022-12-151-1/+1
|
* ; Auto-commit of loaddefs files.Stefan Kangas2022-12-151-3/+23
|
* ; Don't quote nil in commentsStefan Kangas2022-12-154-5/+5
|
* ; Checkdoc fixes in dired-aux.elStefan Kangas2022-12-151-26/+27
| | | | | | | | | | | | | * lisp/dired-aux.el (dired-compare-directories, dired-do-chmod) (dired-do-chgrp, dired-do-chown, dired-do-touch) (dired-minibuffer-default-add-shell-commands) (dired-read-shell-command, dired-mark-prefix) (dired-mark-postfix, dired-mark-separator, dired-kill-line) (dired-reset-subdir-switches, dired-add-entry) (dired-remove-file) (dired-create-destination-dirs-on-trailing-dirsep) (dired-maybe-insert-subdir, dired-tree-up, dired-tree-down): Checkdoc fixes.
* Fix ruby-add-log-current-method after nested class definitionDmitry Gutov2022-12-151-7/+31
| | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby--add-log-current-indent): New function. (ruby-add-log-current-method): Use it. Check for "class" and "module" indentation to filter out the definitions which don't include the given position. Also try to match "def" only once (for performance), because if the closest one doesn't include the given position, none will. * test/lisp/progmodes/ruby-mode-tests.el (ruby-add-log-current-method-after-inner-class-outside-methods) (ruby-add-log-current-method-after-inner-class-outside-methods-with-text): New tests.
* Add indent rules to js/typescript/tsx-ts-mode (bug#60074)Theodor Thornhill2022-12-142-0/+6
| | | | | | | * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Add in binary_expression and jsx_fragment. * lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules.
* Improve fontification in csharp-ts-mode (bug#59897)Jostein Kjønigsen2022-12-141-1/+9
| | | | | | | | | | Fixes highlighting of generic methods like the one below: instance.MethodWithTypeArguments<Type>(...); InClassMethodWithTypeArguments<Type>(...); * lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings): Add new rule.
* Revert "Add expression for generic_name in csharp-ts-mode"Yuan Fu2022-12-141-4/+0
| | | | | | | I applied the wrong commit, the next commit will be the right one, sorry about that! This reverts commit 647b6a8099f414e5a7b162efd3658e174064dfe7.
* Introduce support for TOML config-formatJostein Kjønigsen2022-12-141-0/+187
| | | | | | | | | | | | | | | This commit introduces support for the semi-popular TOML config-format[1] through a new major-mode: toml-ts-mode. I've read through the full spec[2], and from what I can see this major-mode should provide correct syntax-highligting for every sort of config-declaration which adheres to the specification. Besides that it also adds support for imenu and basic tree-sitter based navigation. [1] https://toml.io/en/ [2] https://toml.io/en/v1.0.0
* Fix handling of % when searching in .tex or .dtx filesArash Esbati2022-12-141-4/+7
| | | | | | * lisp/textmodes/reftex.el (reftex-compile-variables): Consider % when building the regexp for searching only in .dtx files. (AUCTeX bug#59638)
* Treat C++ classes as defuns in C Tree-sitter mode (bug#60047)Daniel Martín2022-12-141-1/+2
| | | | | * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add "class_specifier" as a node of type "defun".
* Add < and > to the syntax table in c++-ts-mode (bug#60049)Daniel Martín2022-12-141-0/+9
| | | | | | | * lisp/progmodes/c-ts-mode.el (c++-ts-mode--syntax-table): Add a specific syntax table for C++. Consider "<" and ">" open/close delimiters (C++ templates). (c++-ts-mode): Use the new syntax table.
* Improve fontifications in Typescript modeJostein Kjønigsen2022-12-141-16/+26
| | | | | * lisp/progmodes/typescript-ts-mode.el: Improve fontification of variables. (Bug#59831)
* Update the documentation of overlays (bug#59996)Eli Zaretskii2022-12-141-1/+1
| | | | | | | | | | | | | | | | | * src/buffer.c (Foverlay_recenter, Foverlay_lists): Update the doc strings. * lisp/subr.el (copy-overlay): Update comment. * doc/lispref/internals.texi (Buffer Internals): Remove buffer fields relevant to the old implementation; add the new interval tree field. * doc/lispref/display.texi (Overlays, Managing Overlays): Update text to be consistent with the new implementation of overlays. (Managing Overlays): Remove documentation of 'overlay-recenter'. * etc/NEWS: Mention incompatible aspects of overlay reimplementation.
* ; Fix a typo in window.elEli Zaretskii2022-12-141-1/+1
| | | | | * lisp/window.el (switch-to-prev-buffer-skip-p): Fix typo. Patch by Shuguang Sun <shuguang79@qq.com>. (Bug#59985)
* Don't send erc-sasl-user as USER command argumentF. Jason Park2022-12-141-6/+19
| | | | | | | | | | | | | | | | * lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch for sending an opening "CAP LS". The rationale for not enabling this by default is twofold: one, it more strongly implies that ERC supports IRCv3 client capability negotiation, which is somewhat disingenuous; and, two, We'd still be "faking it" by firing and forgetting, and more balls in the air makes things less predictable. (erc--register-connection): Possibly send a "CAP LS" before anything depending on the value of `erc-sasl--send-cap-ls'. Also, don't attempt to send `erc-session-username' when it holds an SASL username because the latter may contain protocol-defying characters. * test/lisp/erc/resources/base/local-modules/fourth.eld: change user parameter of "USER" command to reflect nick when `erc-sasl-user' is set to `:user'. (Bug#59976.)
* Set erc-network to a "given" ID instead of failingF. Jason Park2022-12-141-17/+40
| | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-networks.el (erc-networks--determine): Return the so-called "given" ID from a non-nil `:id' keyword arg passed to `erc' or `erc-tls'. (erc-networks--allow-unknown-network): Add internal variable to allow IRC session to continue despite the network being unknown. (erc-networks--set-name): Tell the user about falling back to a given ID when the network can't be determined. When that's so, end the session by destroying the connection unless `erc-networks--allow-unknown-network' is enabled. (Bug#59976.) (erc-networks--ensure-announced): Include the fallback announced server name in the error message. * test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Add dummy server process and don't expect an error to be signaled. * test/lisp/erc/erc-scenarios-misc.el (erc-scenarios-networks-announced-missing): Don't expect an error to be signaled. * test/lisp/erc/resources/networks/announced-missing/foonet.eld: Remove "mode" match pattern.
* Limit casemapping to appropriate ranges in ERCF. Jason Park2022-12-142-19/+25
| | | | | | | | | | | | | * lisp/erc/erc-common.el (erc-downcase): Use case table for `erc-downcase' so that case conversions are limited to the ASCII interval. * lisp/erc/erc.el (erc-casemapping--rfc1459-strict, erc--casemapping-rfc1459): Make these case tables instead of translation tables. The functions in case-table.el modify the standard syntax table, but that doesn't seem to make sense here, right? * test/lisp/erc/erc-tests.el (erc-downcase): Add cases showing mappings outside of the ASCII range. (Bug#59976.)
* Actually accept non-symbols as IDs in erc-openF. Jason Park2022-12-141-4/+5
| | | | | | | | | | | | | | * lisp/erc/erc.el (erc-generate-new-buffer-name): Despite what it says in the documentation, only symbols were being accepted as valid `:id' entry-point arguments. This uses the interned `princ' representation of the argument instead. * test/lisp/erc/erc-scenarios-base-netid-samenet.el (erc-scenarios-common--base-network-id-same-network): Randomly specify a string for the ID param instead of a non-nil symbol when opening a new connection. * test/lisp/erc/resources/erc-scenarios-common.el (erc-scenarios-common-assert-initial-buf-name): Adjust helper to allow for non-symbol IDs. (Bug#59976.)
* ; Be nicer when updating browse-url var in erc-compatF. Jason Park2022-12-141-2/+5
| | | | | | | * lisp/erc/erc-compat.el: Be more cautious about modifying `browse-url-default-handlers' when loading erc-compat on Emacs 28. A user may have already added an entry for irc:// URLs before loading `erc-compat'.
* Respect a nil erc-session-password when reconnectingF. Jason Park2022-12-141-1/+3
| | | | | | | | | | | | * lisp/erc/erc.el (erc-open): Simplify `old-vars' expression. (erc--compute-server-password): Only compute a server password when first connecting. For compatibility, this respects third-party code that expects session passwords in target buffers when initially non-nil. * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-auth-source-reconnect): Add new test. * test/lisp/erc/resources/services/auth-source/recon.eld: Add new test data file. (Bug#59858.)
* Add dedicated auth-source section in ERC manualF. Jason Park2022-12-143-5/+5
| | | | | | | | | | | | | | | | | | * doc/misc/erc.texi: Move auth-source description from the Password subheading of the Advanced chapter's Connecting section to the new Integrations section as a new node, Auth-Source, and give it a bit more structure. Fix various misuses of xref vs. pxref. Convert URL subheading to subsection and add anchor. Prefer "backend" as a single word, based on usage in other manuals. Also replace loud "warning" in SASL troubleshooting section. * etc/ERC-NEWS: Re-link auth-source mention. * lisp/erc/erc-sasl.el (erc-sasl-auth-source-function): Update info node in doc string. * lisp/erc/erc-services.el (erc-auth-source-services-function): Re-link auth-source info node in doc string. * lisp/erc/erc.el (erc-password, erc-auth-source-server-function, erc-auth-source-join-function): Re-link auth-source info node in doc strings.
* ; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commitMattias Engdegård2022-12-141-4/+4
|
* ; * lisp/progmodes/cmake-ts-mode.el (auto-mode-alist): $ -> \'Mattias Engdegård2022-12-141-1/+1
|
* Better shortdoc examplesMattias Engdegård2022-12-141-32/+106
| | | | | | | | * lisp/emacs-lisp/shortdoc.el (symbol, comparison): New. (string, list, number): Remove or change examples that do not have well-defined results, such as `eq` on strings or floats. Edit other examples for better illustrating each respective operation.
* Shortdoc: read and evaluate strings after :evalMattias Engdegård2022-12-141-7/+9
| | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): If the parameter of :eval is a string then read, evaluate and print the result. This was always the intention and is documented behaviour.
* * lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-temp-file (bug#60011)Juri Linkov2022-12-141-1/+1
|
* ; * lisp/keymap.el (keymap-substitute): Doc fix. (Bug#60059)Stefan Kangas2022-12-141-1/+1
| | | | (cherry picked from commit 1568123196cd8b57ed64e284b7deb058026be713)
* Fix syntax tables of tree-sitter modes (bug#59807)Kai Ma2022-12-133-1/+4
| | | | | | | | | | | | | | Tree-sitter modes should use the same syntax table as the non-tree-sitter ones. * lisp/progmodes/js.el (js-mode-syntax-table) (js-ts-mode) * lisp/progmodes/python.el (python-ts-mode) * lisp/progmodes/sh-script.el (bash-ts-mode) Copyright-paperwork-exempt: yes xx