[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d2f6a5c59a2: Merge from origin/emacs-29
From: |
Eli Zaretskii |
Subject: |
master d2f6a5c59a2: Merge from origin/emacs-29 |
Date: |
Sun, 17 Sep 2023 01:28:51 -0400 (EDT) |
branch: master
commit d2f6a5c59a298f87b6002267529dcecb02e44421
Merge: b2362cdcedf bcf287bd114
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Merge from origin/emacs-29
bcf287bd114 typescript-ts-mode.el: Minor touches
67c82710764 Improve namespacing situation WRT to recent change in typ...
33ff4fed03d Make move-end-of-line in minibuffer consistent (bug#65980)
---
lisp/progmodes/typescript-ts-mode.el | 23 +++++++++++++----------
lisp/simple.el | 6 +++++-
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/lisp/progmodes/typescript-ts-mode.el
b/lisp/progmodes/typescript-ts-mode.el
index 7c85a7b6fe9..01a021c64fc 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -87,7 +87,7 @@ Check if a node type is available, then return the right
indent rules."
(progn (treesit-query-capture 'tsx '((jsx_fragment) @capture))
`(((match "<" "jsx_fragment") parent 0)
((parent-is "jsx_fragment") parent
typescript-ts-mode-indent-offset)))
- (error
+ (treesit-query-error
`(((match "<" "jsx_text") parent 0)
((parent-is "jsx_text") parent typescript-ts-mode-indent-offset)))))
@@ -178,7 +178,8 @@ Argument LANGUAGE is either `typescript' or `tsx'."
(jsx_self_closing_element
[(member_expression (identifier)) (identifier)]
@typescript-ts-jsx-tag-face)))
- (error '((jsx_opening_element
+ (treesit-query-error
+ '((jsx_opening_element
[(nested_identifier (identifier)) (identifier)]
@typescript-ts-jsx-tag-face)
@@ -416,7 +417,9 @@ See `treesit-thing-settings' for more information.")
;;;###autoload
(define-derived-mode typescript-ts-base-mode prog-mode "TypeScript"
- "Major mode for editing TypeScript."
+ "Generic major mode for editing TypeScript.
+
+This mode is intended to be inherited by concrete major modes."
:group 'typescript
:syntax-table typescript-ts-mode--syntax-table
@@ -476,7 +479,7 @@ See `treesit-thing-settings' for more information.")
(keyword string escape-sequence)
(constant expression identifier number pattern property)
(function bracket delimiter)))
- (setq-local syntax-propertize-function #'ts-ts--syntax-propertize)
+ (setq-local syntax-propertize-function #'typescript-ts--syntax-propertize)
(treesit-major-mode-setup)))
@@ -537,7 +540,7 @@ at least 3 (which is the default value)."
(treesit-major-mode-setup)))
-(defvar ts-ts--s-p-query
+(defvar typescript-ts--s-p-query
(when (treesit-available-p)
(treesit-query-compile 'typescript
'(((regex pattern: (regex_pattern) @regexp))))))
@@ -552,15 +555,15 @@ at least 3 (which is the default value)."
((parenthesized_expression (jsx_element) @jsx))
((return_statement (jsx_element) @jsx))))))
-(defun ts-ts--syntax-propertize (beg end)
- (let ((captures (treesit-query-capture 'typescript ts-ts--s-p-query beg
end)))
- (ts-ts--syntax-propertize-captures captures)))
+(defun typescript-ts--syntax-propertize (beg end)
+ (let ((captures (treesit-query-capture 'typescript typescript-ts--s-p-query
beg end)))
+ (tsx-ts--syntax-propertize-captures captures)))
(defun tsx-ts--syntax-propertize (beg end)
(let ((captures (treesit-query-capture 'tsx tsx-ts--s-p-query beg end)))
- (ts-ts--syntax-propertize-captures captures)))
+ (tsx-ts--syntax-propertize-captures captures)))
-(defun ts-ts--syntax-propertize-captures (captures)
+(defun tsx-ts--syntax-propertize-captures (captures)
(pcase-dolist (`(,name . ,node) captures)
(let* ((ns (treesit-node-start node))
(ne (treesit-node-end node))
diff --git a/lisp/simple.el b/lisp/simple.el
index 35dd0f59e29..c6bdfc763b7 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8263,7 +8263,11 @@ rests."
(let ((newpos
(save-excursion
(let ((goal-column 0)
- (line-move-visual nil))
+ (line-move-visual nil)
+ ;; Always move to eol when invoking `C-e' from
+ ;; within the minibuffer's prompt string (see
+ ;; bug#65980).
+ (inhibit-field-text-motion (minibufferp)))
(and (line-move arg t)
;; With bidi reordering, we may not be at bol,
;; so make sure we are.