1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Merge from origin/emacs-29

6dd3e352f4 Extract common code into ruby-base-mode to derive from
94e330243e ruby-ts-mode: Indentation fixes
9b24417dda ruby-ts--font-lock-settings: Use more standard faces
9e6536e4d9 ruby-ts-mode: Standardize the string literal highlights
1a9a1fdebf Improve fontification in java-ts-mode (bug#60492)
dfdf9c21cb Fontification improvements in typescript-ts-mode (bug#60500)
68e68dfeef Improve fontification consistency in js-ts-mode (bug#60503)
aef869e74f ; Update tree-sitter manual
4ef12cfb1f ; Fix tree-sitter manual title case
aab8ddca5e ; nt/INSTALL: Update for Emacs 29.
809fbb0e8c ; Update copyright notice in tramp-sh.el
f8f5202487 (typescript/tsx-ts-mode): Split font-lock feature list in...
a86a213e1a js-ts-mode: Move 'string-interpolation' to font-lock level 3
d26b523886 Fix shrinking of the tab-bar
3f7ea621b9 ; Fix typos in ruby-ts-mode.el
9599b05431 ; Skip ruby-ts tests if grammar is not available
ff35ac9dfa Fix default-port regression in erc-select-read-args
b7ad0b4014 ; Clarify doc strings of 'call-process' and 'call-process...
This commit is contained in:
Stefan Kangas 2023-01-03 06:30:17 +01:00
commit 55e41707ea
20 changed files with 200 additions and 166 deletions

View file

@ -1370,7 +1370,7 @@ Parsing Program Source
* Accessing Node Information:: Accessing node information.
* Pattern Matching:: Pattern matching with query patterns.
* Multiple Languages:: Parse text written in multiple languages.
* Tree-sitter major modes:: Develop major modes using tree-sitter.
* Tree-sitter Major Modes:: Develop major modes using tree-sitter.
* Tree-sitter C API:: Compare the C API and the ELisp API.
Syntax Descriptors

View file

@ -2863,10 +2863,10 @@ matched by @var{regexp} and @var{pred} are not grouped under
@var{name-fn} should be either @var{nil} or a function that takes a
defun node and returns the name of that defun, e.g., the function name
for a function definition. If @var{name-fn} is @var{nil},
@code{treesit-defun-name} (@pxref{Tree-sitter major modes}) is used
@code{treesit-defun-name} (@pxref{Tree-sitter Major Modes}) is used
instead.
@code{treesit-major-mode-setup} (@pxref{Tree-sitter major modes})
@code{treesit-major-mode-setup} (@pxref{Tree-sitter Major Modes})
automatically sets up Imenu if this variable is non-@code{nil}.
@end defvar

View file

@ -45,7 +45,7 @@ source files that mix multiple programming languages.
* Accessing Node Information:: Accessing node information.
* Pattern Matching:: Pattern matching with query patterns.
* Multiple Languages:: Parse text written in multiple languages.
* Tree-sitter major modes:: Develop major modes using tree-sitter.
* Tree-sitter Major Modes:: Develop major modes using tree-sitter.
* Tree-sitter C API:: Compare the C API and the ELisp API.
@end menu
@ -1675,7 +1675,7 @@ language of the buffer text at @var{pos}. This variable is used by
@code{treesit-language-at}.
@end defvar
@node Tree-sitter major modes
@node Tree-sitter Major Modes
@section Developing major modes with tree-sitter
@cindex major mode, developing with tree-sitter

View file

@ -848,25 +848,14 @@ The value of this variable is a regexp matching the node type of defun
nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.)
For example, @code{python-mode} sets this variable to a regexp that
matches either @code{function_definition} or @code{class_definition}.
matches either @code{"function_definition"} or @code{"class_definition"}.
@end defvar
@defvar treesit-defun-prefer-top-level
If this variable is non-@code{nil}, Emacs skips nested defuns, when it
looks for beginning and end of a defun, and prefers to go to the
top-level defun instead.
In some languages, a defun could be nested in another one. By default,
Emacs stops at the first defun it encounters. But if this variable's
value is @code{t}, whenever Emacs finds a defun node, it tries to go
up the parse tree until it finds the top-level defun.
This variable can also be a list of cons cells of the form
@w{@code{(@var{from} . @var{to}))}}, where @var{from} and @var{to} are
regexps matching tree-sitter node types. When Emacs finds a defun
node whose type matches any of the @var{from} regexps in the list, it
then tries to go up the parse tree until it finds a higher-level node
matching the corresponding @var{to} regexp.
@defvar treesit-defun-tactic
This variable determines how does Emacs treat nested defuns. If the
value is @code{top-level}, navigation functions only move across
top-level defuns, if the value is @code{nested}, navigation functions
recognize nested defuns.
@end defvar
@node Skipping Characters

View file

@ -2161,6 +2161,23 @@ parameters SERVER and NICK."
(setq input (concat "irc://" input)))
input)
;; A temporary means of addressing the problem of ERC's namesake entry
;; point defaulting to a non-TLS connection with its default server
;; (bug#60428).
(defun erc--warn-unencrypted ()
;; Remove unconditionally to avoid wrong context due to races from
;; simultaneous dialing or aborting (e.g., via `keybaord-quit').
(remove-hook 'erc--server-post-connect-hook #'erc--warn-unencrypted)
(when (and (process-contact erc-server-process :nowait)
(equal erc-session-server erc-default-server)
(eql erc-session-port erc-default-port))
;; FIXME use the autoloaded `info' instead of `Info-goto-node' in
;; `erc-button-alist'.
(require 'info nil t)
(erc-display-error-notice
nil (concat "This connection is unencrypted. Please use `erc-tls'"
" from now on. See Info:\"(erc) connecting\" for more."))))
;;;###autoload
(defun erc-select-read-args ()
"Prompt the user for values of nick, server, port, and password."
@ -2171,10 +2188,7 @@ parameters SERVER and NICK."
;; For legacy reasons, also accept a URL without a scheme.
(url (url-generic-parse-url (erc--ensure-url input)))
(server (url-host url))
(sp (and (or (string-suffix-p "s" (url-type url))
(and (equal server erc-default-server)
(not (string-prefix-p "irc://" input))))
'ircs-u))
(sp (and (string-suffix-p "s" (url-type url)) erc-default-port-tls))
(port (or (url-portspec url)
(erc-compute-port
(let ((d (erc-compute-port sp))) ; may be a string
@ -2187,13 +2201,19 @@ parameters SERVER and NICK."
(let ((d (erc-compute-nick)))
(read-string (format "Nickname (default is %S): " d)
nil 'erc-nick-history-list d))))
(passwd (or (url-password url)
(if erc-prompt-for-password
(read-passwd "Server password (optional): ")
(with-suppressed-warnings ((obsolete erc-password))
erc-password)))))
(passwd (let* ((p (with-suppressed-warnings ((obsolete erc-password))
(or (url-password url) erc-password)))
(m (if p
(format "Server password (default is %S): " p)
"Server password (optional): ")))
(if erc-prompt-for-password (read-passwd m nil p) p))))
(when (and passwd (string= "" passwd))
(setq passwd nil))
(when (and (equal server erc-default-server)
(eql port erc-default-port)
(not (eql port erc-default-port-tls)) ; not `erc-tls'
(not (string-prefix-p "irc://" input))) ; not yanked URL
(add-hook 'erc--server-post-connect-hook #'erc--warn-unencrypted))
(list :server server :port port :nick nick :password passwd)))
;;;###autoload

View file

@ -838,7 +838,6 @@ characters need to be doubled.")
(defconst tramp-perl-encode
"%p -e '
# This script contributed by Juanma Barranquero <lektu@terra.es>.
# Copyright (C) 2002-2022 Free Software Foundation, Inc.
use strict;
my %%trans = do {
@ -877,7 +876,6 @@ characters need to be doubled.")
(defconst tramp-perl-decode
"%p -e '
# This script contributed by Juanma Barranquero <lektu@terra.es>.
# Copyright (C) 2002-2022 Free Software Foundation, Inc.
use strict;
my %%trans = do {

View file

@ -240,7 +240,9 @@
(method_invocation
name: (identifier) @font-lock-function-name-face)
(argument_list (identifier) @font-lock-variable-name-face))
(argument_list (identifier) @font-lock-variable-name-face)
(expression_statement (identifier) @font-lock-variable-name-face))
:language 'java
:feature 'bracket

View file

@ -3521,6 +3521,15 @@ This function is intended for use in `after-change-functions'."
(method_definition
name: (property_identifier) @font-lock-function-name-face)
(method_definition
parameters: (formal_parameters (identifier) @font-lock-variable-name-face))
(arrow_function
parameters: (formal_parameters (identifier) @font-lock-variable-name-face))
(function_declaration
parameters: (formal_parameters (identifier) @font-lock-variable-name-face))
(variable_declarator
name: (identifier) @font-lock-variable-name-face)
@ -3822,9 +3831,8 @@ Currently there are `js-mode' and `js-ts-mode'."
'(( comment definition)
( keyword string)
( assignment constant escape-sequence jsx number
pattern)
( bracket delimiter function operator property
string-interpolation)))
pattern string-interpolation)
( bracket delimiter function operator property)))
;; Imenu
(setq-local treesit-simple-imenu-settings
`(("Function" "\\`function_declaration\\'" nil nil)

View file

@ -899,24 +899,6 @@ This only affects the output of the command `ruby-toggle-block'."
(while (and (setq state (apply #'ruby-parse-partial end state))
(>= (nth 2 state) 0) (< (point) end))))))
(defun ruby-mode-variables ()
"Set up initial buffer-local variables for Ruby mode."
(setq indent-tabs-mode ruby-indent-tabs-mode)
(smie-setup ruby-smie-grammar #'ruby-smie-rules
:forward-token #'ruby-smie--forward-token
:backward-token #'ruby-smie--backward-token)
(unless ruby-use-smie
(setq-local indent-line-function #'ruby-indent-line))
(setq-local comment-start "# ")
(setq-local comment-end "")
(setq-local comment-column ruby-comment-column)
(setq-local comment-start-skip "#+ *")
(setq-local parse-sexp-ignore-comments t)
(setq-local parse-sexp-lookup-properties t)
(setq-local paragraph-start (concat "$\\|" page-delimiter))
(setq-local paragraph-separate paragraph-start)
(setq-local paragraph-ignore-fill-prefix t))
(defun ruby--insert-coding-comment (encoding)
"Insert a magic coding comment for ENCODING.
The 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
"Value for `prettify-symbols-alist' in `ruby-mode'.")
;;;###autoload
(define-derived-mode ruby-mode prog-mode "Ruby"
"Major mode for editing Ruby code."
(ruby-mode-variables)
(define-derived-mode ruby-base-mode prog-mode "Ruby"
"Generic major mode for editing Ruby.
(setq-local imenu-create-index-function #'ruby-imenu-create-index)
(setq-local add-log-current-defun-function #'ruby-add-log-current-method)
(setq-local beginning-of-defun-function #'ruby-beginning-of-defun)
(setq-local end-of-defun-function #'ruby-end-of-defun)
This mode is intended to be inherited by concrete major modes.
Currently there are `ruby-mode' and `ruby-ts-mode'."
(setq indent-tabs-mode ruby-indent-tabs-mode)
(setq-local comment-start "# ")
(setq-local comment-end "")
(setq-local comment-column ruby-comment-column)
(setq-local comment-start-skip "#+ *")
(setq-local parse-sexp-ignore-comments t)
(setq-local parse-sexp-lookup-properties t)
(setq-local paragraph-start (concat "$\\|" page-delimiter))
(setq-local paragraph-separate paragraph-start)
(setq-local paragraph-ignore-fill-prefix t)
;; `outline-regexp' contains the first part of `ruby-indent-beg-re'
(setq-local outline-regexp (concat "^\\s *"
(regexp-opt '("class" "module" "def"))
"\\_>"))
(setq-local outline-level (lambda () (1+ (/ (current-indentation)
ruby-indent-level))))
ruby-indent-level))))
(add-hook 'after-save-hook #'ruby-mode-set-encoding nil 'local)
(add-hook 'electric-indent-functions #'ruby--electric-indent-p nil 'local)
(add-hook 'flymake-diagnostic-functions #'ruby-flymake-auto nil 'local)
(setq-local prettify-symbols-alist ruby--prettify-symbols-alist))
;;;###autoload
(define-derived-mode ruby-mode ruby-base-mode "Ruby"
"Major mode for editing Ruby code."
(smie-setup ruby-smie-grammar #'ruby-smie-rules
:forward-token #'ruby-smie--forward-token
:backward-token #'ruby-smie--backward-token)
(unless ruby-use-smie
(setq-local indent-line-function #'ruby-indent-line))
(setq-local imenu-create-index-function #'ruby-imenu-create-index)
(setq-local add-log-current-defun-function #'ruby-add-log-current-method)
(setq-local beginning-of-defun-function #'ruby-beginning-of-defun)
(setq-local end-of-defun-function #'ruby-end-of-defun)
(setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil
((?_ . "w"))))
(setq-local prettify-symbols-alist ruby--prettify-symbols-alist)
(setq-local syntax-propertize-function #'ruby-syntax-propertize))

View file

@ -23,7 +23,7 @@
;;; Commentary:
;; This file defines ruby-ts-mode which is a major mode for editting
;; This file defines ruby-ts-mode which is a major mode for editing
;; Ruby files that uses Tree Sitter to parse the language. More
;; information about Tree Sitter can be found in the ELisp Info pages
;; as well as this website: https://tree-sitter.github.io/tree-sitter/
@ -150,7 +150,7 @@ These are currently unused")
"parenthesized_statements"
"interpolation")
string-end)
"Regular expression of the nodes that can constain statements.")
"Regular expression of the nodes that can contain statements.")
(defun ruby-ts--lineno (node)
"Return line number of NODE's start."
@ -178,7 +178,7 @@ These are currently unused")
Applies `font-lock-comment-delimiter-face' and
`font-lock-comment-face' See `treesit-fontify-with-override' for
values of OVERRIDE"
;; Emperically it appears as if (treesit-node-start node) will be
;; Empirically it appears as if (treesit-node-start node) will be
;; where the # character is at and (treesit-node-end node) will be
;; the end of the line
(let* ((node-start (treesit-node-start node))
@ -237,8 +237,10 @@ values of OVERRIDE"
;; Also before 'operator because % and / are operators
:language language
:feature 'regexp
'((regex "/" @font-lock-regexp-grouping-construct)
(regex _ (string_content) @font-lock-regexp-grouping-backslash))
;; TODO: We probably need a separate face for regexps everywhere.
;; Maybe another one for regexp delimiters as well.
'((regex "/" @font-lock-string-face)
(regex _ (string_content) @font-lock-string-face))
:language language
:feature 'operator
@ -253,21 +255,22 @@ values of OVERRIDE"
:feature 'string
'((delimited_symbol [ ":\"" "\"" ] @font-lock-string-face)
(string "\"" @font-lock-string-face)
(string_array [ "%w(" ")" ] @font-lock-delimiter-face)
(subshell "`" @font-lock-delimiter-face)
(symbol_array [ "%i(" ")"] @font-lock-delimiter-face))
(string_array ["%w(" ")"] @font-lock-string-face)
(subshell "`" @font-lock-string-face)
(symbol_array ["%i(" ")"] @font-lock-constant-face))
:language language
:feature 'string
'((string_content) @font-lock-string-face
(heredoc_beginning) @font-lock-string-face
(heredoc_content) @font-lock-string-face
(heredoc_end) @font-lock-string-face)
'([(string_content)
(heredoc_beginning)
(heredoc_content)
(heredoc_end)]
@font-lock-string-face)
:language language
:feature 'interpolation
'((interpolation "#{" @font-lock-doc-face)
(interpolation "}" @font-lock-doc-face))
'((interpolation "#{" @font-lock-delimiter-face)
(interpolation "}" @font-lock-delimiter-face))
:language language
:feature 'type
@ -352,8 +355,11 @@ Otherwise return start of PRED."
(lambda (node parent bol &rest rest)
(let* ((pred-node (funcall pred node parent bol rest))
(temp (treesit-node-start pred-node))
(keyword (treesit-node-type pred-node))
(bol (ruby-smie--indent-to-stmt-p keyword)))
(type (treesit-node-type pred-node))
(bol (ruby-smie--indent-to-stmt-p
(if (equal type "method")
"def"
type))))
(when temp
(if bol
(save-excursion
@ -717,7 +723,7 @@ i.e. expr of def foo(args) = expr is returned."
((n-p-gp ,ruby-ts--method-regex "body_statement" ,ruby-ts--class-or-module-regex)
(ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level)
;; Match the end of a class / modlue
;; Match the end of a class / module
((match "end" ,ruby-ts--class-or-module-regex) parent 0)
;; 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."
((match "end" "do_block") parent-bol 0)
((n-p-gp "block_body" "block" nil) parent-bol ruby-indent-level)
((n-p-gp nil "block_body" "block") (ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level)
((match "}" "block") (ruby-ts--bol ruby-ts--grand-parent-node) 0)
((match "}" "block") parent-bol 0)
;; Chained strings
((match "string" "chained_string") first-sibling 0)
@ -892,21 +898,11 @@ leading double colon is not added."
"C-c C-f" #'ruby-find-library-file)
;;;###autoload
(define-derived-mode ruby-ts-mode prog-mode "Ruby"
(define-derived-mode ruby-ts-mode ruby-base-mode "Ruby"
"Major mode for editing Ruby, powered by tree-sitter."
:group 'ruby
:syntax-table ruby-mode-syntax-table
(setq indent-tabs-mode ruby-indent-tabs-mode)
(setq-local paragraph-start (concat "$\\|" page-delimiter))
(setq-local paragraph-separate paragraph-start)
(setq-local paragraph-ignore-fill-prefix t)
(setq-local comment-start "# ")
(setq-local comment-end "")
(setq-local comment-start-skip "#+ *")
(unless (treesit-ready-p 'ruby)
(error "Tree-sitter for Ruby isn't available"))

View file

@ -167,6 +167,8 @@ Argument LANGUAGE is either `typescript' or `tsx'."
(method_definition
name: (property_identifier) @font-lock-function-name-face)
(method_signature
name: (property_identifier) @font-lock-function-name-face)
(required_parameter (identifier) @font-lock-variable-name-face)
(optional_parameter (identifier) @font-lock-variable-name-face)
@ -211,10 +213,8 @@ Argument LANGUAGE is either `typescript' or `tsx'."
(enum_assignment name: (property_identifier) @font-lock-type-face)
(assignment_expression
left: [(identifier) @font-lock-variable-name-face
(member_expression
property: (property_identifier) @font-lock-variable-name-face)])
(variable_declarator
name: (identifier) @font-lock-variable-name-face)
(for_in_statement
left: (identifier) @font-lock-variable-name-face)
@ -242,10 +242,6 @@ Argument LANGUAGE is either `typescript' or `tsx'."
name: (property_identifier) @font-lock-property-face)
(public_field_definition
name: (property_identifier) @font-lock-property-face)
(member_expression
object: (identifier) @font-lock-variable-name-face)
(member_expression
property: (_) @font-lock-property-face)
(pair key: (property_identifier) @font-lock-variable-name-face)
@ -263,9 +259,11 @@ Argument LANGUAGE is either `typescript' or `tsx'."
left: [(identifier) @font-lock-function-name-face
(member_expression
property: (property_identifier) @font-lock-function-name-face)]
right: [(function) (arrow_function)])
right: [(function) (arrow_function)]))
(call_expression
:language language
:feature 'function
'((call_expression
function:
[(identifier) @font-lock-function-name-face
(member_expression
@ -379,9 +377,10 @@ Argument LANGUAGE is either `typescript' or `tsx'."
(setq-local treesit-font-lock-settings
(typescript-ts-mode--font-lock-settings 'typescript))
(setq-local treesit-font-lock-feature-list
'((comment declaration keyword string escape-sequence)
'((comment declaration)
(keyword string escape-sequence)
(constant expression identifier number pattern property)
(bracket delimiter)))
(function bracket delimiter)))
(treesit-major-mode-setup)))
@ -413,9 +412,10 @@ Argument LANGUAGE is either `typescript' or `tsx'."
(setq-local treesit-font-lock-settings
(typescript-ts-mode--font-lock-settings 'tsx))
(setq-local treesit-font-lock-feature-list
'((comment declaration keyword string escape-sequence)
'((comment declaration)
(keyword string escape-sequence)
(constant expression identifier jsx number pattern property)
(bracket delimiter)))
(function bracket delimiter)))
(treesit-major-mode-setup)))

View file

@ -7,7 +7,7 @@
The MSYS/MinGW build described here is supported on versions of
Windows starting with Windows XP and newer. Building on Windows 2000
and Windows 9X is not supported (but the Emacs binary produced by this
build will run on Windows 9X and newer systems).
build should run on Windows 9X and newer systems).
Do not use this recipe with Cygwin. For building on Cygwin, use the
normal installation instructions, ../INSTALL.
@ -87,7 +87,7 @@ build will run on Windows 9X and newer systems).
Git for Windows is available from this download page:
https://github.com/git-for-windows/git/releases
https://gitforwindows.org/
That page offers both 32-bit and 64-bit installations; pick the one
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).
like to mess with manual installations. You can download it from
here:
https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
https://osdn.net/projects/mingw/releases
(This installer only supports packages downloaded from the MinGW
site; for the rest you will still need the manual method.)
@ -203,13 +203,13 @@ build will run on Windows 9X and newer systems).
MinGW runtime and Windows API distributions, to compile Emacs. You
can find these on the MinGW download/Base page:
https://sourceforge.net/projects/mingw/files/MinGW/Base/
https://osdn.net/projects/mingw/releases
In general, install the latest stable versions of the following
MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You
only need the 'bin' and the 'dll' tarballs of each of the above.
MinGW packages are distributed as .tar.lzma compressed archives. To
MinGW packages are distributed as .tar.xz compressed archives. To
install the packages manually, we recommend to use the Windows port
of the 'bsdtar' program to unpack the tarballs. 'bsdtar' is
available as part of the 'libarchive' package from here:
@ -598,8 +598,7 @@ build will run on Windows 9X and newer systems).
* Optional image library support
In addition to its "native" image formats (pbm and xbm), Emacs can
handle other image types: xpm, tiff, gif, png, jpeg, webp and
experimental support for svg.
handle other image types: xpm, tiff, gif, png, jpeg, webp and svg.
To build Emacs with support for them, the corresponding headers must
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).
from the MSYS2 project. If HarfBuzz is not available, Emacs will
use the Uniscribe shaping engine that is part of MS-Windows.
* Optional support for accessing SQLite databases
Emacs can support built-in access to SQLite databases, if compiled
with the sqlite3 library. Prebuilt 32-bit binaries of that library
are available from the ezwinports site.
* Optional support for tree-sitter
Emacs can be built with the tree-sitter incremental parsing library,
which enables editing of program sources written in various
programming languages based on the tree-sitter parsers. Prebuilt
32-bit binaries of the tree-sitter library DLL and of several
language grammar libraries are available from the ezwinports site.
This file is part of GNU Emacs.

View file

@ -259,8 +259,8 @@ input come from an Emacs buffer, use `call-process-region' instead.
Third argument DESTINATION specifies how to handle program's output.
(\"Output\" here means both standard output and standard error
output.)
If DESTINATION is a buffer, or t that stands for the current buffer,
it means insert output in that buffer before point.
If DESTINATION is a buffer or the name of a buffer, or t (which stands for
the current buffer), it means insert output in that buffer before point.
If DESTINATION is nil, it means discard output; 0 means discard
and don't wait for the program to terminate.
If 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
BUFFER means discard it; 0 means discard and don't wait; and `(:file
FILE)', where FILE is a file name string, means that it should be
written to that file (if the file already exists it is overwritten).
BUFFER can be a string which is the name of a buffer.
BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.

View file

@ -175,19 +175,17 @@ haiku_change_tool_bar_height (struct frame *f, int height)
void
haiku_change_tab_bar_height (struct frame *f, int height)
{
int unit, old_height, lines;
Lisp_Object fullscreen;
unit = FRAME_LINE_HEIGHT (f);
old_height = FRAME_TAB_BAR_HEIGHT (f);
fullscreen = get_frame_param (f, Qfullscreen);
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TAB_BAR_HEIGHT (f);
/* This differs from the tool bar code in that the tab bar height is
not rounded up. Otherwise, if redisplay_tab_bar decides to grow
the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
leading to the tab bar height being incorrectly set upon the next
call to x_set_font. (bug#59285) */
lines = height / unit;
int lines = height / unit;
if (lines == 0 && height != 0)
lines = 1;
/* Make sure we redisplay all windows in this frame. */
fset_redisplay (f);
@ -208,6 +206,8 @@ haiku_change_tab_bar_height (struct frame *f, int height)
if (!f->tab_bar_resized)
{
Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
/* As long as tab_bar_resized is false, effectively try to change
F's native height. */
if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))

View file

@ -632,19 +632,17 @@ ns_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
void
ns_change_tab_bar_height (struct frame *f, int height)
{
int unit, old_height, lines;
Lisp_Object fullscreen;
unit = FRAME_LINE_HEIGHT (f);
old_height = FRAME_TAB_BAR_HEIGHT (f);
fullscreen = get_frame_param (f, Qfullscreen);
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TAB_BAR_HEIGHT (f);
/* This differs from the tool bar code in that the tab bar height is
not rounded up. Otherwise, if redisplay_tab_bar decides to grow
the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
leading to the tab bar height being incorrectly set upon the next
call to x_set_font. (bug#59285) */
lines = height / unit;
int lines = height / unit;
if (lines == 0 && height != 0)
lines = 1;
/* Make sure we redisplay all windows in this frame. */
fset_redisplay (f);
@ -665,6 +663,8 @@ ns_change_tab_bar_height (struct frame *f, int height)
if (!f->tab_bar_resized)
{
Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
/* As long as tab_bar_resized is false, effectively try to change
F's native height. */
if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))

View file

@ -473,19 +473,17 @@ pgtk_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
void
pgtk_change_tab_bar_height (struct frame *f, int height)
{
int unit, old_height, lines;
Lisp_Object fullscreen;
unit = FRAME_LINE_HEIGHT (f);
old_height = FRAME_TAB_BAR_HEIGHT (f);
fullscreen = get_frame_param (f, Qfullscreen);
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TAB_BAR_HEIGHT (f);
/* This differs from the tool bar code in that the tab bar height is
not rounded up. Otherwise, if redisplay_tab_bar decides to grow
the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
leading to the tab bar height being incorrectly set upon the next
call to x_set_font. (bug#59285) */
lines = height / unit;
int lines = height / unit;
if (lines == 0 && height != 0)
lines = 1;
/* Make sure we redisplay all windows in this frame. */
fset_redisplay (f);
@ -506,6 +504,8 @@ pgtk_change_tab_bar_height (struct frame *f, int height)
if (!f->tab_bar_resized)
{
Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
/* As long as tab_bar_resized is false, effectively try to change
F's native height. */
if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))

View file

@ -1717,19 +1717,17 @@ w32_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
void
w32_change_tab_bar_height (struct frame *f, int height)
{
int unit, old_height, lines;
Lisp_Object fullscreen;
unit = FRAME_LINE_HEIGHT (f);
old_height = FRAME_TAB_BAR_HEIGHT (f);
fullscreen = get_frame_param (f, Qfullscreen);
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TAB_BAR_HEIGHT (f);
/* This differs from the tool bar code in that the tab bar height is
not rounded up. Otherwise, if redisplay_tab_bar decides to grow
the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
leading to the tab bar height being incorrectly set upon the next
call to x_set_font. (bug#59285) */
lines = height / unit;
int lines = height / unit;
if (lines == 0 && height != 0)
lines = 1;
/* Make sure we redisplay all windows in this frame. */
fset_redisplay (f);
@ -1758,6 +1756,8 @@ w32_change_tab_bar_height (struct frame *f, int height)
if (!f->tab_bar_resized)
{
Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
/* As long as tab_bar_resized is false, effectively try to change
F's native height. */
if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))

View file

@ -1757,19 +1757,17 @@ x_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
void
x_change_tab_bar_height (struct frame *f, int height)
{
int unit, old_height, lines;
Lisp_Object fullscreen;
unit = FRAME_LINE_HEIGHT (f);
old_height = FRAME_TAB_BAR_HEIGHT (f);
fullscreen = get_frame_param (f, Qfullscreen);
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TAB_BAR_HEIGHT (f);
/* This differs from the tool bar code in that the tab bar height is
not rounded up. Otherwise, if redisplay_tab_bar decides to grow
the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed,
leading to the tab bar height being incorrectly set upon the next
call to x_set_font. (bug#59285) */
lines = height / unit;
int lines = height / unit;
if (lines == 0 && height != 0)
lines = 1;
/* Make sure we redisplay all windows in this frame. */
fset_redisplay (f);
@ -1790,6 +1788,8 @@ x_change_tab_bar_height (struct frame *f, int height)
if (!f->tab_bar_resized)
{
Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
/* As long as tab_bar_resized is false, effectively try to change
F's native height. */
if (NILP (fullscreen) || EQ (fullscreen, Qfullwidth))

View file

@ -1001,11 +1001,11 @@
(ert-deftest erc-select-read-args ()
(ert-info ("Defaults to TLS")
(ert-info ("Does not default to TLS")
(should (equal (ert-simulate-keys "\r\r\r\r"
(erc-select-read-args))
(list :server "irc.libera.chat"
:port 6697
:port 6667
:nick (user-login-name)
:password nil))))
@ -1036,7 +1036,7 @@
:password nil))))
(ert-info ("Address includes nick and password")
(should (equal (ert-simulate-keys "nick:sesame@localhost:6667\r"
(should (equal (ert-simulate-keys "nick:sesame@localhost:6667\r\r"
(erc-select-read-args))
(list :server "localhost"
:port 6667

View file

@ -44,7 +44,7 @@ The whitespace before and including \"|\" on each line is removed."
(apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args))
(ert-deftest ruby-ts-indent-simple ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-should-indent-buffer
"if foo
| bar
@ -58,7 +58,7 @@ The whitespace before and including \"|\" on each line is removed."
|"))
(ert-deftest ruby-ts-align-to-stmt-keywords-t ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(let ((ruby-align-to-stmt-keywords t))
(ruby-ts-should-indent-buffer
"foo = if bar?
@ -94,7 +94,7 @@ The whitespace before and including \"|\" on each line is removed."
))
(ert-deftest ruby-ts-align-to-stmt-keywords-case ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(let ((ruby-align-to-stmt-keywords '(case)))
(ruby-ts-should-indent-buffer
"b = case a
@ -111,7 +111,7 @@ The whitespace before and including \"|\" on each line is removed."
| end")))
(ert-deftest ruby-ts-add-log-current-method-examples ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(let ((pairs '(("foo" . "#foo")
("C.foo" . ".foo")
("self.foo" . ".foo")
@ -134,7 +134,7 @@ The whitespace before and including \"|\" on each line is removed."
(format "M::C%s" value))))))))
(ert-deftest ruby-ts-add-log-current-method-outside-of-method ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"module M
| class C
@ -147,7 +147,7 @@ The whitespace before and including \"|\" on each line is removed."
(should (string= (ruby-ts-add-log-current-function) "M::C"))))
(ert-deftest ruby-ts-add-log-current-method-in-singleton-class ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"class C
| class << self
@ -160,7 +160,7 @@ The whitespace before and including \"|\" on each line is removed."
(should (string= (ruby-ts-add-log-current-function) "C.foo"))))
(ert-deftest ruby-ts-add-log-current-method-namespace-shorthand ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"class C::D
| def foo
@ -171,7 +171,7 @@ The whitespace before and including \"|\" on each line is removed."
(should (string= (ruby-ts-add-log-current-function) "C::D#foo"))))
(ert-deftest ruby-ts-add-log-current-method-after-inner-class ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"module M
| class C
@ -186,7 +186,7 @@ The whitespace before and including \"|\" on each line is removed."
(should (string= (ruby-ts-add-log-current-function) "M::C#foo"))))
(ert-deftest ruby-ts-add-log-current-method-after-inner-class-outside-methods ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"module M
| class C
@ -201,7 +201,7 @@ The whitespace before and including \"|\" on each line is removed."
(should (string= (ruby-ts-add-log-current-function) "M::C"))))
(ert-deftest ruby-ts-add-log-current-method-after-inner-class-outside-methods-with-text ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"module M
| class C
@ -215,7 +215,7 @@ The whitespace before and including \"|\" on each line is removed."
(should (string= (ruby-ts-add-log-current-function) "M::C"))))
(ert-deftest ruby-ts-add-log-current-method-after-endless-method ()
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(ruby-ts-with-temp-buffer (ruby-ts-test-string
"module M
| class C
@ -237,7 +237,7 @@ The whitespace before and including \"|\" on each line is removed."
(defmacro ruby-ts-deftest-indent (file)
`(ert-deftest ,(intern (format "ruby-ts-indent-test/%s" file)) ()
;; :tags '(:expensive-test)
(skip-unless (treesit-available-p))
(skip-unless (treesit-ready-p 'ruby t))
(let ((buf (find-file-noselect (ruby-ts-resource-file ,file))))
(unwind-protect
(with-current-buffer buf