aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2023-01-03 06:30:17 +0100
committerStefan Kangas2023-01-03 06:30:17 +0100
commit55e41707ea727ea4b5c4d3c85f68b62e32dcdfb5 (patch)
tree436b76d5358aa17d126090d63691a7661cc93f20
parent2ee6012b3faaf12710ec63626795148caeef0f6a (diff)
parent6dd3e352f44eb402c9b76c8f6e5bef032317cc55 (diff)
downloademacs-55e41707ea727ea4b5c4d3c85f68b62e32dcdfb5.tar.gz
emacs-55e41707ea727ea4b5c4d3c85f68b62e32dcdfb5.zip
Merge from origin/emacs-29
6dd3e352f44 Extract common code into ruby-base-mode to derive from 94e330243e1 ruby-ts-mode: Indentation fixes 9b24417dda8 ruby-ts--font-lock-settings: Use more standard faces 9e6536e4d96 ruby-ts-mode: Standardize the string literal highlights 1a9a1fdebf6 Improve fontification in java-ts-mode (bug#60492) dfdf9c21cbe Fontification improvements in typescript-ts-mode (bug#60500) 68e68dfeefe Improve fontification consistency in js-ts-mode (bug#60503) aef869e74f4 ; Update tree-sitter manual 4ef12cfb1fc ; Fix tree-sitter manual title case aab8ddca5e1 ; nt/INSTALL: Update for Emacs 29. 809fbb0e8c4 ; Update copyright notice in tramp-sh.el f8f5202487c (typescript/tsx-ts-mode): Split font-lock feature list in... a86a213e1ac js-ts-mode: Move 'string-interpolation' to font-lock level 3 d26b523886e Fix shrinking of the tab-bar 3f7ea621b90 ; Fix typos in ruby-ts-mode.el 9599b054316 ; Skip ruby-ts tests if grammar is not available ff35ac9dfab Fix default-port regression in erc-select-read-args b7ad0b40148 ; Clarify doc strings of 'call-process' and 'call-process...
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/modes.texi4
-rw-r--r--doc/lispref/parsing.texi4
-rw-r--r--doc/lispref/positions.texi23
-rw-r--r--lisp/erc/erc.el38
-rw-r--r--lisp/net/tramp-sh.el2
-rw-r--r--lisp/progmodes/java-ts-mode.el4
-rw-r--r--lisp/progmodes/js.el14
-rw-r--r--lisp/progmodes/ruby-mode.el61
-rw-r--r--lisp/progmodes/ruby-ts-mode.el54
-rw-r--r--lisp/progmodes/typescript-ts-mode.el28
-rw-r--r--nt/INSTALL27
-rw-r--r--src/callproc.c5
-rw-r--r--src/haikufns.c14
-rw-r--r--src/nsfns.m14
-rw-r--r--src/pgtkfns.c14
-rw-r--r--src/w32fns.c14
-rw-r--r--src/xfns.c14
-rw-r--r--test/lisp/erc/erc-tests.el6
-rw-r--r--test/lisp/progmodes/ruby-ts-mode-tests.el24
20 files changed, 200 insertions, 166 deletions
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index fd06409fd59..c7dc330441f 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1370,7 +1370,7 @@ Parsing Program Source
1370* Accessing Node Information:: Accessing node information. 1370* Accessing Node Information:: Accessing node information.
1371* Pattern Matching:: Pattern matching with query patterns. 1371* Pattern Matching:: Pattern matching with query patterns.
1372* Multiple Languages:: Parse text written in multiple languages. 1372* Multiple Languages:: Parse text written in multiple languages.
1373* Tree-sitter major modes:: Develop major modes using tree-sitter. 1373* Tree-sitter Major Modes:: Develop major modes using tree-sitter.
1374* Tree-sitter C API:: Compare the C API and the ELisp API. 1374* Tree-sitter C API:: Compare the C API and the ELisp API.
1375 1375
1376Syntax Descriptors 1376Syntax Descriptors
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 9cd20532de6..dffd6653369 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2863,10 +2863,10 @@ matched by @var{regexp} and @var{pred} are not grouped under
2863@var{name-fn} should be either @var{nil} or a function that takes a 2863@var{name-fn} should be either @var{nil} or a function that takes a
2864defun node and returns the name of that defun, e.g., the function name 2864defun node and returns the name of that defun, e.g., the function name
2865for a function definition. If @var{name-fn} is @var{nil}, 2865for a function definition. If @var{name-fn} is @var{nil},
2866@code{treesit-defun-name} (@pxref{Tree-sitter major modes}) is used 2866@code{treesit-defun-name} (@pxref{Tree-sitter Major Modes}) is used
2867instead. 2867instead.
2868 2868
2869@code{treesit-major-mode-setup} (@pxref{Tree-sitter major modes}) 2869@code{treesit-major-mode-setup} (@pxref{Tree-sitter Major Modes})
2870automatically sets up Imenu if this variable is non-@code{nil}. 2870automatically sets up Imenu if this variable is non-@code{nil}.
2871@end defvar 2871@end defvar
2872 2872
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index 1ed59526a61..19a22c121de 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -45,7 +45,7 @@ source files that mix multiple programming languages.
45* Accessing Node Information:: Accessing node information. 45* Accessing Node Information:: Accessing node information.
46* Pattern Matching:: Pattern matching with query patterns. 46* Pattern Matching:: Pattern matching with query patterns.
47* Multiple Languages:: Parse text written in multiple languages. 47* Multiple Languages:: Parse text written in multiple languages.
48* Tree-sitter major modes:: Develop major modes using tree-sitter. 48* Tree-sitter Major Modes:: Develop major modes using tree-sitter.
49* Tree-sitter C API:: Compare the C API and the ELisp API. 49* Tree-sitter C API:: Compare the C API and the ELisp API.
50@end menu 50@end menu
51 51
@@ -1675,7 +1675,7 @@ language of the buffer text at @var{pos}. This variable is used by
1675@code{treesit-language-at}. 1675@code{treesit-language-at}.
1676@end defvar 1676@end defvar
1677 1677
1678@node Tree-sitter major modes 1678@node Tree-sitter Major Modes
1679@section Developing major modes with tree-sitter 1679@section Developing major modes with tree-sitter
1680@cindex major mode, developing with tree-sitter 1680@cindex major mode, developing with tree-sitter
1681 1681
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index 68e948bacd8..f47720184a3 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -848,25 +848,14 @@ The value of this variable is a regexp matching the node type of defun
848nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) 848nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.)
849 849
850For example, @code{python-mode} sets this variable to a regexp that 850For example, @code{python-mode} sets this variable to a regexp that
851matches either @code{function_definition} or @code{class_definition}. 851matches either @code{"function_definition"} or @code{"class_definition"}.
852@end defvar 852@end defvar
853 853
854@defvar treesit-defun-prefer-top-level 854@defvar treesit-defun-tactic
855If this variable is non-@code{nil}, Emacs skips nested defuns, when it 855This variable determines how does Emacs treat nested defuns. If the
856looks for beginning and end of a defun, and prefers to go to the 856value is @code{top-level}, navigation functions only move across
857top-level defun instead. 857top-level defuns, if the value is @code{nested}, navigation functions
858 858recognize nested defuns.
859In some languages, a defun could be nested in another one. By default,
860Emacs stops at the first defun it encounters. But if this variable's
861value is @code{t}, whenever Emacs finds a defun node, it tries to go
862up the parse tree until it finds the top-level defun.
863
864This variable can also be a list of cons cells of the form
865@w{@code{(@var{from} . @var{to}))}}, where @var{from} and @var{to} are
866regexps matching tree-sitter node types. When Emacs finds a defun
867node whose type matches any of the @var{from} regexps in the list, it
868then tries to go up the parse tree until it finds a higher-level node
869matching the corresponding @var{to} regexp.
870@end defvar 859@end defvar
871 860
872@node Skipping Characters 861@node Skipping Characters
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index fe1201dd3a8..6315d5aa482 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2161,6 +2161,23 @@ parameters SERVER and NICK."
2161 (setq input (concat "irc://" input))) 2161 (setq input (concat "irc://" input)))
2162 input) 2162 input)
2163 2163
2164;; A temporary means of addressing the problem of ERC's namesake entry
2165;; point defaulting to a non-TLS connection with its default server
2166;; (bug#60428).
2167(defun erc--warn-unencrypted ()
2168 ;; Remove unconditionally to avoid wrong context due to races from
2169 ;; simultaneous dialing or aborting (e.g., via `keybaord-quit').
2170 (remove-hook 'erc--server-post-connect-hook #'erc--warn-unencrypted)
2171 (when (and (process-contact erc-server-process :nowait)
2172 (equal erc-session-server erc-default-server)
2173 (eql erc-session-port erc-default-port))
2174 ;; FIXME use the autoloaded `info' instead of `Info-goto-node' in
2175 ;; `erc-button-alist'.
2176 (require 'info nil t)
2177 (erc-display-error-notice
2178 nil (concat "This connection is unencrypted. Please use `erc-tls'"
2179 " from now on. See Info:\"(erc) connecting\" for more."))))
2180
2164;;;###autoload 2181;;;###autoload
2165(defun erc-select-read-args () 2182(defun erc-select-read-args ()
2166 "Prompt the user for values of nick, server, port, and password." 2183 "Prompt the user for values of nick, server, port, and password."
@@ -2171,10 +2188,7 @@ parameters SERVER and NICK."
2171 ;; For legacy reasons, also accept a URL without a scheme. 2188 ;; For legacy reasons, also accept a URL without a scheme.
2172 (url (url-generic-parse-url (erc--ensure-url input))) 2189 (url (url-generic-parse-url (erc--ensure-url input)))
2173 (server (url-host url)) 2190 (server (url-host url))
2174 (sp (and (or (string-suffix-p "s" (url-type url)) 2191 (sp (and (string-suffix-p "s" (url-type url)) erc-default-port-tls))
2175 (and (equal server erc-default-server)
2176 (not (string-prefix-p "irc://" input))))
2177 'ircs-u))
2178 (port (or (url-portspec url) 2192 (port (or (url-portspec url)
2179 (erc-compute-port 2193 (erc-compute-port
2180 (let ((d (erc-compute-port sp))) ; may be a string 2194 (let ((d (erc-compute-port sp))) ; may be a string
@@ -2187,13 +2201,19 @@ parameters SERVER and NICK."
2187 (let ((d (erc-compute-nick))) 2201 (let ((d (erc-compute-nick)))
2188 (read-string (format "Nickname (default is %S): " d) 2202 (read-string (format "Nickname (default is %S): " d)
2189 nil 'erc-nick-history-list d)))) 2203 nil 'erc-nick-history-list d))))
2190 (passwd (or (url-password url) 2204 (passwd (let* ((p (with-suppressed-warnings ((obsolete erc-password))
2191 (if erc-prompt-for-password 2205 (or (url-password url) erc-password)))
2192 (read-passwd "Server password (optional): ") 2206 (m (if p
2193 (with-suppressed-warnings ((obsolete erc-password)) 2207 (format "Server password (default is %S): " p)
2194 erc-password))))) 2208 "Server password (optional): ")))
2209 (if erc-prompt-for-password (read-passwd m nil p) p))))
2195 (when (and passwd (string= "" passwd)) 2210 (when (and passwd (string= "" passwd))
2196 (setq passwd nil)) 2211 (setq passwd nil))
2212 (when (and (equal server erc-default-server)
2213 (eql port erc-default-port)
2214 (not (eql port erc-default-port-tls)) ; not `erc-tls'
2215 (not (string-prefix-p "irc://" input))) ; not yanked URL
2216 (add-hook 'erc--server-post-connect-hook #'erc--warn-unencrypted))
2197 (list :server server :port port :nick nick :password passwd))) 2217 (list :server server :port port :nick nick :password passwd)))
2198 2218
2199;;;###autoload 2219;;;###autoload
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 51fc58a5a96..1ba2a92e21c 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -838,7 +838,6 @@ characters need to be doubled.")
838(defconst tramp-perl-encode 838(defconst tramp-perl-encode
839 "%p -e ' 839 "%p -e '
840# This script contributed by Juanma Barranquero <lektu@terra.es>. 840# This script contributed by Juanma Barranquero <lektu@terra.es>.
841# Copyright (C) 2002-2022 Free Software Foundation, Inc.
842use strict; 841use strict;
843 842
844my %%trans = do { 843my %%trans = do {
@@ -877,7 +876,6 @@ characters need to be doubled.")
877(defconst tramp-perl-decode 876(defconst tramp-perl-decode
878 "%p -e ' 877 "%p -e '
879# This script contributed by Juanma Barranquero <lektu@terra.es>. 878# This script contributed by Juanma Barranquero <lektu@terra.es>.
880# Copyright (C) 2002-2022 Free Software Foundation, Inc.
881use strict; 879use strict;
882 880
883my %%trans = do { 881my %%trans = do {
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 2d3ffccb3d0..87a4e2b90f8 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -240,7 +240,9 @@
240 (method_invocation 240 (method_invocation
241 name: (identifier) @font-lock-function-name-face) 241 name: (identifier) @font-lock-function-name-face)
242 242
243 (argument_list (identifier) @font-lock-variable-name-face)) 243 (argument_list (identifier) @font-lock-variable-name-face)
244
245 (expression_statement (identifier) @font-lock-variable-name-face))
244 246
245 :language 'java 247 :language 'java
246 :feature 'bracket 248 :feature 'bracket
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 732598877a5..8a2a5f886ec 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3521,6 +3521,15 @@ This function is intended for use in `after-change-functions'."
3521 (method_definition 3521 (method_definition
3522 name: (property_identifier) @font-lock-function-name-face) 3522 name: (property_identifier) @font-lock-function-name-face)
3523 3523
3524 (method_definition
3525 parameters: (formal_parameters (identifier) @font-lock-variable-name-face))
3526
3527 (arrow_function
3528 parameters: (formal_parameters (identifier) @font-lock-variable-name-face))
3529
3530 (function_declaration
3531 parameters: (formal_parameters (identifier) @font-lock-variable-name-face))
3532
3524 (variable_declarator 3533 (variable_declarator
3525 name: (identifier) @font-lock-variable-name-face) 3534 name: (identifier) @font-lock-variable-name-face)
3526 3535
@@ -3822,9 +3831,8 @@ Currently there are `js-mode' and `js-ts-mode'."
3822 '(( comment definition) 3831 '(( comment definition)
3823 ( keyword string) 3832 ( keyword string)
3824 ( assignment constant escape-sequence jsx number 3833 ( assignment constant escape-sequence jsx number
3825 pattern) 3834 pattern string-interpolation)
3826 ( bracket delimiter function operator property 3835 ( bracket delimiter function operator property)))
3827 string-interpolation)))
3828 ;; Imenu 3836 ;; Imenu
3829 (setq-local treesit-simple-imenu-settings 3837 (setq-local treesit-simple-imenu-settings
3830 `(("Function" "\\`function_declaration\\'" nil nil) 3838 `(("Function" "\\`function_declaration\\'" nil nil)
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 14cdf0a1a26..2e8d335f151 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -899,24 +899,6 @@ This only affects the output of the command `ruby-toggle-block'."
899 (while (and (setq state (apply #'ruby-parse-partial end state)) 899 (while (and (setq state (apply #'ruby-parse-partial end state))
900 (>= (nth 2 state) 0) (< (point) end)))))) 900 (>= (nth 2 state) 0) (< (point) end))))))
901 901
902(defun ruby-mode-variables ()
903 "Set up initial buffer-local variables for Ruby mode."
904 (setq indent-tabs-mode ruby-indent-tabs-mode)
905 (smie-setup ruby-smie-grammar #'ruby-smie-rules
906 :forward-token #'ruby-smie--forward-token
907 :backward-token #'ruby-smie--backward-token)
908 (unless ruby-use-smie
909 (setq-local indent-line-function #'ruby-indent-line))
910 (setq-local comment-start "# ")
911 (setq-local comment-end "")
912 (setq-local comment-column ruby-comment-column)
913 (setq-local comment-start-skip "#+ *")
914 (setq-local parse-sexp-ignore-comments t)
915 (setq-local parse-sexp-lookup-properties t)
916 (setq-local paragraph-start (concat "$\\|" page-delimiter))
917 (setq-local paragraph-separate paragraph-start)
918 (setq-local paragraph-ignore-fill-prefix t))
919
920(defun ruby--insert-coding-comment (encoding) 902(defun ruby--insert-coding-comment (encoding)
921 "Insert a magic coding comment for ENCODING. 903 "Insert a magic coding comment for ENCODING.
922The style of the comment is controlled by `ruby-encoding-magic-comment-style'." 904The style of the comment is controlled by `ruby-encoding-magic-comment-style'."
@@ -2629,29 +2611,54 @@ If there is no Rubocop config file, Rubocop will be passed a flag
2629 "Value for `prettify-symbols-alist' in `ruby-mode'.") 2611 "Value for `prettify-symbols-alist' in `ruby-mode'.")
2630 2612
2631;;;###autoload 2613;;;###autoload
2632(define-derived-mode ruby-mode prog-mode "Ruby" 2614(define-derived-mode ruby-base-mode prog-mode "Ruby"
2633 "Major mode for editing Ruby code." 2615 "Generic major mode for editing Ruby.
2634 (ruby-mode-variables)
2635 2616
2636 (setq-local imenu-create-index-function #'ruby-imenu-create-index) 2617This mode is intended to be inherited by concrete major modes.
2637 (setq-local add-log-current-defun-function #'ruby-add-log-current-method) 2618Currently there are `ruby-mode' and `ruby-ts-mode'."
2638 (setq-local beginning-of-defun-function #'ruby-beginning-of-defun) 2619 (setq indent-tabs-mode ruby-indent-tabs-mode)
2639 (setq-local end-of-defun-function #'ruby-end-of-defun) 2620
2621 (setq-local comment-start "# ")
2622 (setq-local comment-end "")
2623 (setq-local comment-column ruby-comment-column)
2624 (setq-local comment-start-skip "#+ *")
2625
2626 (setq-local parse-sexp-ignore-comments t)
2627 (setq-local parse-sexp-lookup-properties t)
2628
2629 (setq-local paragraph-start (concat "$\\|" page-delimiter))
2630 (setq-local paragraph-separate paragraph-start)
2631 (setq-local paragraph-ignore-fill-prefix t)
2640 2632
2641 ;; `outline-regexp' contains the first part of `ruby-indent-beg-re' 2633 ;; `outline-regexp' contains the first part of `ruby-indent-beg-re'
2642 (setq-local outline-regexp (concat "^\\s *" 2634 (setq-local outline-regexp (concat "^\\s *"
2643 (regexp-opt '("class" "module" "def")) 2635 (regexp-opt '("class" "module" "def"))
2644 "\\_>")) 2636 "\\_>"))
2645 (setq-local outline-level (lambda () (1+ (/ (current-indentation) 2637 (setq-local outline-level (lambda () (1+ (/ (current-indentation)
2646 ruby-indent-level)))) 2638 ruby-indent-level))))
2647 2639
2648 (add-hook 'after-save-hook #'ruby-mode-set-encoding nil 'local) 2640 (add-hook 'after-save-hook #'ruby-mode-set-encoding nil 'local)
2649 (add-hook 'electric-indent-functions #'ruby--electric-indent-p nil 'local) 2641 (add-hook 'electric-indent-functions #'ruby--electric-indent-p nil 'local)
2650 (add-hook 'flymake-diagnostic-functions #'ruby-flymake-auto nil 'local) 2642 (add-hook 'flymake-diagnostic-functions #'ruby-flymake-auto nil 'local)
2651 2643
2644 (setq-local prettify-symbols-alist ruby--prettify-symbols-alist))
2645
2646;;;###autoload
2647(define-derived-mode ruby-mode ruby-base-mode "Ruby"
2648 "Major mode for editing Ruby code."
2649 (smie-setup ruby-smie-grammar #'ruby-smie-rules
2650 :forward-token #'ruby-smie--forward-token
2651 :backward-token #'ruby-smie--backward-token)
2652 (unless ruby-use-smie
2653 (setq-local indent-line-function #'ruby-indent-line))
2654
2655 (setq-local imenu-create-index-function #'ruby-imenu-create-index)
2656 (setq-local add-log-current-defun-function #'ruby-add-log-current-method)
2657 (setq-local beginning-of-defun-function #'ruby-beginning-of-defun)
2658 (setq-local end-of-defun-function #'ruby-end-of-defun)
2659
2652 (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil 2660 (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil
2653 ((?_ . "w")))) 2661 ((?_ . "w"))))
2654 (setq-local prettify-symbols-alist ruby--prettify-symbols-alist)
2655 2662
2656 (setq-local syntax-propertize-function #'ruby-syntax-propertize)) 2663 (setq-local syntax-propertize-function #'ruby-syntax-propertize))
2657 2664
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index 5c9a25c1fde..c086214a11d 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -23,7 +23,7 @@
23 23
24;;; Commentary: 24;;; Commentary:
25 25
26;; This file defines ruby-ts-mode which is a major mode for editting 26;; This file defines ruby-ts-mode which is a major mode for editing
27;; Ruby files that uses Tree Sitter to parse the language. More 27;; Ruby files that uses Tree Sitter to parse the language. More
28;; information about Tree Sitter can be found in the ELisp Info pages 28;; information about Tree Sitter can be found in the ELisp Info pages
29;; as well as this website: https://tree-sitter.github.io/tree-sitter/ 29;; as well as this website: https://tree-sitter.github.io/tree-sitter/
@@ -150,7 +150,7 @@ These are currently unused")
150 "parenthesized_statements" 150 "parenthesized_statements"
151 "interpolation") 151 "interpolation")
152 string-end) 152 string-end)
153 "Regular expression of the nodes that can constain statements.") 153 "Regular expression of the nodes that can contain statements.")
154 154
155(defun ruby-ts--lineno (node) 155(defun ruby-ts--lineno (node)
156 "Return line number of NODE's start." 156 "Return line number of NODE's start."
@@ -178,7 +178,7 @@ These are currently unused")
178Applies `font-lock-comment-delimiter-face' and 178Applies `font-lock-comment-delimiter-face' and
179`font-lock-comment-face' See `treesit-fontify-with-override' for 179`font-lock-comment-face' See `treesit-fontify-with-override' for
180values of OVERRIDE" 180values of OVERRIDE"
181 ;; Emperically it appears as if (treesit-node-start node) will be 181 ;; Empirically it appears as if (treesit-node-start node) will be
182 ;; where the # character is at and (treesit-node-end node) will be 182 ;; where the # character is at and (treesit-node-end node) will be
183 ;; the end of the line 183 ;; the end of the line
184 (let* ((node-start (treesit-node-start node)) 184 (let* ((node-start (treesit-node-start node))
@@ -237,8 +237,10 @@ values of OVERRIDE"
237 ;; Also before 'operator because % and / are operators 237 ;; Also before 'operator because % and / are operators
238 :language language 238 :language language
239 :feature 'regexp 239 :feature 'regexp
240 '((regex "/" @font-lock-regexp-grouping-construct) 240 ;; TODO: We probably need a separate face for regexps everywhere.
241 (regex _ (string_content) @font-lock-regexp-grouping-backslash)) 241 ;; Maybe another one for regexp delimiters as well.
242 '((regex "/" @font-lock-string-face)
243 (regex _ (string_content) @font-lock-string-face))
242 244
243 :language language 245 :language language
244 :feature 'operator 246 :feature 'operator
@@ -253,21 +255,22 @@ values of OVERRIDE"
253 :feature 'string 255 :feature 'string
254 '((delimited_symbol [ ":\"" "\"" ] @font-lock-string-face) 256 '((delimited_symbol [ ":\"" "\"" ] @font-lock-string-face)
255 (string "\"" @font-lock-string-face) 257 (string "\"" @font-lock-string-face)
256 (string_array [ "%w(" ")" ] @font-lock-delimiter-face) 258 (string_array ["%w(" ")"] @font-lock-string-face)
257 (subshell "`" @font-lock-delimiter-face) 259 (subshell "`" @font-lock-string-face)
258 (symbol_array [ "%i(" ")"] @font-lock-delimiter-face)) 260 (symbol_array ["%i(" ")"] @font-lock-constant-face))
259 261
260 :language language 262 :language language
261 :feature 'string 263 :feature 'string
262 '((string_content) @font-lock-string-face 264 '([(string_content)
263 (heredoc_beginning) @font-lock-string-face 265 (heredoc_beginning)
264 (heredoc_content) @font-lock-string-face 266 (heredoc_content)
265 (heredoc_end) @font-lock-string-face) 267 (heredoc_end)]
268 @font-lock-string-face)
266 269
267 :language language 270 :language language
268 :feature 'interpolation 271 :feature 'interpolation
269 '((interpolation "#{" @font-lock-doc-face) 272 '((interpolation "#{" @font-lock-delimiter-face)
270 (interpolation "}" @font-lock-doc-face)) 273 (interpolation "}" @font-lock-delimiter-face))
271 274
272 :language language 275 :language language
273 :feature 'type 276 :feature 'type
@@ -352,8 +355,11 @@ Otherwise return start of PRED."
352 (lambda (node parent bol &rest rest) 355 (lambda (node parent bol &rest rest)
353 (let* ((pred-node (funcall pred node parent bol rest)) 356 (let* ((pred-node (funcall pred node parent bol rest))
354 (temp (treesit-node-start pred-node)) 357 (temp (treesit-node-start pred-node))
355 (keyword (treesit-node-type pred-node)) 358 (type (treesit-node-type pred-node))
356 (bol (ruby-smie--indent-to-stmt-p keyword))) 359 (bol (ruby-smie--indent-to-stmt-p
360 (if (equal type "method")
361 "def"
362 type))))
357 (when temp 363 (when temp
358 (if bol 364 (if bol
359 (save-excursion 365 (save-excursion
@@ -717,7 +723,7 @@ i.e. expr of def foo(args) = expr is returned."
717 ((n-p-gp ,ruby-ts--method-regex "body_statement" ,ruby-ts--class-or-module-regex) 723 ((n-p-gp ,ruby-ts--method-regex "body_statement" ,ruby-ts--class-or-module-regex)
718 (ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level) 724 (ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level)
719 725
720 ;; Match the end of a class / modlue 726 ;; Match the end of a class / module
721 ((match "end" ,ruby-ts--class-or-module-regex) parent 0) 727 ((match "end" ,ruby-ts--class-or-module-regex) parent 0)
722 728
723 ;; A "do_block" has a "body_statement" child which has the 729 ;; A "do_block" has a "body_statement" child which has the
@@ -733,7 +739,7 @@ i.e. expr of def foo(args) = expr is returned."
733 ((match "end" "do_block") parent-bol 0) 739 ((match "end" "do_block") parent-bol 0)
734 ((n-p-gp "block_body" "block" nil) parent-bol ruby-indent-level) 740 ((n-p-gp "block_body" "block" nil) parent-bol ruby-indent-level)
735 ((n-p-gp nil "block_body" "block") (ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level) 741 ((n-p-gp nil "block_body" "block") (ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level)
736 ((match "}" "block") (ruby-ts--bol ruby-ts--grand-parent-node) 0) 742 ((match "}" "block") parent-bol 0)
737 743
738 ;; Chained strings 744 ;; Chained strings
739 ((match "string" "chained_string") first-sibling 0) 745 ((match "string" "chained_string") first-sibling 0)
@@ -892,21 +898,11 @@ leading double colon is not added."
892 "C-c C-f" #'ruby-find-library-file) 898 "C-c C-f" #'ruby-find-library-file)
893 899
894;;;###autoload 900;;;###autoload
895(define-derived-mode ruby-ts-mode prog-mode "Ruby" 901(define-derived-mode ruby-ts-mode ruby-base-mode "Ruby"
896 "Major mode for editing Ruby, powered by tree-sitter." 902 "Major mode for editing Ruby, powered by tree-sitter."
897 :group 'ruby 903 :group 'ruby
898 :syntax-table ruby-mode-syntax-table 904 :syntax-table ruby-mode-syntax-table
899 905
900 (setq indent-tabs-mode ruby-indent-tabs-mode)
901
902 (setq-local paragraph-start (concat "$\\|" page-delimiter))
903 (setq-local paragraph-separate paragraph-start)
904 (setq-local paragraph-ignore-fill-prefix t)
905
906 (setq-local comment-start "# ")
907 (setq-local comment-end "")
908 (setq-local comment-start-skip "#+ *")
909
910 (unless (treesit-ready-p 'ruby) 906 (unless (treesit-ready-p 'ruby)
911 (error "Tree-sitter for Ruby isn't available")) 907 (error "Tree-sitter for Ruby isn't available"))
912 908
diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index 9ad820ef2f8..f2e27395a55 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -167,6 +167,8 @@ Argument LANGUAGE is either `typescript' or `tsx'."
167 167
168 (method_definition 168 (method_definition
169 name: (property_identifier) @font-lock-function-name-face) 169 name: (property_identifier) @font-lock-function-name-face)
170 (method_signature
171 name: (property_identifier) @font-lock-function-name-face)
170 (required_parameter (identifier) @font-lock-variable-name-face) 172 (required_parameter (identifier) @font-lock-variable-name-face)
171 (optional_parameter (identifier) @font-lock-variable-name-face) 173 (optional_parameter (identifier) @font-lock-variable-name-face)
172 174
@@ -211,10 +213,8 @@ Argument LANGUAGE is either `typescript' or `tsx'."
211 213
212 (enum_assignment name: (property_identifier) @font-lock-type-face) 214 (enum_assignment name: (property_identifier) @font-lock-type-face)
213 215
214 (assignment_expression 216 (variable_declarator
215 left: [(identifier) @font-lock-variable-name-face 217 name: (identifier) @font-lock-variable-name-face)
216 (member_expression
217 property: (property_identifier) @font-lock-variable-name-face)])
218 218
219 (for_in_statement 219 (for_in_statement
220 left: (identifier) @font-lock-variable-name-face) 220 left: (identifier) @font-lock-variable-name-face)
@@ -242,10 +242,6 @@ Argument LANGUAGE is either `typescript' or `tsx'."
242 name: (property_identifier) @font-lock-property-face) 242 name: (property_identifier) @font-lock-property-face)
243 (public_field_definition 243 (public_field_definition
244 name: (property_identifier) @font-lock-property-face) 244 name: (property_identifier) @font-lock-property-face)
245 (member_expression
246 object: (identifier) @font-lock-variable-name-face)
247 (member_expression
248 property: (_) @font-lock-property-face)
249 245
250 (pair key: (property_identifier) @font-lock-variable-name-face) 246 (pair key: (property_identifier) @font-lock-variable-name-face)
251 247
@@ -263,9 +259,11 @@ Argument LANGUAGE is either `typescript' or `tsx'."
263 left: [(identifier) @font-lock-function-name-face 259 left: [(identifier) @font-lock-function-name-face
264 (member_expression 260 (member_expression
265 property: (property_identifier) @font-lock-function-name-face)] 261 property: (property_identifier) @font-lock-function-name-face)]
266 right: [(function) (arrow_function)]) 262 right: [(function) (arrow_function)]))
267 263
268 (call_expression 264 :language language
265 :feature 'function
266 '((call_expression
269 function: 267 function:
270 [(identifier) @font-lock-function-name-face 268 [(identifier) @font-lock-function-name-face
271 (member_expression 269 (member_expression
@@ -379,9 +377,10 @@ Argument LANGUAGE is either `typescript' or `tsx'."
379 (setq-local treesit-font-lock-settings 377 (setq-local treesit-font-lock-settings
380 (typescript-ts-mode--font-lock-settings 'typescript)) 378 (typescript-ts-mode--font-lock-settings 'typescript))
381 (setq-local treesit-font-lock-feature-list 379 (setq-local treesit-font-lock-feature-list
382 '((comment declaration keyword string escape-sequence) 380 '((comment declaration)
381 (keyword string escape-sequence)
383 (constant expression identifier number pattern property) 382 (constant expression identifier number pattern property)
384 (bracket delimiter))) 383 (function bracket delimiter)))
385 384
386 (treesit-major-mode-setup))) 385 (treesit-major-mode-setup)))
387 386
@@ -413,9 +412,10 @@ Argument LANGUAGE is either `typescript' or `tsx'."
413 (setq-local treesit-font-lock-settings 412 (setq-local treesit-font-lock-settings
414 (typescript-ts-mode--font-lock-settings 'tsx)) 413 (typescript-ts-mode--font-lock-settings 'tsx))
415 (setq-local treesit-font-lock-feature-list 414 (setq-local treesit-font-lock-feature-list
416 '((comment declaration keyword string escape-sequence) 415 '((comment declaration)
416 (keyword string escape-sequence)
417 (constant expression identifier jsx number pattern property) 417 (constant expression identifier jsx number pattern property)
418 (bracket delimiter))) 418 (function bracket delimiter)))
419 419
420 (treesit-major-mode-setup))) 420 (treesit-major-mode-setup)))
421 421
diff --git a/nt/INSTALL b/nt/INSTALL
index 2d973816e37..3b465ba494c 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -7,7 +7,7 @@
7The MSYS/MinGW build described here is supported on versions of 7The MSYS/MinGW build described here is supported on versions of
8Windows starting with Windows XP and newer. Building on Windows 2000 8Windows starting with Windows XP and newer. Building on Windows 2000
9and Windows 9X is not supported (but the Emacs binary produced by this 9and Windows 9X is not supported (but the Emacs binary produced by this
10build will run on Windows 9X and newer systems). 10build should run on Windows 9X and newer systems).
11 11
12 Do not use this recipe with Cygwin. For building on Cygwin, use the 12 Do not use this recipe with Cygwin. For building on Cygwin, use the
13 normal installation instructions, ../INSTALL. 13 normal installation instructions, ../INSTALL.
@@ -87,7 +87,7 @@ build will run on Windows 9X and newer systems).
87 87
88 Git for Windows is available from this download page: 88 Git for Windows is available from this download page:
89 89
90 https://github.com/git-for-windows/git/releases 90 https://gitforwindows.org/
91 91
92 That page offers both 32-bit and 64-bit installations; pick the one 92 That page offers both 32-bit and 64-bit installations; pick the one
93 suitable for your OS. In general, we recommend to install a 64-bit 93 suitable for your OS. In general, we recommend to install a 64-bit
@@ -139,7 +139,7 @@ build will run on Windows 9X and newer systems).
139 like to mess with manual installations. You can download it from 139 like to mess with manual installations. You can download it from
140 here: 140 here:
141 141
142 https://sourceforge.net/projects/mingw/files/Installer/mingw-get/ 142 https://osdn.net/projects/mingw/releases
143 143
144 (This installer only supports packages downloaded from the MinGW 144 (This installer only supports packages downloaded from the MinGW
145 site; for the rest you will still need the manual method.) 145 site; for the rest you will still need the manual method.)
@@ -203,13 +203,13 @@ build will run on Windows 9X and newer systems).
203 MinGW runtime and Windows API distributions, to compile Emacs. You 203 MinGW runtime and Windows API distributions, to compile Emacs. You
204 can find these on the MinGW download/Base page: 204 can find these on the MinGW download/Base page:
205 205
206 https://sourceforge.net/projects/mingw/files/MinGW/Base/ 206 https://osdn.net/projects/mingw/releases
207 207
208 In general, install the latest stable versions of the following 208 In general, install the latest stable versions of the following
209 MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You 209 MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You
210 only need the 'bin' and the 'dll' tarballs of each of the above. 210 only need the 'bin' and the 'dll' tarballs of each of the above.
211 211
212 MinGW packages are distributed as .tar.lzma compressed archives. To 212 MinGW packages are distributed as .tar.xz compressed archives. To
213 install the packages manually, we recommend to use the Windows port 213 install the packages manually, we recommend to use the Windows port
214 of the 'bsdtar' program to unpack the tarballs. 'bsdtar' is 214 of the 'bsdtar' program to unpack the tarballs. 'bsdtar' is
215 available as part of the 'libarchive' package from here: 215 available as part of the 'libarchive' package from here:
@@ -598,8 +598,7 @@ build will run on Windows 9X and newer systems).
598* Optional image library support 598* Optional image library support
599 599
600 In addition to its "native" image formats (pbm and xbm), Emacs can 600 In addition to its "native" image formats (pbm and xbm), Emacs can
601 handle other image types: xpm, tiff, gif, png, jpeg, webp and 601 handle other image types: xpm, tiff, gif, png, jpeg, webp and svg.
602 experimental support for svg.
603 602
604 To build Emacs with support for them, the corresponding headers must 603 To build Emacs with support for them, the corresponding headers must
605 be in the include path and libraries should be where the linker 604 be in the include path and libraries should be where the linker
@@ -846,6 +845,20 @@ build will run on Windows 9X and newer systems).
846 from the MSYS2 project. If HarfBuzz is not available, Emacs will 845 from the MSYS2 project. If HarfBuzz is not available, Emacs will
847 use the Uniscribe shaping engine that is part of MS-Windows. 846 use the Uniscribe shaping engine that is part of MS-Windows.
848 847
848* Optional support for accessing SQLite databases
849
850 Emacs can support built-in access to SQLite databases, if compiled
851 with the sqlite3 library. Prebuilt 32-bit binaries of that library
852 are available from the ezwinports site.
853
854* Optional support for tree-sitter
855
856 Emacs can be built with the tree-sitter incremental parsing library,
857 which enables editing of program sources written in various
858 programming languages based on the tree-sitter parsers. Prebuilt
859 32-bit binaries of the tree-sitter library DLL and of several
860 language grammar libraries are available from the ezwinports site.
861
849 862
850This file is part of GNU Emacs. 863This file is part of GNU Emacs.
851 864
diff --git a/src/callproc.c b/src/callproc.c
index 7208ceb5d2f..5e1e1a8cc0a 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -259,8 +259,8 @@ input come from an Emacs buffer, use `call-process-region' instead.
259Third argument DESTINATION specifies how to handle program's output. 259Third argument DESTINATION specifies how to handle program's output.
260(\"Output\" here means both standard output and standard error 260(\"Output\" here means both standard output and standard error
261output.) 261output.)
262If DESTINATION is a buffer, or t that stands for the current buffer, 262If DESTINATION is a buffer or the name of a buffer, or t (which stands for
263 it means insert output in that buffer before point. 263the current buffer), it means insert output in that buffer before point.
264If DESTINATION is nil, it means discard output; 0 means discard 264If DESTINATION is nil, it means discard output; 0 means discard
265 and don't wait for the program to terminate. 265 and don't wait for the program to terminate.
266If DESTINATION is `(:file FILE)', where FILE is a file name string, 266If DESTINATION is `(:file FILE)', where FILE is a file name string,
@@ -1055,6 +1055,7 @@ Insert output in BUFFER before point; t means current buffer; nil for
1055 BUFFER means discard it; 0 means discard and don't wait; and `(:file 1055 BUFFER means discard it; 0 means discard and don't wait; and `(:file
1056 FILE)', where FILE is a file name string, means that it should be 1056 FILE)', where FILE is a file name string, means that it should be
1057 written to that file (if the file already exists it is overwritten). 1057 written to that file (if the file already exists it is overwritten).
1058BUFFER can be a string which is the name of a buffer.
1058BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case, 1059BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
1059REAL-BUFFER says what to do with standard output, as above, 1060REAL-BUFFER says what to do with standard output, as above,
1060while STDERR-FILE says what to do with standard error in the child. 1061while STDERR-FILE says what to do with standard error in the child.
diff --git a/src/haikufns.c b/src/haikufns.c
index 59332346dab..b591c143900 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -175,19 +175,17 @@ haiku_change_tool_bar_height (struct frame *f, int height)
175void 175void
176haiku_change_tab_bar_height (struct frame *f, int height) 176haiku_change_tab_bar_height (struct frame *f, int height)
177{ 177{
178 int unit, old_height, lines; 178 int unit = FRAME_LINE_HEIGHT (f);
179 Lisp_Object fullscreen; 179 int old_height = FRAME_TAB_BAR_HEIGHT (f);
180
181 unit = FRAME_LINE_HEIGHT (f);
182 old_height = FRAME_TAB_BAR_HEIGHT (f);
183 fullscreen = get_frame_param (f, Qfullscreen);
184 180
185 /* This differs from the tool bar code in that the tab bar height is 181 /* This differs from the tool bar code in that the tab bar height is
186 not rounded up. Otherwise, if redisplay_tab_bar decides to grow 182 not rounded up. Otherwise, if redisplay_tab_bar decides to grow
187 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, 183 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
188 leading to the tab bar height being incorrectly set upon the next 184 leading to the tab bar height being incorrectly set upon the next
189 call to x_set_font. (bug#59285) */ 185 call to x_set_font. (bug#59285) */
190 lines = height / unit; 186 int lines = height / unit;
187 if (lines == 0 && height != 0)
188 lines = 1;
191 189
192 /* Make sure we redisplay all windows in this frame. */ 190 /* Make sure we redisplay all windows in this frame. */
193 fset_redisplay (f); 191 fset_redisplay (f);
@@ -208,6 +206,8 @@ haiku_change_tab_bar_height (struct frame *f, int height)
208 206
209 if (!f->tab_bar_resized) 207 if (!f->tab_bar_resized)
210 { 208 {
209 Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
210
211 /* As long as tab_bar_resized is false, effectively try to change 211 /* As long as tab_bar_resized is false, effectively try to change
212 F's native height. */ 212 F's native height. */
213 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth)) 213 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))
diff --git a/src/nsfns.m b/src/nsfns.m
index 8c78657db50..8804a7df7cf 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -632,19 +632,17 @@ ns_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
632void 632void
633ns_change_tab_bar_height (struct frame *f, int height) 633ns_change_tab_bar_height (struct frame *f, int height)
634{ 634{
635 int unit, old_height, lines; 635 int unit = FRAME_LINE_HEIGHT (f);
636 Lisp_Object fullscreen; 636 int old_height = FRAME_TAB_BAR_HEIGHT (f);
637
638 unit = FRAME_LINE_HEIGHT (f);
639 old_height = FRAME_TAB_BAR_HEIGHT (f);
640 fullscreen = get_frame_param (f, Qfullscreen);
641 637
642 /* This differs from the tool bar code in that the tab bar height is 638 /* This differs from the tool bar code in that the tab bar height is
643 not rounded up. Otherwise, if redisplay_tab_bar decides to grow 639 not rounded up. Otherwise, if redisplay_tab_bar decides to grow
644 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, 640 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
645 leading to the tab bar height being incorrectly set upon the next 641 leading to the tab bar height being incorrectly set upon the next
646 call to x_set_font. (bug#59285) */ 642 call to x_set_font. (bug#59285) */
647 lines = height / unit; 643 int lines = height / unit;
644 if (lines == 0 && height != 0)
645 lines = 1;
648 646
649 /* Make sure we redisplay all windows in this frame. */ 647 /* Make sure we redisplay all windows in this frame. */
650 fset_redisplay (f); 648 fset_redisplay (f);
@@ -665,6 +663,8 @@ ns_change_tab_bar_height (struct frame *f, int height)
665 663
666 if (!f->tab_bar_resized) 664 if (!f->tab_bar_resized)
667 { 665 {
666 Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
667
668 /* As long as tab_bar_resized is false, effectively try to change 668 /* As long as tab_bar_resized is false, effectively try to change
669 F's native height. */ 669 F's native height. */
670 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth)) 670 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))
diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 57591d2693c..6b3a0459d36 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -473,19 +473,17 @@ pgtk_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
473void 473void
474pgtk_change_tab_bar_height (struct frame *f, int height) 474pgtk_change_tab_bar_height (struct frame *f, int height)
475{ 475{
476 int unit, old_height, lines; 476 int unit = FRAME_LINE_HEIGHT (f);
477 Lisp_Object fullscreen; 477 int old_height = FRAME_TAB_BAR_HEIGHT (f);
478
479 unit = FRAME_LINE_HEIGHT (f);
480 old_height = FRAME_TAB_BAR_HEIGHT (f);
481 fullscreen = get_frame_param (f, Qfullscreen);
482 478
483 /* This differs from the tool bar code in that the tab bar height is 479 /* This differs from the tool bar code in that the tab bar height is
484 not rounded up. Otherwise, if redisplay_tab_bar decides to grow 480 not rounded up. Otherwise, if redisplay_tab_bar decides to grow
485 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, 481 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
486 leading to the tab bar height being incorrectly set upon the next 482 leading to the tab bar height being incorrectly set upon the next
487 call to x_set_font. (bug#59285) */ 483 call to x_set_font. (bug#59285) */
488 lines = height / unit; 484 int lines = height / unit;
485 if (lines == 0 && height != 0)
486 lines = 1;
489 487
490 /* Make sure we redisplay all windows in this frame. */ 488 /* Make sure we redisplay all windows in this frame. */
491 fset_redisplay (f); 489 fset_redisplay (f);
@@ -506,6 +504,8 @@ pgtk_change_tab_bar_height (struct frame *f, int height)
506 504
507 if (!f->tab_bar_resized) 505 if (!f->tab_bar_resized)
508 { 506 {
507 Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
508
509 /* As long as tab_bar_resized is false, effectively try to change 509 /* As long as tab_bar_resized is false, effectively try to change
510 F's native height. */ 510 F's native height. */
511 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth)) 511 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))
diff --git a/src/w32fns.c b/src/w32fns.c
index 9d02e680fe8..192d3ddf27a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1717,19 +1717,17 @@ w32_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1717void 1717void
1718w32_change_tab_bar_height (struct frame *f, int height) 1718w32_change_tab_bar_height (struct frame *f, int height)
1719{ 1719{
1720 int unit, old_height, lines; 1720 int unit = FRAME_LINE_HEIGHT (f);
1721 Lisp_Object fullscreen; 1721 int old_height = FRAME_TAB_BAR_HEIGHT (f);
1722
1723 unit = FRAME_LINE_HEIGHT (f);
1724 old_height = FRAME_TAB_BAR_HEIGHT (f);
1725 fullscreen = get_frame_param (f, Qfullscreen);
1726 1722
1727 /* This differs from the tool bar code in that the tab bar height is 1723 /* This differs from the tool bar code in that the tab bar height is
1728 not rounded up. Otherwise, if redisplay_tab_bar decides to grow 1724 not rounded up. Otherwise, if redisplay_tab_bar decides to grow
1729 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, 1725 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
1730 leading to the tab bar height being incorrectly set upon the next 1726 leading to the tab bar height being incorrectly set upon the next
1731 call to x_set_font. (bug#59285) */ 1727 call to x_set_font. (bug#59285) */
1732 lines = height / unit; 1728 int lines = height / unit;
1729 if (lines == 0 && height != 0)
1730 lines = 1;
1733 1731
1734 /* Make sure we redisplay all windows in this frame. */ 1732 /* Make sure we redisplay all windows in this frame. */
1735 fset_redisplay (f); 1733 fset_redisplay (f);
@@ -1758,6 +1756,8 @@ w32_change_tab_bar_height (struct frame *f, int height)
1758 1756
1759 if (!f->tab_bar_resized) 1757 if (!f->tab_bar_resized)
1760 { 1758 {
1759 Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
1760
1761 /* As long as tab_bar_resized is false, effectively try to change 1761 /* As long as tab_bar_resized is false, effectively try to change
1762 F's native height. */ 1762 F's native height. */
1763 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth)) 1763 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))
diff --git a/src/xfns.c b/src/xfns.c
index dac347e4661..3a129211463 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1757,19 +1757,17 @@ x_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1757void 1757void
1758x_change_tab_bar_height (struct frame *f, int height) 1758x_change_tab_bar_height (struct frame *f, int height)
1759{ 1759{
1760 int unit, old_height, lines; 1760 int unit = FRAME_LINE_HEIGHT (f);
1761 Lisp_Object fullscreen; 1761 int old_height = FRAME_TAB_BAR_HEIGHT (f);
1762
1763 unit = FRAME_LINE_HEIGHT (f);
1764 old_height = FRAME_TAB_BAR_HEIGHT (f);
1765 fullscreen = get_frame_param (f, Qfullscreen);
1766 1762
1767 /* This differs from the tool bar code in that the tab bar height is 1763 /* This differs from the tool bar code in that the tab bar height is
1768 not rounded up. Otherwise, if redisplay_tab_bar decides to grow 1764 not rounded up. Otherwise, if redisplay_tab_bar decides to grow
1769 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, 1765 the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
1770 leading to the tab bar height being incorrectly set upon the next 1766 leading to the tab bar height being incorrectly set upon the next
1771 call to x_set_font. (bug#59285) */ 1767 call to x_set_font. (bug#59285) */
1772 lines = height / unit; 1768 int lines = height / unit;
1769 if (lines == 0 && height != 0)
1770 lines = 1;
1773 1771
1774 /* Make sure we redisplay all windows in this frame. */ 1772 /* Make sure we redisplay all windows in this frame. */
1775 fset_redisplay (f); 1773 fset_redisplay (f);
@@ -1790,6 +1788,8 @@ x_change_tab_bar_height (struct frame *f, int height)
1790 1788
1791 if (!f->tab_bar_resized) 1789 if (!f->tab_bar_resized)
1792 { 1790 {
1791 Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
1792
1793 /* As long as tab_bar_resized is false, effectively try to change 1793 /* As long as tab_bar_resized is false, effectively try to change
1794 F's native height. */ 1794 F's native height. */
1795 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth)) 1795 if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 6807b24bfc6..85506c3d27e 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -1001,11 +1001,11 @@
1001 1001
1002(ert-deftest erc-select-read-args () 1002(ert-deftest erc-select-read-args ()
1003 1003
1004 (ert-info ("Defaults to TLS") 1004 (ert-info ("Does not default to TLS")
1005 (should (equal (ert-simulate-keys "\r\r\r\r" 1005 (should (equal (ert-simulate-keys "\r\r\r\r"
1006 (erc-select-read-args)) 1006 (erc-select-read-args))
1007 (list :server "irc.libera.chat" 1007 (list :server "irc.libera.chat"
1008 :port 6697 1008 :port 6667
1009 :nick (user-login-name) 1009 :nick (user-login-name)
1010 :password nil)))) 1010 :password nil))))
1011 1011
@@ -1036,7 +1036,7 @@
1036 :password nil)))) 1036 :password nil))))
1037 1037
1038 (ert-info ("Address includes nick and password") 1038 (ert-info ("Address includes nick and password")
1039 (should (equal (ert-simulate-keys "nick:sesame@localhost:6667\r" 1039 (should (equal (ert-simulate-keys "nick:sesame@localhost:6667\r\r"
1040 (erc-select-read-args)) 1040 (erc-select-read-args))
1041 (list :server "localhost" 1041 (list :server "localhost"
1042 :port 6667 1042 :port 6667
diff --git a/test/lisp/progmodes/ruby-ts-mode-tests.el b/test/lisp/progmodes/ruby-ts-mode-tests.el
index f48d0bf6330..aa1ab1e2605 100644
--- a/test/lisp/progmodes/ruby-ts-mode-tests.el
+++ b/test/lisp/progmodes/ruby-ts-mode-tests.el
@@ -44,7 +44,7 @@ The whitespace before and including \"|\" on each line is removed."
44 (apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args)) 44 (apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args))
45 45
46(ert-deftest ruby-ts-indent-simple () 46(ert-deftest ruby-ts-indent-simple ()
47 (skip-unless (treesit-available-p)) 47 (skip-unless (treesit-ready-p 'ruby t))
48 (ruby-ts-should-indent-buffer 48 (ruby-ts-should-indent-buffer
49 "if foo 49 "if foo
50 | bar 50 | bar
@@ -58,7 +58,7 @@ The whitespace before and including \"|\" on each line is removed."
58 |")) 58 |"))
59 59
60(ert-deftest ruby-ts-align-to-stmt-keywords-t () 60(ert-deftest ruby-ts-align-to-stmt-keywords-t ()
61 (skip-unless (treesit-available-p)) 61 (skip-unless (treesit-ready-p 'ruby t))
62 (let ((ruby-align-to-stmt-keywords t)) 62 (let ((ruby-align-to-stmt-keywords t))
63 (ruby-ts-should-indent-buffer 63 (ruby-ts-should-indent-buffer
64 "foo = if bar? 64 "foo = if bar?
@@ -94,7 +94,7 @@ The whitespace before and including \"|\" on each line is removed."
94 )) 94 ))
95 95
96(ert-deftest ruby-ts-align-to-stmt-keywords-case () 96(ert-deftest ruby-ts-align-to-stmt-keywords-case ()
97 (skip-unless (treesit-available-p)) 97 (skip-unless (treesit-ready-p 'ruby t))
98 (let ((ruby-align-to-stmt-keywords '(case))) 98 (let ((ruby-align-to-stmt-keywords '(case)))
99 (ruby-ts-should-indent-buffer 99 (ruby-ts-should-indent-buffer
100 "b = case a 100 "b = case a
@@ -111,7 +111,7 @@ The whitespace before and including \"|\" on each line is removed."
111 | end"))) 111 | end")))
112 112
113(ert-deftest ruby-ts-add-log-current-method-examples () 113(ert-deftest ruby-ts-add-log-current-method-examples ()
114 (skip-unless (treesit-available-p)) 114 (skip-unless (treesit-ready-p 'ruby t))
115 (let ((pairs '(("foo" . "#foo") 115 (let ((pairs '(("foo" . "#foo")
116 ("C.foo" . ".foo") 116 ("C.foo" . ".foo")
117 ("self.foo" . ".foo") 117 ("self.foo" . ".foo")
@@ -134,7 +134,7 @@ The whitespace before and including \"|\" on each line is removed."
134 (format "M::C%s" value)))))))) 134 (format "M::C%s" value))))))))
135 135
136(ert-deftest ruby-ts-add-log-current-method-outside-of-method () 136(ert-deftest ruby-ts-add-log-current-method-outside-of-method ()
137 (skip-unless (treesit-available-p)) 137 (skip-unless (treesit-ready-p 'ruby t))
138 (ruby-ts-with-temp-buffer (ruby-ts-test-string 138 (ruby-ts-with-temp-buffer (ruby-ts-test-string
139 "module M 139 "module M
140 | class C 140 | class C
@@ -147,7 +147,7 @@ The whitespace before and including \"|\" on each line is removed."
147 (should (string= (ruby-ts-add-log-current-function) "M::C")))) 147 (should (string= (ruby-ts-add-log-current-function) "M::C"))))
148 148
149(ert-deftest ruby-ts-add-log-current-method-in-singleton-class () 149(ert-deftest ruby-ts-add-log-current-method-in-singleton-class ()
150 (skip-unless (treesit-available-p)) 150 (skip-unless (treesit-ready-p 'ruby t))
151 (ruby-ts-with-temp-buffer (ruby-ts-test-string 151 (ruby-ts-with-temp-buffer (ruby-ts-test-string
152 "class C 152 "class C
153 | class << self 153 | class << self
@@ -160,7 +160,7 @@ The whitespace before and including \"|\" on each line is removed."
160 (should (string= (ruby-ts-add-log-current-function) "C.foo")))) 160 (should (string= (ruby-ts-add-log-current-function) "C.foo"))))
161 161
162(ert-deftest ruby-ts-add-log-current-method-namespace-shorthand () 162(ert-deftest ruby-ts-add-log-current-method-namespace-shorthand ()
163 (skip-unless (treesit-available-p)) 163 (skip-unless (treesit-ready-p 'ruby t))
164 (ruby-ts-with-temp-buffer (ruby-ts-test-string 164 (ruby-ts-with-temp-buffer (ruby-ts-test-string
165 "class C::D 165 "class C::D
166 | def foo 166 | def foo
@@ -171,7 +171,7 @@ The whitespace before and including \"|\" on each line is removed."
171 (should (string= (ruby-ts-add-log-current-function) "C::D#foo")))) 171 (should (string= (ruby-ts-add-log-current-function) "C::D#foo"))))
172 172
173(ert-deftest ruby-ts-add-log-current-method-after-inner-class () 173(ert-deftest ruby-ts-add-log-current-method-after-inner-class ()
174 (skip-unless (treesit-available-p)) 174 (skip-unless (treesit-ready-p 'ruby t))
175 (ruby-ts-with-temp-buffer (ruby-ts-test-string 175 (ruby-ts-with-temp-buffer (ruby-ts-test-string
176 "module M 176 "module M
177 | class C 177 | class C
@@ -186,7 +186,7 @@ The whitespace before and including \"|\" on each line is removed."
186 (should (string= (ruby-ts-add-log-current-function) "M::C#foo")))) 186 (should (string= (ruby-ts-add-log-current-function) "M::C#foo"))))
187 187
188(ert-deftest ruby-ts-add-log-current-method-after-inner-class-outside-methods () 188(ert-deftest ruby-ts-add-log-current-method-after-inner-class-outside-methods ()
189 (skip-unless (treesit-available-p)) 189 (skip-unless (treesit-ready-p 'ruby t))
190 (ruby-ts-with-temp-buffer (ruby-ts-test-string 190 (ruby-ts-with-temp-buffer (ruby-ts-test-string
191 "module M 191 "module M
192 | class C 192 | class C
@@ -201,7 +201,7 @@ The whitespace before and including \"|\" on each line is removed."
201 (should (string= (ruby-ts-add-log-current-function) "M::C")))) 201 (should (string= (ruby-ts-add-log-current-function) "M::C"))))
202 202
203(ert-deftest ruby-ts-add-log-current-method-after-inner-class-outside-methods-with-text () 203(ert-deftest ruby-ts-add-log-current-method-after-inner-class-outside-methods-with-text ()
204 (skip-unless (treesit-available-p)) 204 (skip-unless (treesit-ready-p 'ruby t))
205 (ruby-ts-with-temp-buffer (ruby-ts-test-string 205 (ruby-ts-with-temp-buffer (ruby-ts-test-string
206 "module M 206 "module M
207 | class C 207 | class C
@@ -215,7 +215,7 @@ The whitespace before and including \"|\" on each line is removed."
215 (should (string= (ruby-ts-add-log-current-function) "M::C")))) 215 (should (string= (ruby-ts-add-log-current-function) "M::C"))))
216 216
217(ert-deftest ruby-ts-add-log-current-method-after-endless-method () 217(ert-deftest ruby-ts-add-log-current-method-after-endless-method ()
218 (skip-unless (treesit-available-p)) 218 (skip-unless (treesit-ready-p 'ruby t))
219 (ruby-ts-with-temp-buffer (ruby-ts-test-string 219 (ruby-ts-with-temp-buffer (ruby-ts-test-string
220 "module M 220 "module M
221 | class C 221 | class C
@@ -237,7 +237,7 @@ The whitespace before and including \"|\" on each line is removed."
237(defmacro ruby-ts-deftest-indent (file) 237(defmacro ruby-ts-deftest-indent (file)
238 `(ert-deftest ,(intern (format "ruby-ts-indent-test/%s" file)) () 238 `(ert-deftest ,(intern (format "ruby-ts-indent-test/%s" file)) ()
239 ;; :tags '(:expensive-test) 239 ;; :tags '(:expensive-test)
240 (skip-unless (treesit-available-p)) 240 (skip-unless (treesit-ready-p 'ruby t))
241 (let ((buf (find-file-noselect (ruby-ts-resource-file ,file)))) 241 (let ((buf (find-file-noselect (ruby-ts-resource-file ,file))))
242 (unwind-protect 242 (unwind-protect
243 (with-current-buffer buf 243 (with-current-buffer buf