mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 10:31:37 -08:00
Merge from origin/emacs-29
4b6f2a7028* lisp/progmodes/xref.el: Bump the version.24c8b146bb* lisp/progmodes/xref.el (xref--xref-buffer-mode): Split ...46f9e53c3dFix import of keys in buffer created by epa-search-keys36ade0704eFix connection-local variables settingse759905d2e; Minor copyedits in EGLOT-NEWSba22a2c346Bump Eglot version to 1.1254e123a505Update Eglot's manual about eglot-workspace-configuration812597f864; * lisp/novice.el (disabled-command-function): Add note ...4a603c9849Amend last Eglot commit (bug#62065)b916ec88b2Make eglot-ensure's post-command-hook run a bit later (bu...1c05175c21Fix display of disabled-command help text3ce37db988Remove mention of old dotted-list reader quirk from manual42335c2c1fFix value history shown for 'gc-cons-percentage'fffbce2934TRework fix for bug#621068bc12a2736; * etc/NEWS: Fix last change.2ac068d294; Remove 'ns-popup-font-panel' from documentation5bc32d008fAdd missing indentation rule for rust-ts-mode (Bug#62109)0404924930; One more improvement to ELisp "internals" appendix.c857775ca6Fix bug#621060fedbfa6a9; Minor improvement of documentation of GC thresholdsb0b24ad2fcAdd missing rust-ts-mode highlight query for scoped_type_...c0cf69f7a1Make "case" keyword a dedenter in Pythondb178517ce; * lisp/arc-mode.el (w32-get-console-codepage): Declare.157a91b54bFix decoding non-ASCII file names in zip archives on MS-W...4803f97204Fix copying binary files from zip archives679f528b95Skip ruby-ts-syntax-propertize-symbol unless treesitter i...081cc7aa8e; * doc/misc/eglot.texi (Project-specific configuration):...1de513a29fFix enums and unions appearing as structs in c-ts-base-mo...ecdfd584a5ruby-ts-mode: Fine-tune s-p-f on symbols (bug#62086)29228e24f2python-info-dedenter-opening-block-positions: Fix to supp...01b65d442aAutoload Eglot helper funtion eglot--debbugs-or-github-bu...50a3559c5aAdd chapter on advanced server configuration to Eglot manual2e7460c231; * lisp/progmodes/java-ts-mode.el (treesit-query-capture...255eeee0e0java-ts-mode: detect if text_block is supported.6fe9075ff3Revert workaround introduced in Bug#56271f175141aeaFix searching for end of string in python-nav-end-of-stat... # Conflicts: # etc/NEWS
This commit is contained in:
commit
a55aaf9eaf
22 changed files with 1049 additions and 188 deletions
|
|
@ -961,9 +961,9 @@ the semicolon. This function skips the semicolon."
|
|||
;; Imenu.
|
||||
(setq-local treesit-simple-imenu-settings
|
||||
(let ((pred #'c-ts-mode--defun-valid-p))
|
||||
`(("Struct" ,(rx bos (or "struct" "enum" "union")
|
||||
"_specifier" eos)
|
||||
,pred nil)
|
||||
`(("Enum" "\\`enum_specifier\\'" ,pred nil)
|
||||
("Struct" "\\`struct_specifier\\'" ,pred nil)
|
||||
("Union" "\\`union_specifier\\'" ,pred nil)
|
||||
("Variable" ,(rx bos "declaration" eos) ,pred nil)
|
||||
("Function" "\\`function_definition\\'" ,pred nil)
|
||||
("Class" ,(rx bos (or "class_specifier"
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
;; Copyright (C) 2018-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Version: 1.11
|
||||
;; Version: 1.12
|
||||
;; Author: João Távora <joaotavora@gmail.com>
|
||||
;; Maintainer: João Távora <joaotavora@gmail.com>
|
||||
;; URL: https://github.com/joaotavora/eglot
|
||||
;; Keywords: convenience, languages
|
||||
;; Package-Requires: ((emacs "26.3") (jsonrpc "1.0.16") (flymake "1.2.1") (project "0.9.3") (xref "1.4.0") (eldoc "1.11.0") (seq "2.23") (external-completion "0.1"))
|
||||
;; Package-Requires: ((emacs "26.3") (jsonrpc "1.0.16") (flymake "1.2.1") (project "0.9.8") (xref "1.6.2") (eldoc "1.11.0") (seq "2.23") (external-completion "0.1"))
|
||||
|
||||
;; This is a GNU ELPA :core package. Avoid adding functionality
|
||||
;; that is not available in the version of Emacs recorded above or any
|
||||
|
|
@ -1155,12 +1155,12 @@ INTERACTIVE is t if called interactively."
|
|||
(cl-labels
|
||||
((maybe-connect
|
||||
()
|
||||
(remove-hook 'post-command-hook #'maybe-connect nil)
|
||||
(eglot--when-live-buffer buffer
|
||||
(remove-hook 'post-command-hook #'maybe-connect t)
|
||||
(unless eglot--managed-mode
|
||||
(apply #'eglot--connect (eglot--guess-contact))))))
|
||||
(when buffer-file-name
|
||||
(add-hook 'post-command-hook #'maybe-connect 'append nil)))))
|
||||
(add-hook 'post-command-hook #'maybe-connect 'append t)))))
|
||||
|
||||
(defun eglot-events-buffer (server)
|
||||
"Display events buffer for SERVER.
|
||||
|
|
@ -3666,13 +3666,14 @@ If NOERROR, return predicate, else erroring function."
|
|||
|
||||
;;; Misc
|
||||
;;;
|
||||
(defun eglot--debbugs-or-github-bug-uri ()
|
||||
(format (if (string= (match-string 2) "github")
|
||||
"https://github.com/joaotavora/eglot/issues/%s"
|
||||
"https://debbugs.gnu.org/%s")
|
||||
(match-string 3)))
|
||||
(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
|
||||
|
||||
;;;###autoload
|
||||
(progn
|
||||
(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
|
||||
(defun eglot--debbugs-or-github-bug-uri ()
|
||||
(format (if (string= (match-string 2) "github")
|
||||
"https://github.com/joaotavora/eglot/issues/%s"
|
||||
"https://debbugs.gnu.org/%s")
|
||||
(match-string 3))))
|
||||
;;; Obsolete
|
||||
;;;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
(declare-function treesit-node-start "treesit.c")
|
||||
(declare-function treesit-node-type "treesit.c")
|
||||
(declare-function treesit-node-child-by-field-name "treesit.c")
|
||||
(declare-function treesit-node-child-by-field-name "treesit.c")
|
||||
(declare-function treesit-query-capture "treesit.c")
|
||||
|
||||
(defcustom java-ts-mode-indent-offset 4
|
||||
"Number of spaces for each indentation step in `java-ts-mode'."
|
||||
|
|
@ -145,6 +147,16 @@
|
|||
"|=" "~" ">>" ">>>" "<<" "::" "?" "&=")
|
||||
"Java operators for tree-sitter font-locking.")
|
||||
|
||||
(defun java-ts-mode--string-highlight-helper ()
|
||||
"Returns, for strings, a query based on what is supported by
|
||||
the available version of Tree-sitter for java."
|
||||
(condition-case nil
|
||||
(progn (treesit-query-capture 'java '((text_block) @font-lock-string-face))
|
||||
`((string_literal) @font-lock-string-face
|
||||
(text_block) @font-lock-string-face))
|
||||
(error
|
||||
`((string_literal) @font-lock-string-face))))
|
||||
|
||||
(defvar java-ts-mode--font-lock-settings
|
||||
(treesit-font-lock-rules
|
||||
:language 'java
|
||||
|
|
@ -182,8 +194,7 @@
|
|||
:language 'java
|
||||
:override t
|
||||
:feature 'string
|
||||
`((string_literal) @font-lock-string-face
|
||||
(text_block) @font-lock-string-face)
|
||||
(java-ts-mode--string-highlight-helper)
|
||||
:language 'java
|
||||
:override t
|
||||
:feature 'literal
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@ This variant of `rx' supports common Python named REGEXPS."
|
|||
(or "def" "for" "with")))
|
||||
symbol-end))
|
||||
(dedenter (seq symbol-start
|
||||
(or "elif" "else" "except" "finally")
|
||||
(or "elif" "else" "except" "finally" "case")
|
||||
symbol-end))
|
||||
(block-ender (seq symbol-start
|
||||
(or
|
||||
|
|
@ -2062,10 +2062,6 @@ of the statement."
|
|||
;; are somehow out of whack. This has been
|
||||
;; observed when using `syntax-ppss' during
|
||||
;; narrowing.
|
||||
;; It can also fail in cases where the buffer is in
|
||||
;; the process of being modified, e.g. when creating
|
||||
;; a string with `electric-pair-mode' disabled such
|
||||
;; that there can be an unmatched single quote
|
||||
(when (>= string-start last-string-end)
|
||||
(goto-char string-start)
|
||||
(if (python-syntax-context 'paren)
|
||||
|
|
@ -2076,10 +2072,16 @@ of the statement."
|
|||
(goto-char (+ (point)
|
||||
(python-syntax-count-quotes
|
||||
(char-after (point)) (point))))
|
||||
(setq last-string-end
|
||||
(or (re-search-forward
|
||||
(rx (syntax string-delimiter)) nil t)
|
||||
(goto-char (point-max)))))))
|
||||
(setq
|
||||
last-string-end
|
||||
(or (if (eq t (nth 3 (syntax-ppss)))
|
||||
(re-search-forward
|
||||
(rx (syntax string-delimiter)) nil t)
|
||||
(ignore-error scan-error
|
||||
(goto-char string-start)
|
||||
(python-nav--lisp-forward-sexp)
|
||||
(point)))
|
||||
(goto-char (point-max)))))))
|
||||
((python-syntax-context 'paren)
|
||||
;; The statement won't end before we've escaped
|
||||
;; at least one level of parenthesis.
|
||||
|
|
@ -2148,10 +2150,7 @@ backward to previous statement."
|
|||
(while (and (forward-line 1)
|
||||
(not (eobp))
|
||||
(or (and (> (current-indentation) block-indentation)
|
||||
(let ((start (point)))
|
||||
(python-nav-end-of-statement)
|
||||
;; must move forward otherwise infinite loop
|
||||
(> (point) start)))
|
||||
(or (python-nav-end-of-statement) t))
|
||||
(python-info-current-line-comment-p)
|
||||
(python-info-current-line-empty-p))))
|
||||
(python-util-forward-comment -1)
|
||||
|
|
@ -5784,7 +5783,8 @@ likely an invalid python file."
|
|||
(pairs '(("elif" "elif" "if")
|
||||
("else" "if" "elif" "except" "for" "while")
|
||||
("except" "except" "try")
|
||||
("finally" "else" "except" "try")))
|
||||
("finally" "else" "except" "try")
|
||||
("case" "case")))
|
||||
(dedenter (match-string-no-properties 0))
|
||||
(possible-opening-blocks (cdr (assoc-string dedenter pairs)))
|
||||
(collected-indentations)
|
||||
|
|
@ -5793,7 +5793,9 @@ likely an invalid python file."
|
|||
(while (python-nav--syntactically
|
||||
(lambda ()
|
||||
(cl-loop while (re-search-backward (python-rx block-start) nil t)
|
||||
if (memq (char-before) '(nil ?\s ?\t ?\n))
|
||||
if (save-match-data
|
||||
(looking-back (rx line-start (* whitespace))
|
||||
(line-beginning-position)))
|
||||
return t))
|
||||
#'<)
|
||||
(let ((indentation (current-indentation)))
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ leading double colon is not added."
|
|||
(:match "\\`?[#\"'`:?]" @char))
|
||||
;; Symbols like :+, :<=> or :foo=.
|
||||
((simple_symbol) @symbol
|
||||
(:match "[[:punct:]]" @symbol))
|
||||
(:match "\\s." @symbol))
|
||||
;; Method calls with name ending with ? or !.
|
||||
((call method: (identifier) @ident)
|
||||
(:match "[?!]\\'" @ident))
|
||||
|
|
@ -1058,7 +1058,9 @@ leading double colon is not added."
|
|||
(put-text-property (1- (treesit-node-end node)) (treesit-node-end node)
|
||||
'syntax-table (string-to-syntax "_")))
|
||||
('symbol
|
||||
(put-text-property (1+ (treesit-node-start node)) (treesit-node-end node)
|
||||
(goto-char (treesit-node-end node))
|
||||
(skip-syntax-backward "." (treesit-node-start node))
|
||||
(put-text-property (point) (treesit-node-end node)
|
||||
'syntax-table (string-to-syntax "_")))
|
||||
('heredoc
|
||||
(put-text-property (treesit-node-start node) (1+ (treesit-node-start node))
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@
|
|||
((parent-is "let_declaration") parent-bol rust-ts-mode-indent-offset)
|
||||
((parent-is "macro_definition") parent-bol rust-ts-mode-indent-offset)
|
||||
((parent-is "parameters") parent-bol rust-ts-mode-indent-offset)
|
||||
((parent-is "struct_pattern") parent-bol rust-ts-mode-indent-offset)
|
||||
((parent-is "token_tree") parent-bol rust-ts-mode-indent-offset)
|
||||
((parent-is "use_list") parent-bol rust-ts-mode-indent-offset)))
|
||||
"Tree-sitter indent rules for `rust-ts-mode'.")
|
||||
|
|
@ -235,6 +236,7 @@
|
|||
"^\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)$"
|
||||
@font-lock-type-face))
|
||||
((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope))
|
||||
((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope))
|
||||
(type_identifier) @font-lock-type-face)
|
||||
|
||||
:language 'rust
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
|
||||
|
||||
;; Copyright (C) 2014-2023 Free Software Foundation, Inc.
|
||||
;; Version: 1.6.2
|
||||
;; Version: 1.6.3
|
||||
;; Package-Requires: ((emacs "26.1"))
|
||||
|
||||
;; This is a GNU ELPA :core package. Avoid functionality that is not
|
||||
|
|
@ -981,7 +981,7 @@ point."
|
|||
map))
|
||||
|
||||
(declare-function outline-search-text-property "outline"
|
||||
(property &optional value bound move backward looking-at))
|
||||
(property &optional value bound move backward looking-at))
|
||||
|
||||
(define-derived-mode xref--xref-buffer-mode special-mode "XREF"
|
||||
"Mode for displaying cross-references."
|
||||
|
|
@ -993,14 +993,14 @@ point."
|
|||
(setq imenu-extract-index-name-function
|
||||
#'xref--imenu-extract-index-name)
|
||||
(setq-local add-log-current-defun-function
|
||||
#'xref--add-log-current-defun)
|
||||
(setq-local outline-minor-mode-cycle t
|
||||
outline-minor-mode-use-buttons 'insert
|
||||
outline-search-function
|
||||
#'xref--add-log-current-defun)
|
||||
(setq-local outline-minor-mode-cycle t)
|
||||
(setq-local outline-minor-mode-use-buttons 'insert)
|
||||
(setq-local outline-search-function
|
||||
(lambda (&optional bound move backward looking-at)
|
||||
(outline-search-text-property
|
||||
'xref-group nil bound move backward looking-at))
|
||||
outline-level (lambda () 1)))
|
||||
'xref-group nil bound move backward looking-at)))
|
||||
(setq-local outline-level (lambda () 1)))
|
||||
|
||||
(defvar xref--transient-buffer-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue