Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-01-08 15:43:57 +08:00
commit 4c09b9a5a6
176 changed files with 2244 additions and 2233 deletions

View file

@ -187,7 +187,7 @@
</p></dd></dl>
<dl class="def">
<dt id="index-treesit_002dchild_002dcount"><span class="category">Function: </span><span><strong>treesit-child-count</strong> <em>node &amp;optional named</em><a href='#index-treesit_002dchild_002dcount' class='copiable-anchor'> &para;</a></span></dt>
<dt id="index-treesit_002dchild_002dcount"><span class="category">Function: </span><span><strong>treesit-node-child-count</strong> <em>node &amp;optional named</em><a href='#index-treesit_002dchild_002dcount' class='copiable-anchor'> &para;</a></span></dt>
<dd><p>This function finds the number of children of <var>node</var>. If
<var>named</var> is non-nil, it only counts named child (see <a href="Language-Definitions.html#tree_002dsitter-named-node">named node</a>).
</p></dd></dl>

View file

@ -94,7 +94,7 @@
</li></ul>
<p>In each of these directories, Emacs looks for a file with file-name
extensions specified by the variable <code>treesit-load-suffixes</code>.
extensions specified by the variable <code>dynamic-library-suffixes</code>.
</p>
<p>If Emacs cannot find the library or has problems loading it, Emacs
signals the <code>treesit-load-language-error</code> error. The data of

View file

@ -134,7 +134,7 @@
tree-sitter query in either the string, s-expression or compiled form.
</p>
<p>For each <var>query</var>, the <var>:keyword</var>/<var>value</var> pairs that
precede it add meta information to it. The <code>:lang</code> keyword
precede it add meta information to it. The <code>:language</code> keyword
declares <var>query</var>&rsquo;s language. The <code>:feature</code> keyword sets the
feature name of <var>query</var>. Users can control which features are
enabled with <code>font-lock-maximum-decoration</code> and

View file

@ -201,13 +201,13 @@
</p></dd></dl>
<dl class="def">
<dt id="index-treesit_002dnext_002dsibling"><span class="category">Function: </span><span><strong>treesit-next-sibling</strong> <em>node &amp;optional named</em><a href='#index-treesit_002dnext_002dsibling' class='copiable-anchor'> &para;</a></span></dt>
<dt id="index-treesit_002dnext_002dsibling"><span class="category">Function: </span><span><strong>treesit-node-next-sibling</strong> <em>node &amp;optional named</em><a href='#index-treesit_002dnext_002dsibling' class='copiable-anchor'> &para;</a></span></dt>
<dd><p>This function finds the next sibling of <var>node</var>. If <var>named</var> is
non-<code>nil</code>, it finds the next named sibling.
</p></dd></dl>
<dl class="def">
<dt id="index-treesit_002dprev_002dsibling"><span class="category">Function: </span><span><strong>treesit-prev-sibling</strong> <em>node &amp;optional named</em><a href='#index-treesit_002dprev_002dsibling' class='copiable-anchor'> &para;</a></span></dt>
<dt id="index-treesit_002dprev_002dsibling"><span class="category">Function: </span><span><strong>treesit-node-prev-sibling</strong> <em>node &amp;optional named</em><a href='#index-treesit_002dprev_002dsibling' class='copiable-anchor'> &para;</a></span></dt>
<dd><p>This function finds the previous sibling of <var>node</var>. If
<var>named</var> is non-<code>nil</code>, it finds the previous named sibling.
</p></dd></dl>
@ -221,13 +221,13 @@
could have a <code>declarator</code> node and a <code>body</code> node.
</p>
<dl class="def">
<dt id="index-treesit_002dchild_002dby_002dfield_002dname"><span class="category">Function: </span><span><strong>treesit-child-by-field-name</strong> <em>node field-name</em><a href='#index-treesit_002dchild_002dby_002dfield_002dname' class='copiable-anchor'> &para;</a></span></dt>
<dt id="index-treesit_002dchild_002dby_002dfield_002dname"><span class="category">Function: </span><span><strong>treesit-node-child-by-field-name</strong> <em>node field-name</em><a href='#index-treesit_002dchild_002dby_002dfield_002dname' class='copiable-anchor'> &para;</a></span></dt>
<dd><p>This function finds the child of <var>node</var> whose field name is
<var>field-name</var>, a string.
</p>
<div class="example">
<pre class="example">;; Get the child that has &quot;body&quot; as its field name.
(treesit-child-by-field-name node &quot;body&quot;)
(treesit-node-child-by-field-name node &quot;body&quot;)
&rArr; #&lt;treesit-node (compound_statement) in 45-89&gt;
</pre></div>
</dd></dl>
@ -237,7 +237,7 @@
<span id="index-syntax-tree-nodes_002c-by-position"></span>
<dl class="def">
<dt id="index-treesit_002dfirst_002dchild_002dfor_002dpos"><span class="category">Function: </span><span><strong>treesit-first-child-for-pos</strong> <em>node pos &amp;optional named</em><a href='#index-treesit_002dfirst_002dchild_002dfor_002dpos' class='copiable-anchor'> &para;</a></span></dt>
<dt id="index-treesit_002dfirst_002dchild_002dfor_002dpos"><span class="category">Function: </span><span><strong>treesit-node-first-child-for-pos</strong> <em>node pos &amp;optional named</em><a href='#index-treesit_002dfirst_002dchild_002dfor_002dpos' class='copiable-anchor'> &para;</a></span></dt>
<dd><p>This function finds the first child of <var>node</var> that extends beyond
buffer position <var>pos</var>. &ldquo;Extends beyond&rdquo; means the end of the
child node is greater or equal to <var>pos</var>. This function only looks

View file

@ -142,12 +142,12 @@
ts_node_named_child_count treesit-node-child-count
ts_node_child_by_field_name treesit-node-by-field-name
ts_node_child_by_field_id
ts_node_next_sibling treesit-next-sibling
ts_node_prev_sibling treesit-prev-sibling
ts_node_next_named_sibling treesit-next-sibling
ts_node_prev_named_sibling treesit-prev-sibling
ts_node_first_child_for_byte treesit-first-child-for-pos
ts_node_first_named_child_for_byte treesit-first-child-for-pos
ts_node_next_sibling treesit-node-next-sibling
ts_node_prev_sibling treesit-node-prev-sibling
ts_node_next_named_sibling treesit-node-next-sibling
ts_node_prev_named_sibling treesit-node-prev-sibling
ts_node_first_child_for_byte treesit-node-first-child-for-pos
ts_node_first_named_child_for_byte treesit-node-first-child-for-pos
ts_node_descendant_for_byte_range treesit-descendant-for-range
ts_node_descendant_for_point_range
ts_node_named_descendant_for_byte_range treesit-descendant-for-range

View file

@ -238,7 +238,7 @@ Concretely, something like this:
...
(cond
;; Tree-sitter.
((treesit-ready-p 'python-mode 'python)
((treesit-ready-p 'python)
(treesit-parser-create 'python)
(setq-local treesit-font-lock-settings python--treesit-settings)
(setq-local treesit-font-lock-feature-list

View file

@ -1,6 +1,6 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2023 Free Software Foundation, Inc.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale

View file

@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2023 Free Software Foundation, Inc.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale

View file

@ -6717,7 +6717,7 @@ fi
# it temporarily reverts them to their pre-pkg-config values,
# because gnulib needs to work with both src (which uses the
# pkg-config stuff) and lib-src (which does not). For example, gnulib
# may need to determine whether LIB_CLOCK_GETTIME should contain -lrt,
# may need to determine whether CLOCK_TIME_LIB should contain -lrt,
# and it therefore needs to run in an environment where LIBS does not
# already contain -lrt merely because 'pkg-config --libs' printed '-lrt'
# for some package unrelated to lib-src.

View file

@ -801,22 +801,21 @@ in these cases, customize the variable
@vindex write-region-inhibit-fsync
Normally, when a program writes a file, the operating system briefly
caches the file's data in main memory before committing the data to
disk. This can greatly improve performance; for example, when running
on laptops, it can avoid a disk spin-up each time a file is written.
However, it risks data loss if the operating system crashes before
committing the cache to disk.
secondary storage. Although this can greatly improve performance, it
risks data loss if the system loses power before committing the cache,
and on some platforms other processes might not immediately notice the
file's change.
To lessen this risk, Emacs can invoke the @code{fsync} system call
after saving a file. Using @code{fsync} does not eliminate the risk
of data loss, partly because many systems do not implement
of data loss or slow notification, partly because many systems do not support
@code{fsync} properly, and partly because Emacs's file-saving
procedure typically relies also on directory updates that might not
survive a crash even if @code{fsync} works properly.
The @code{write-region-inhibit-fsync} variable controls whether
Emacs invokes @code{fsync} after saving a file. The variable's
default value is @code{nil} when Emacs is interactive, and @code{t}
when Emacs runs in batch mode (@pxref{Initial Options, Batch Mode}).
default value is @code{t}.
Emacs never uses @code{fsync} when writing auto-save files, as these
files might lose data anyway.

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

@ -692,11 +692,9 @@ files that the user does not need to know about.
@defvar write-region-inhibit-fsync
If this variable's value is @code{nil}, @code{write-region} uses the
@code{fsync} system call after writing a file. Although this slows
Emacs down, it lessens the risk of data loss after power failure. If
the value is @code{t}, Emacs does not use @code{fsync}. The default
value is @code{nil} when Emacs is interactive, and @code{t} when Emacs
runs in batch mode. @xref{Files and Storage}.
@code{fsync} system call after writing a file. If the value is
@code{t}, Emacs does not use @code{fsync}. The default value is
@code{t}. @xref{Files and Storage}.
@end defvar
@defmac with-temp-file file body@dots{}
@ -2038,17 +2036,28 @@ data already stored elsewhere on secondary storage until one file or
the other is later modified; this will lose both files if the only
copy on secondary storage is lost due to media failure. Second, the
operating system might not write data to secondary storage
immediately, which will lose the data if power is lost.
immediately, which will lose the data if power is lost
or if there is a media failure.
@findex write-region
Although both sorts of failures can largely be avoided by a suitably
configured file system, such systems are typically more expensive or
less efficient. In more-typical systems, to survive media failure you
configured system, such systems are typically more expensive or
less efficient. In lower-end systems, to survive media failure you
can copy the file to a different device, and to survive a power
failure you can use the @code{write-region} function with the
failure (or be immediately notified of a media failure) you can use
the @code{write-region} function with the
@code{write-region-inhibit-fsync} variable set to @code{nil}.
Although this variable is ordinarily @code{t} because that can
significantly improve performance, it may make sense to temporarily
bind it to @code{nil} if using Emacs to implement database-like
transactions that survive power failure on lower-end systems.
@xref{Writing to Files}.
On some platforms when Emacs changes a file other processes might not
be notified of the change immediately. Setting
@code{write-region-inhibit-fsync} to @code{nil} may improve
notification speed in this case, though there are no guarantees.
@node File Names
@section File Names
@cindex file names

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
@ -4054,7 +4054,7 @@ tree-sitter query in either the string, s-expression or compiled form.
@c FIXME: Cross-ref treesit-font-lock-level to user manual.
For each @var{query}, the @var{:keyword}/@var{value} pairs that
precede it add meta information to it. The @code{:lang} keyword
precede it add meta information to it. The @code{:language} keyword
declares @var{query}'s language. The @code{:feature} keyword sets the
feature name of @var{query}. Users can control which features are
enabled with @code{treesit-font-lock-level} and

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
@ -65,7 +65,6 @@ For example, the C language grammar is represented as the symbol
@vindex treesit-extra-load-path
@vindex treesit-load-language-error
@vindex treesit-load-suffixes
Tree-sitter language grammar are distributed as dynamic libraries.
In order to use a language grammar in Emacs, you need to make sure
that the dynamic library is installed on the system. Emacs looks for
@ -83,7 +82,7 @@ and finally, in the system's default locations for dynamic libraries.
@end itemize
In each of these directories, Emacs looks for a file with file-name
extensions specified by the variable @code{treesit-load-suffixes}.
extensions specified by the variable @code{dynamic-library-suffixes}.
If Emacs cannot find the library or has problems loading it, Emacs
signals the @code{treesit-load-language-error} error. The data of
@ -677,12 +676,12 @@ This function returns all of @var{node}'s children as a list. If
@var{named} is non-@code{nil}, it retrieves only named nodes.
@end defun
@defun treesit-next-sibling node &optional named
@defun treesit-node-next-sibling node &optional named
This function finds the next sibling of @var{node}. If @var{named} is
non-@code{nil}, it finds the next named sibling.
@end defun
@defun treesit-prev-sibling node &optional named
@defun treesit-node-prev-sibling node &optional named
This function finds the previous sibling of @var{node}. If
@var{named} is non-@code{nil}, it finds the previous named sibling.
@end defun
@ -696,14 +695,14 @@ assign @dfn{field names} to child nodes (@pxref{tree-sitter node field
name, field name}). For example, a @code{function_definition} node
could have a @code{declarator} node and a @code{body} node.
@defun treesit-child-by-field-name node field-name
@defun treesit-node-child-by-field-name node field-name
This function finds the child of @var{node} whose field name is
@var{field-name}, a string.
@example
@group
;; Get the child that has "body" as its field name.
(treesit-child-by-field-name node "body")
(treesit-node-child-by-field-name node "body")
@result{} #<treesit-node (compound_statement) in 45-89>
@end group
@end example
@ -713,7 +712,7 @@ This function finds the child of @var{node} whose field name is
@cindex nodes, by position
@cindex syntax tree nodes, by position
@defun treesit-first-child-for-pos node pos &optional named
@defun treesit-node-first-child-for-pos node pos &optional named
This function finds the first child of @var{node} that extends beyond
buffer position @var{pos}. ``Extends beyond'' means the end of the
child node is greater or equal to @var{pos}. This function only looks
@ -1002,7 +1001,7 @@ Note that @var{n} counts both named and anonymous child. And @var{n}
could be negative, e.g., @code{-1} represents the last child.
@end defun
@defun treesit-child-count node &optional named
@defun treesit-node-child-count node &optional named
This function finds the number of children of @var{node}. If
@var{named} is non-@code{nil}, it only counts named children
(@pxref{tree-sitter named node, named node}).
@ -1675,7 +1674,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
@ -1694,7 +1693,7 @@ this pattern:
...
(cond
;; Tree-sitter setup.
((treesit-ready-p 'woomy-mode 'woomy)
((treesit-ready-p 'woomy)
(setq-local treesit-variables ...)
(treesit-major-mode-setup))
;; Non-tree-sitter setup.
@ -1706,7 +1705,7 @@ this pattern:
First, the major mode should use @code{treesit-ready-p} to determine
whether tree-sitter can be activated in this mode.
@defun treesit-ready-p mode language &optional quiet
@defun treesit-ready-p language &optional quiet
This function checks for conditions for activating tree-sitter. It
checks whether Emacs was built with tree-sitter, whether the buffer's
size is not too large for tree-sitter to handle it, and whether the
@ -1734,7 +1733,7 @@ If @code{treesit-font-lock-settings} (@pxref{Parser-based Font Lock})
is non-@code{nil}, it sets up fontification.
@item
If @code{treesit-simple-indent-rules} (@pxref{Parser-based Font Lock})
If @code{treesit-simple-indent-rules} (@pxref{Parser-based Indentation})
is non-@code{nil}, it sets up indentation.
@item
@ -1897,12 +1896,12 @@ ts_node_named_child treesit-node-child
ts_node_named_child_count treesit-node-child-count
ts_node_child_by_field_name treesit-node-by-field-name
ts_node_child_by_field_id
ts_node_next_sibling treesit-next-sibling
ts_node_prev_sibling treesit-prev-sibling
ts_node_next_named_sibling treesit-next-sibling
ts_node_prev_named_sibling treesit-prev-sibling
ts_node_first_child_for_byte treesit-first-child-for-pos
ts_node_first_named_child_for_byte treesit-first-child-for-pos
ts_node_next_sibling treesit-node-next-sibling
ts_node_prev_sibling treesit-node-prev-sibling
ts_node_next_named_sibling treesit-node-next-sibling
ts_node_prev_named_sibling treesit-node-prev-sibling
ts_node_first_child_for_byte treesit-node-first-child-for-pos
ts_node_first_named_child_for_byte treesit-node-first-child-for-pos
ts_node_descendant_for_byte_range treesit-descendant-for-range
ts_node_descendant_for_point_range
ts_node_named_descendant_for_byte_range treesit-descendant-for-range

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 Emacs treats 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

@ -3,9 +3,9 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2022-12-19.22}
\def\texinfoversion{2023-01-02.21}
%
% Copyright 1985--1986, 1988, 1990--2023 Free Software Foundation, Inc.
% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@ -58,12 +58,6 @@
\message{Loading texinfo [version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
% LaTeX's \typeout. This ensures that the messages it is used for
% are identical in format to the corresponding ones from latex/pdflatex.
\def\typeout{\immediate\write17}%
@ -530,7 +524,7 @@
% ... but they get defined via ``\envdef\foo{...}'':
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
\long\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
% Check whether we're in the right environment:
\def\checkenv#1{%
@ -1200,13 +1194,17 @@
%
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
\def\curcolor{0 0 0}%
\def\setcolor#1{%
\xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
\ifx#1\curcolor\else
\xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
\xdef\curcolor{#1}%
\fi
}
%
\def\maincolor{\rgbBlack}
\let\maincolor\rgbBlack
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
\def\currentcolordefs{}
@ -1362,7 +1360,7 @@
%
% by default, use black for everything.
\def\urlcolor{\rgbBlack}
\def\linkcolor{\rgbBlack}
\let\linkcolor\rgbBlack
\def\endlink{\setcolor{\maincolor}\pdfendlink}
%
% Adding outlines to PDF; macros for calculating structure of outlines
@ -2683,6 +2681,7 @@
\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
\gdef\setregularquotes{\let`\lq \let'\rq}
}
\setregularquotes
% Allow an option to not use regular directed right quote/apostrophe
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
@ -3744,8 +3743,8 @@
want the contents after the title page.}}%
\parseargdef\shorttitlepage{%
\begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
{\headingsoff \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}\pageone}
\envdef\titlepage{%
% Open one extra group, as we want to close it in the middle of \Etitlepage.
@ -4795,21 +4794,6 @@
\def\docodeindexxxx #1{\docind{\indexname}{#1}}
% Used for the aux, toc and index files to prevent expansion of Texinfo
% commands.
%
\def\atdummies{%
\definedummyletter\@%
\definedummyletter\ %
\definedummyletter\{%
\definedummyletter\}%
\definedummyletter\&%
%
% Do the redefinitions.
\definedummies
\otherbackslash
}
% \definedummyword defines \#1 as \string\#1\space, thus effectively
% preventing its expansion. This is used only for control words,
% not control letters, because the \space would be incorrect for
@ -4825,110 +4809,91 @@
%
\def\definedummyword #1{\def#1{\string#1\space}}%
\def\definedummyletter#1{\def#1{\string#1}}%
\let\definedummyaccent\definedummyletter
% Called from \atdummies to prevent the expansion of commands.
% Used for the aux, toc and index files to prevent expansion of Texinfo
% commands. Most of the commands are controlled through the
% \ifdummies conditional.
%
\def\definedummies{%
\def\atdummies{%
\dummiestrue
%
\let\commondummyword\definedummyword
\let\commondummyletter\definedummyletter
\let\commondummyaccent\definedummyaccent
\commondummiesnofonts
\definedummyletter\@%
\definedummyletter\ %
\definedummyletter\{%
\definedummyletter\}%
\definedummyletter\&%
%
\definedummyletter\_%
\definedummyletter\-%
%
% Non-English letters.
\definedummyword\AA
\definedummyword\AE
\definedummyword\DH
\definedummyword\L
\definedummyword\O
\definedummyword\OE
\definedummyword\TH
\definedummyword\aa
\definedummyword\ae
\definedummyword\dh
\definedummyword\exclamdown
\definedummyword\l
\definedummyword\o
\definedummyword\oe
\definedummyword\ordf
\definedummyword\ordm
\definedummyword\questiondown
\definedummyword\ss
\definedummyword\th
%
% Although these internal commands shouldn't show up, sometimes they do.
\definedummyword\bf
\definedummyword\gtr
\definedummyword\hat
\definedummyword\less
\definedummyword\sf
\definedummyword\sl
\definedummyword\tclose
\definedummyword\tt
%
\definedummyword\LaTeX
\definedummyword\TeX
%
% Assorted special characters.
\definedummyword\ampchar
\definedummyword\atchar
\definedummyword\arrow
\definedummyword\backslashchar
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
\definedummyword\registeredsymbol
\definedummyword\dots
\definedummyword\enddots
\definedummyword\entrybreak
\definedummyword\equiv
\definedummyword\error
\definedummyword\euro
\definedummyword\expansion
\definedummyword\geq
\definedummyword\guillemetleft
\definedummyword\guillemetright
\definedummyword\guilsinglleft
\definedummyword\guilsinglright
\definedummyword\lbracechar
\definedummyword\leq
\definedummyword\mathopsup
\definedummyword\minus
\definedummyword\ogonek
\definedummyword\pounds
\definedummyword\point
\definedummyword\print
\definedummyword\quotedblbase
\definedummyword\quotedblleft
\definedummyword\quotedblright
\definedummyword\quoteleft
\definedummyword\quoteright
\definedummyword\quotesinglbase
\definedummyword\rbracechar
\definedummyword\result
\definedummyword\sub
\definedummyword\sup
\definedummyword\textdegree
%
\definedummyword\subentry
%
% We want to disable all macros so that they are not expanded by \write.
\let\commondummyword\definedummyword
\macrolist
\let\value\dummyvalue
%
\normalturnoffactive
\turnoffactive
}
% \commondummiesnofonts: common to \definedummies and \indexnofonts.
% Define \commondummyletter, \commondummyaccent and \commondummyword before
% using. Used for accents, font commands, and various control letters.
%
\def\commondummiesnofonts{%
% Control letters and accents.
\newif\ifdummies
\newif\ifindexnofonts
\def\commondummyletter#1{%
\expandafter\let\csname\string#1:impl\endcsname#1%
\edef#1{%
\noexpand\ifindexnofonts
% empty expansion
\noexpand\else
\noexpand\ifdummies\string#1%
\noexpand\else
\noexpand\jumptwofi % dispose of the \fi
\expandafter\noexpand\csname\string#1:impl\endcsname
\noexpand\fi
\noexpand\fi}%
}
\def\commondummyaccent#1{%
\expandafter\let\csname\string#1:impl\endcsname#1%
\edef#1{%
\noexpand\ifindexnofonts
\noexpand\expandafter % dispose of \else ... \fi
\noexpand\asis
\noexpand\else
\noexpand\ifdummies\string#1%
\noexpand\else
\noexpand\jumptwofi % dispose of the \fi
\expandafter\noexpand\csname\string#1:impl\endcsname
\noexpand\fi
\noexpand\fi}%
}
% Like \commondummyaccent but add a \space at the end of the dummy expansion
% #2 is the expansion used for \indexnofonts. #2 is always followed by
% \asis to remove a pair of following braces.
\def\commondummyword#1#2{%
\expandafter\let\csname\string#1:impl\endcsname#1%
\expandafter\def\csname\string#1:ixnf\endcsname{#2\asis}%
\edef#1{%
\noexpand\ifindexnofonts
\noexpand\expandafter % dispose of \else ... \fi
\expandafter\noexpand\csname\string#1:ixnf\endcsname
\noexpand\else
\noexpand\ifdummies\string#1\space
\noexpand\else
\noexpand\jumptwofi % dispose of the \fi \fi
\expandafter\noexpand\csname\string#1:impl\endcsname
\noexpand\fi
\noexpand\fi}%
}
\def\jumptwofi#1\fi\fi{\fi\fi#1}
% For \atdummies and \indexnofonts. \atdummies sets
% \dummiestrue and \indexnofonts sets \indexnofontstrue.
\def\definedummies{
% @-sign is always an escape character when reading auxiliary files
\escapechar = `\@
%
\commondummyletter\!%
\commondummyaccent\"%
\commondummyaccent\'%
@ -4942,58 +4907,123 @@
\commondummyaccent\^%
\commondummyaccent\`%
\commondummyaccent\~%
\commondummyword\u
\commondummyword\v
\commondummyword\H
\commondummyword\dotaccent
\commondummyword\ogonek
\commondummyword\ringaccent
\commondummyword\tieaccent
\commondummyword\ubaraccent
\commondummyword\udotaccent
\commondummyword\dotless
%
% Control letters and accents.
\commondummyword\u {}%
\commondummyword\v {}%
\commondummyword\H {}%
\commondummyword\dotaccent {}%
\commondummyword\ogonek {}%
\commondummyword\ringaccent {}%
\commondummyword\tieaccent {}%
\commondummyword\ubaraccent {}%
\commondummyword\udotaccent {}%
\commondummyword\dotless {}%
%
% Texinfo font commands.
\commondummyword\b
\commondummyword\i
\commondummyword\r
\commondummyword\sansserif
\commondummyword\sc
\commondummyword\slanted
\commondummyword\t
\commondummyword\b {}%
\commondummyword\i {}%
\commondummyword\r {}%
\commondummyword\sansserif {}%
\commondummyword\sc {}%
\commondummyword\slanted {}%
\commondummyword\t {}%
%
% Commands that take arguments.
\commondummyword\abbr
\commondummyword\acronym
\commondummyword\anchor
\commondummyword\cite
\commondummyword\code
\commondummyword\command
\commondummyword\dfn
\commondummyword\dmn
\commondummyword\email
\commondummyword\emph
\commondummyword\env
\commondummyword\file
\commondummyword\image
\commondummyword\indicateurl
\commondummyword\inforef
\commondummyword\kbd
\commondummyword\key
\commondummyword\math
\commondummyword\option
\commondummyword\pxref
\commondummyword\ref
\commondummyword\samp
\commondummyword\strong
\commondummyword\tie
\commondummyword\U
\commondummyword\uref
\commondummyword\url
\commondummyword\var
\commondummyword\verb
\commondummyword\w
\commondummyword\xref
\commondummyword\abbr {}%
\commondummyword\acronym {}%
\commondummyword\anchor {}%
\commondummyword\cite {}%
\commondummyword\code {}%
\commondummyword\command {}%
\commondummyword\dfn {}%
\commondummyword\dmn {}%
\commondummyword\email {}%
\commondummyword\emph {}%
\commondummyword\env {}%
\commondummyword\file {}%
\commondummyword\image {}%
\commondummyword\indicateurl{}%
\commondummyword\inforef {}%
\commondummyword\kbd {}%
\commondummyword\key {}%
\commondummyword\math {}%
\commondummyword\option {}%
\commondummyword\pxref {}%
\commondummyword\ref {}%
\commondummyword\samp {}%
\commondummyword\strong {}%
\commondummyword\tie {}%
\commondummyword\U {}%
\commondummyword\uref {}%
\commondummyword\url {}%
\commondummyword\var {}%
\commondummyword\verb {}%
\commondummyword\w {}%
\commondummyword\xref {}%
%
\commondummyword\AA {AA}%
\commondummyword\AE {AE}%
\commondummyword\DH {DZZ}%
\commondummyword\L {L}%
\commondummyword\O {O}%
\commondummyword\OE {OE}%
\commondummyword\TH {TH}%
\commondummyword\aa {aa}%
\commondummyword\ae {ae}%
\commondummyword\dh {dzz}%
\commondummyword\exclamdown {!}%
\commondummyword\l {l}%
\commondummyword\o {o}%
\commondummyword\oe {oe}%
\commondummyword\ordf {a}%
\commondummyword\ordm {o}%
\commondummyword\questiondown {?}%
\commondummyword\ss {ss}%
\commondummyword\th {th}%
%
\commondummyword\LaTeX {LaTeX}%
\commondummyword\TeX {TeX}%
%
% Assorted special characters.
\commondummyword\ampchar {\normalamp}%
\commondummyword\atchar {\@}%
\commondummyword\arrow {->}%
\commondummyword\backslashchar {}%
\commondummyword\bullet {bullet}%
\commondummyword\comma {,}%
\commondummyword\copyright {copyright}%
\commondummyword\dots {...}%
\commondummyword\enddots {...}%
\commondummyword\entrybreak {}%
\commondummyword\equiv {===}%
\commondummyword\error {error}%
\commondummyword\euro {euro}%
\commondummyword\expansion {==>}%
\commondummyword\geq {>=}%
\commondummyword\guillemetleft {<<}%
\commondummyword\guillemetright {>>}%
\commondummyword\guilsinglleft {<}%
\commondummyword\guilsinglright {>}%
\commondummyword\lbracechar {\{}%
\commondummyword\leq {<=}%
\commondummyword\mathopsup {sup}%
\commondummyword\minus {-}%
\commondummyword\pounds {pounds}%
\commondummyword\point {.}%
\commondummyword\print {-|}%
\commondummyword\quotedblbase {"}%
\commondummyword\quotedblleft {"}%
\commondummyword\quotedblright {"}%
\commondummyword\quoteleft {`}%
\commondummyword\quoteright {'}%
\commondummyword\quotesinglbase {,}%
\commondummyword\rbracechar {\}}%
\commondummyword\registeredsymbol {R}%
\commondummyword\result {=>}%
\commondummyword\sub {}%
\commondummyword\sup {}%
\commondummyword\textdegree {o}%
}
\let\indexlbrace\relax
@ -5044,18 +5074,7 @@
% would be for a given command (usually its argument).
%
\def\indexnofonts{%
% Accent commands should become @asis.
\def\commondummyaccent##1{\let##1\asis}%
% We can just ignore other control letters.
\def\commondummyletter##1{\let##1\empty}%
% All control words become @asis by default; overrides below.
\let\commondummyword\commondummyaccent
\commondummiesnofonts
%
% Don't no-op \tt, since it isn't a user-level command
% and is used in the definitions of the active chars like <, >, |, etc.
% Likewise with the other plain tex font commands.
%\let\tt=\asis
\indexnofontstrue
%
\def\ { }%
\def\@{@}%
@ -5067,65 +5086,6 @@
\let\lbracechar\{%
\let\rbracechar\}%
%
% Non-English letters.
\def\AA{AA}%
\def\AE{AE}%
\def\DH{DZZ}%
\def\L{L}%
\def\OE{OE}%
\def\O{O}%
\def\TH{TH}%
\def\aa{aa}%
\def\ae{ae}%
\def\dh{dzz}%
\def\exclamdown{!}%
\def\l{l}%
\def\oe{oe}%
\def\ordf{a}%
\def\ordm{o}%
\def\o{o}%
\def\questiondown{?}%
\def\ss{ss}%
\def\th{th}%
%
\let\do\indexnofontsdef
%
\do\LaTeX{LaTeX}%
\do\TeX{TeX}%
%
% Assorted special characters.
\do\atchar{@}%
\do\arrow{->}%
\do\bullet{bullet}%
\do\comma{,}%
\do\copyright{copyright}%
\do\dots{...}%
\do\enddots{...}%
\do\equiv{==}%
\do\error{error}%
\do\euro{euro}%
\do\expansion{==>}%
\do\geq{>=}%
\do\guillemetleft{<<}%
\do\guillemetright{>>}%
\do\guilsinglleft{<}%
\do\guilsinglright{>}%
\do\leq{<=}%
\do\lbracechar{\{}%
\do\minus{-}%
\do\point{.}%
\do\pounds{pounds}%
\do\print{-|}%
\do\quotedblbase{"}%
\do\quotedblleft{"}%
\do\quotedblright{"}%
\do\quoteleft{`}%
\do\quoteright{'}%
\do\quotesinglbase{,}%
\do\rbracechar{\}}%
\do\registeredsymbol{R}%
\do\result{=>}%
\do\textdegree{o}%
%
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
@ -5137,14 +5097,11 @@
% to take a single TeX argument. The case of a macro invocation that
% goes to end-of-line is not handled.
%
\def\commondummyword##1{\let##1\asis}%
\macrolist
\let\value\indexnofontsvalue
}
% Give the control sequence a definition that removes the {} that follows
% its use, e.g. @AA{} -> AA
\def\indexnofontsdef#1#2{\def#1##1{#2}}%
@ -7135,8 +7092,7 @@
\newdimen\cartouter\newdimen\cartinner
\newskip\normbskip\newskip\normpskip\newskip\normlskip
\envdef\cartouche{%
\envparseargdef\cartouche{%
\cartouchefontdefs
\ifhmode\par\fi % can't be in the midst of a paragraph.
\startsavinginserts
@ -7166,16 +7122,19 @@
\baselineskip=0pt\parskip=0pt\lineskip=0pt
\carttop
\hbox\bgroup
\hskip\lskip
\vrule\kern3pt
\vbox\bgroup
\kern3pt
\hsize=\cartinner
\baselineskip=\normbskip
\lineskip=\normlskip
\parskip=\normpskip
\vskip -\parskip
\comment % For explanation, see the end of def\group.
\hskip\lskip
\vrule\kern3pt
\vbox\bgroup
\hsize=\cartinner
\baselineskip=\normbskip
\lineskip=\normlskip
\parskip=\normpskip
\def\arg{#1}%
\ifx\arg\empty\else
\centerV{\hfil \bf #1 \hfil}%
\fi
\kern3pt
\vskip -\parskip
}
\def\Ecartouche{%
\ifhmode\par\fi
@ -7858,10 +7817,12 @@
% Print arguments. Use slanted for @def*, typewriter for @deftype*.
\def\defunargs#1{%
\df \ifdoingtypefn \tt \else \sl \fi
\ifflagclear{txicodevaristt}{}%
{\def\var##1{{\setregularquotes \ttsl ##1}}}%
#1%
\bgroup
\df \ifdoingtypefn \tt \else \sl \fi
\ifflagclear{txicodevaristt}{}%
{\def\var##1{{\setregularquotes \ttsl ##1}}}%
#1%
\egroup
}
% We want ()&[] to print specially on the defun line.
@ -9900,12 +9861,10 @@
% For native Unicode handling (XeTeX and LuaTeX)
\nativeunicodechardefs
\else
% For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
% For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX).
% Since we already invoke \utfeightchardefs at the top level,
% making non-ascii chars active is sufficient.
\setnonasciicharscatcode\active
% since we already invoked \utfeightchardefs at the top level
% (below), do not re-invoke it, otherwise our check for duplicated
% definitions gets triggered. Making non-ascii chars active is
% sufficient.
\fi
%
\else
@ -9930,7 +9889,6 @@
\fi
}
% emacs-page
% A message to be logged when using a character that isn't available
% the default font encoding (OT1).
%
@ -9939,12 +9897,6 @@
% Take account of \c (plain) vs. \, (Texinfo) difference.
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
% First, make active non-ASCII characters in order for them to be
% correctly categorized when TeX reads the replacement text of
% macros containing the character definitions.
\setnonasciicharscatcode\active
%
\def\gdefchar#1#2{%
\gdef#1{%
\ifpassthroughchars
@ -9954,8 +9906,14 @@
\fi
}}
\begingroup
% Make non-ASCII characters active for defining the character definition
% macros.
\setnonasciicharscatcode\active
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
\gdef\latonechardefs{%
\gdefchar^^a0{\tie}
\gdefchar^^a1{\exclamdown}
\gdefchar^^a2{{\tcfont \char162}} % cent
@ -10060,7 +10018,7 @@
}
% Latin9 (ISO-8859-15) encoding character definitions.
\def\latninechardefs{%
\gdef\latninechardefs{%
% Encoding is almost identical to Latin1.
\latonechardefs
%
@ -10075,7 +10033,7 @@
}
% Latin2 (ISO-8859-2) character definitions.
\def\lattwochardefs{%
\gdef\lattwochardefs{%
\gdefchar^^a0{\tie}
\gdefchar^^a1{\ogonek{A}}
\gdefchar^^a2{\u{}}
@ -10179,6 +10137,8 @@
\gdefchar^^ff{\dotaccent{}}
}
\endgroup % active chars
% UTF-8 character definitions.
%
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
@ -11231,14 +11191,14 @@
\relax
}
% Define all Unicode characters we know about. This makes UTF-8 the default
% input encoding and allows @U to work.
% Define all Unicode characters we know about
\iftxinativeunicodecapable
\nativeunicodechardefsatu
\else
\utfeightchardefs
\fi
\message{formatting,}
\newdimen\defaultparindent \defaultparindent = 15pt
@ -11566,7 +11526,7 @@
\fi
}
\microtypeON
\microtypeOFF
\parseargdef\microtype{%
\def\txiarg{#1}%
@ -11583,6 +11543,9 @@
\message{and turning on texinfo input format.}
% Make UTF-8 the default encoding.
\documentencodingzzz{UTF-8}
\def^^L{\par} % remove \outer, so ^L can appear in an @comment
\catcode`\^^K = 10 % treat vertical tab as whitespace
@ -11645,23 +11608,32 @@
% Used sometimes to turn off (effectively) the active characters even after
% parsing them.
\def\turnoffactive{%
\normalturnoffactive
\passthroughcharstrue
\let-=\normaldash
\let"=\normaldoublequote
\let$=\normaldollar %$ font-lock fix
\let+=\normalplus
\let<=\normalless
\let>=\normalgreater
\let^=\normalcaret
\let_=\normalunderscore
\let|=\normalverticalbar
\let~=\normaltilde
\otherbackslash
\setregularquotes
\unsepspaces
}
\catcode`\@=0
% If a .fmt file is being used, characters that might appear in a file
% name cannot be active until we have parsed the command line.
% So turn them off again, and have \loadconf turn them back on.
\catcode`+=\other \catcode`\_=\other
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
% \realbackslash is an actual character `\' with catcode other.
{\catcode`\\=\other @gdef@realbackslash{\}}
% In Texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
\catcode`\\=\active % @ for escape char from now on.
% Print a typewriter backslash. For math mode, we can't simply use
% \backslashcurfont: the story here is that in math mode, the \char
% of \backslashcurfont ends up printing the roman \ from the math symbol
@ -11671,8 +11643,102 @@
% ignored family value; char position "5C). We can't use " for the
% usual hex value because it has already been made active.
@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
\def\ttbackslash{{\tt \ifmmode \mathchar29020 \else \backslashcurfont \fi}}
\let\backslashchar = \ttbackslash % \backslashchar{} is for user documents.
% These are made active for url-breaking, so need
% active definitions as the normal characters.
\def\normaldot{.}
\def\normalquest{?}
\def\normalslash{/}
% \newlinesloadsconf - call \loadconf as soon as possible in the
% file, e.g. at the first newline.
%
{\catcode`\^=7
\catcode`\^^M=13
\gdef\newlineloadsconf{%
\catcode`\^^M=13 %
\newlineloadsconfzz%
}
\gdef\newlineloadsconfzz#1^^M{%
\def\c{\loadconf\c}%
% Definition for the first newline read in the file
\def ^^M{\loadconf}%
% In case the first line has a whole-line command on it
\let\originalparsearg\parsearg%
\def\parsearg{\loadconf\originalparsearg}%
}}
% Emergency active definition of newline, in case an active newline token
% appears by mistake.
{\catcode`\^=7 \catcode13=13%
\gdef\enableemergencynewline{%
\gdef^^M{%
\par%
%<warning: active newline>\par%
}}}
% \loadconf gets called at the beginning of every Texinfo file.
% If texinfo.cnf is present on the system, read it. Useful for site-wide
% @afourpaper, etc. Not opening texinfo.cnf directly in texinfo.tex
% makes it possible to make a format file for Texinfo.
%
\gdef\loadconf{%
\relax % Terminate the filename if running as "tex '&texinfo' FILE.texi".
%
% Turn off the definitions that trigger \loadconf
\everyjobreset
\catcode13=5 % regular end of line
\enableemergencynewline
\let\c=\comment
\let\parsearg\originalparsearg
%
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
\catcode`+=\active
\catcode`\_=\active
%
\openin 1 texinfo.cnf
\ifeof 1 \else \input texinfo.cnf \fi
\closein 1
}
% Redefine some control sequences to be controlled by the \ifdummies
% and \ifindexnofonts switches. Do this at the end so that the control
% sequences are all defined.
\definedummies
\catcode`\@=0
% \realbackslash is an actual character `\' with catcode other.
{\catcode`\\=\other @gdef@realbackslash{\}}
% In Texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
\catcode`\\=\active % @ for escape char from now on.
@let\ = @ttbackslash
% If in a .fmt file, print the version number.
% \eatinput stops the `\input texinfo' from showing up.
% After that, `\' should revert to printing a backslash.
% Turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
%
@everyjob{@message{[Texinfo version @texinfoversion]}%
@global@let\ = @eatinput
@catcode`+=@active @catcode`@_=@active}
{@catcode`@^=7 @catcode`@^^M=13%
@gdef@eatinput input texinfo#1^^M{@loadconf}}
@def@everyjobreset{@ifx\@eatinput @let\ = @ttbackslash @fi}
% \otherbackslash defines an active \ to be a literal `\' character with
% catcode other.
@ -11683,97 +11749,14 @@
%
{@catcode`- = @active
@gdef@normalturnoffactive{%
@passthroughcharstrue
@let-=@normaldash
@let"=@normaldoublequote
@let$=@normaldollar %$ font-lock fix
@let+=@normalplus
@let<=@normalless
@let>=@normalgreater
@let^=@normalcaret
@let_=@normalunderscore
@let|=@normalverticalbar
@let~=@normaltilde
@turnoffactive
@let\=@ttbackslash
@setregularquotes
@unsepspaces
}
}
% If a .fmt file is being used, characters that might appear in a file
% name cannot be active until we have parsed the command line.
% So turn them off again, and have @fixbackslash turn them back on.
@catcode`+=@other @catcode`@_=@other
% \enablebackslashhack - allow file to begin `\input texinfo'
%
% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
% That is what \eatinput is for; after that, the `\' should revert to printing
% a backslash.
% If the file did not have a `\input texinfo', then it is turned off after
% the first line; otherwise the first `\' in the file would cause an error.
% This is used on the very last line of this file, texinfo.tex.
% We also use @c to call @fixbackslash, in case ends of lines are hidden.
{
@catcode`@^=7
@catcode`@^^M=13@gdef@enablebackslashhack{%
@global@let\ = @eatinput%
@catcode`@^^M=13%
@def@c{@fixbackslash@c}%
% Definition for the newline at the end of this file.
@def ^^M{@let^^M@secondlinenl}%
% Definition for a newline in the main Texinfo file.
@gdef @secondlinenl{@fixbackslash}%
% In case the first line has a whole-line command on it
@let@originalparsearg@parsearg
@def@parsearg{@fixbackslash@originalparsearg}
}}
{@catcode`@^=7 @catcode`@^^M=13%
@gdef@eatinput input texinfo#1^^M{@fixbackslash}}
% Emergency active definition of newline, in case an active newline token
% appears by mistake.
{@catcode`@^=7 @catcode13=13%
@gdef@enableemergencynewline{%
@gdef^^M{%
@par%
%<warning: active newline>@par%
}}}
@gdef@fixbackslash{%
@ifx\@eatinput @let\ = @ttbackslash @fi
@catcode13=5 % regular end of line
@enableemergencynewline
@let@c=@comment
@let@parsearg@originalparsearg
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
@catcode`+=@active
@catcode`@_=@active
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
% called at the beginning of every Texinfo file. Not opening texinfo.cnf
% directly in this file, texinfo.tex, makes it possible to make a format
% file for Texinfo.
%
@openin 1 texinfo.cnf
@ifeof 1 @else @input texinfo.cnf @fi
@closein 1
}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
% These (along with & and #) are made active for url-breaking, so need
% active definitions as the normal characters.
@def@normaldot{.}
@def@normalquest{?}
@def@normalslash{/}
% These look ok in all fonts, so just make them not special.
% @hashchar{} gets its own user-level command, because of #line.
@catcode`@& = @other @def@normalamp{&}
@ -11788,15 +11771,11 @@
@c Do this last of all since we use ` in the previous @catcode assignments.
@catcode`@'=@active
@catcode`@`=@active
@setregularquotes
@c Local variables:
@c eval: (add-hook 'before-save-hook 'time-stamp nil t)
@c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}"
@c page-delimiter: "^\\\\message\\|emacs-page"
@c page-delimiter: "^\\\\message"
@c End:
@c vim:sw=2:
@enablebackslashhack
@newlineloadsconf

View file

@ -1,5 +1,5 @@
\input texinfo @c -*- mode: texinfo; coding: utf-8 -*-
@setfilename ../info/tramp
@setfilename ../../info/tramp.info
@c %**start of header
@include docstyle.texi
@c In the Tramp GIT, the version number and the bug report address
@ -927,6 +927,17 @@ pod is used.
This method does not support user names.
@item @option{toolbox}
@cindex method @option{toolbox}
@cindex @option{toolbox} method
Integration of Toolbox system containers. The host name may be either
a container's name or ID, as returned by @samp{toolbox list -c}.
Without a host name, the default Toolbox container for the host will
be used.
This method does not support user names.
@end table
@ -3928,12 +3939,12 @@ connection-local variables.
@vindex async-shell-command-width
@vindex COLUMNS@r{, environment variable}
If Emacs supports the user option @code{async-shell-command-width}
(since @w{Emacs 27}), @value{tramp} cares about its value for
asynchronous shell commands. It specifies the number of display
columns for command output. For synchronous shell commands, a similar
effect can be achieved by adding the environment variable
@env{COLUMNS} to @code{tramp-remote-process-environment}.
@value{tramp} cares about the user option
@code{async-shell-command-width} for asynchronous shell commands. It
specifies the number of display columns for command output. For
synchronous shell commands, a similar effect can be achieved by adding
the environment variable @env{COLUMNS} to
@code{tramp-remote-process-environment}.
@subsection Running @code{eshell} on a remote host
@ -4824,8 +4835,8 @@ Where is the latest @value{tramp}?
@item
Which systems does it work on?
The package works successfully on @w{Emacs 26}, @w{Emacs 27}, @w{Emacs
28}, and @w{Emacs 29}.
The package works successfully on @w{Emacs 27}, @w{Emacs 28}, @w{Emacs
29}, and @w{Emacs 30}.
While Unix and Unix-like systems are the primary remote targets,
@value{tramp} has equal success connecting to other platforms, such as

View file

@ -7,10 +7,10 @@
@c In the Tramp GIT, the version number and the bug report address
@c are auto-frobbed from configure.ac.
@set trampver 2.6.0-pre
@set trampver 2.7.0-pre
@set trampurl https://www.gnu.org/software/tramp/
@set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 26.1
@set emacsver 27.1
@c Other flags from configuration.
@set instprefix /usr/local

View file

@ -1,6 +1,6 @@
GNU Emacs NEWS -- history of user-visible changes.
Copyright (C) 2021-2023 Free Software Foundation, Inc.
Copyright (C) 2022-2023 Free Software Foundation, Inc.
See the end of the file for license conditions.
Please send Emacs bug reports to 'bug-gnu-emacs@gnu.org'.
@ -32,23 +32,27 @@ applies, and please also update docstrings as needed.
** X selection requests are now handled much faster and asynchronously.
This means it should be less necessary to disable the likes of
`select-active-regions' when Emacs is running over a slow network
'select-active-regions' when Emacs is running over a slow network
connection.
** Emacs now updates invisible frames that are made visible by a compositor.
If an invisible or an iconified frame is shown to the user by the
compositing manager, Emacs will now redisplay such a frame even though
'frame-visible-' returns nil or 'icon' for it. This can happen, for
'frame-visible-p' returns nil or 'icon' for it. This can happen, for
example, as part of preview for iconified frames.
+++
** 'write-region-inhibit-fsync' now defaults to t in interactive mode,
as it has in batch mode since Emacs 24.
* Editing Changes in Emacs 30.1
** New helper 'transpose-sexps-function'
Emacs now can set this defvar to customize the behavior of the
** New helper variable 'transpose-sexps-function'.
Emacs now can set this variable to customize the behavior of the
'transpose-sexps' function.
** New function 'treesit-transpose-sexps'
** New function 'treesit-transpose-sexps'.
treesit.el now unconditionally sets 'transpose-sexps-function' for all
Tree-sitter modes. This functionality utilizes the new
'transpose-sexps-function'.
@ -56,20 +60,20 @@ Tree-sitter modes. This functionality utilizes the new
* Changes in Specialized Modes and Packages in Emacs 30.1
---
** Variable order and truncation can now be configured in gdb-many-window mode.
The new variable 'gdb-locals-table-row-config' allows users to
** Variable order and truncation can now be configured in 'gdb-many-windows'.
The new user option 'gdb-locals-table-row-config' allows users to
configure the order and max length of various properties in the local
variables buffer when using 'gdb-many-windows'.
By default, this variable is set to write the properties in the order:
By default, this user option is set to write the properties in the order:
name, type and value, where the name and type are truncated to 20
characters, and the value is truncated according to the value of
'gdb-locals-value-limit'.
If you want to get back the old behavior, set
'gdb-locals-table-row-config' to the value
If you want to get back the old behavior, set the user option to the value
((type . 0)(name . 0)(value . ,gdb-locals-value-limit)).
(setopt gdb-locals-table-row-config
`((type . 0) (name . 0) (value . ,gdb-locals-value-limit)))
** VC
@ -79,7 +83,7 @@ This is a string or a list of strings that specifies the Git log
switches for shortlogs, such as the one produced by 'C-x v L'.
'vc-git-log-switches' is no longer used for shortlogs.
** bs
** Buffer Selection
---
*** New user option 'bs-default-action-list'.
@ -98,32 +102,45 @@ manual.
+++
*** 'eshell-read-aliases-list' is now an interactive command.
After manually editing 'eshell-aliases-file', you can use
'M-x eshell-read-aliases-list' to load the edited aliases.
After manually editing 'eshell-aliases-file', you can use this command
to load the edited aliases.
** Prog Mode
+++
*** New command 'prog-fill-reindent-defun'
*** New command 'prog-fill-reindent-defun'.
This command either fills a single paragraph in a defun, such as a
doc-string, or a comment, or (re)indents the surrounding defun if
docstring, or a comment, or (re)indents the surrounding defun if
point is not in a comment or a string. It is by default bound to
'M-q' in 'prog-mode' and all its descendants.
** Tramp
+++
*** New connection method "toolbox".
This allow accessing system containers provided by Toolbox.
* New Modes and Packages in Emacs 30.1
---
** The highly accessible Modus themes collection has six items
** The highly accessible Modus themes collection has six items.
The 'modus-operandi' and 'modus-vivendi' are the main themes that have
been part of Emacs since version 28. The former is light, the latter
dark. In addition to these, we now have 'modus-operandi-tinted' and
'modus-vivendi-tinted' for easier legibility, as well as
'modus-operandi-deuteranopia' and 'modus-vivendi-deuteranopia' to
cover the needs of users with red-green color deficiency. The Info
manual of the themes describes the details and showcases all their
customization options.
manual "(modus-themes) Top" describes the details and showcases all
their customization options.
* Incompatible Lisp Changes in Emacs 30.1
** User option 'tramp-completion-reread-directory-timeout' has been removed.
This user option has been obsoleted in Emacs 27, use
'remote-file-name-inhibit-cache' instead.
* Lisp Changes in Emacs 30.1
@ -135,7 +152,7 @@ The compiler now warns about an empty body argument to 'when',
'unless', 'ignore-error' and 'with-suppressed-warnings' in addition to
the existing warnings for 'let' and 'let*'. Example:
(when (> x 2))
(when (> x 2))
This warning can be suppressed using 'with-suppressed-warnings' with
the warning name 'empty-body'.
@ -145,9 +162,9 @@ the warning name 'empty-body'.
The compiler now warns about quoted condition (error) names
in 'condition-case' and 'ignore-error'. Example:
(condition-case nil
(/ x y)
('arith-error "division by zero"))
(condition-case nil
(/ x y)
('arith-error "division by zero"))
Quoting them adds the error name 'quote' to those handled or ignored
respectively, which was probably not intended.
@ -158,7 +175,7 @@ The compiler now warns about comparisons by identity with a literal
string, cons, vector, record, function, large integer or float as this
may not match any value at all. Example:
(eq x "hello")
(eq x "hello")
Only literals for symbols and small integers (fixnums), including
characters, are guaranteed to have a consistent (unique) identity.
@ -173,7 +190,6 @@ compared reliably at all.
This warning can be suppressed using 'with-suppressed-warnings' with
the warning name 'suspicious'.
* Changes in Emacs 30.1 on Non-Free Operating Systems

View file

@ -68,6 +68,12 @@ Emacs modes you will use, as Emacs loads these libraries only when the
corresponding mode is turned on in some buffer for the first time in
an Emacs session.
Emacs provides a user command, 'treesit-install-language-grammar',
that automates the download and build process of a grammar library.
It prompts for the language, the URL of the language grammar's VCS
repository, and then uses the installed C/C++ compiler to build the
library and install it.
+++
** Emacs can be built with built-in support for accessing SQLite databases.
This uses the popular sqlite3 library, and can be disabled by using
@ -326,7 +332,7 @@ this off, disable the new 'isearch-fold-quotes-mode' minor mode.
---
** Sorting commands no longer necessarily change modification status.
In earlier Emacs versions, commands like 'M-x sort-lines' would always
In earlier Emacs versions, commands like 'sort-lines' would always
change buffer modification status to "modified", whether they changed
something in the buffer or not. This has been changed: the buffer is
marked as modified only if the sorting ended up actually changing the
@ -377,7 +383,7 @@ files that were compiled with an old EIEIO (Emacs<25).
This is to open up the 'C-x 8 .' map to bind further characters there.
---
** 'C-x 8 =' moved to 'C-x 8 = ='.
** 'C-x 8 =' has been moved to 'C-x 8 = ='.
You can now use 'C-x 8 =' to insert several characters with macron;
for example, 'C-x 8 = a' will insert U+0101 LATIN SMALL LETTER A WITH
MACRON. To insert a lone macron, type 'C-x 8 = =' instead of the
@ -387,8 +393,8 @@ previous 'C-x ='.
*** Eshell's PATH is now derived from 'exec-path'.
For consistency with remote connections, Eshell now uses 'exec-path'
to determine the execution path on the local system, instead of using
the PATH environment variable directly.
to determine the execution path on the local or remote system, instead
of using the PATH environment variable directly.
---
*** 'source' and '.' no longer accept the '--help' option.
@ -410,12 +416,12 @@ To pipe both stdout and stderr, use the '|&' operator instead of '|'.
---
** The 'delete-forward-char' command now deletes by grapheme clusters.
This command is by default bound to the <Delete> function key
(a.k.a. <deletechar>). When invoked without a prefix argument or with
a positive prefix numeric argument, the command will now delete
This command is by default bound to the '<Delete>' function key
(a.k.a. '<deletechar>'). When invoked without a prefix argument or
with a positive prefix numeric argument, the command will now delete
complete grapheme clusters produced by character composition. For
example, if point is before an Emoji sequence, pressing <Delete> will
delete the entire sequence, not just a single character at its
example, if point is before an Emoji sequence, pressing '<Delete>'
will delete the entire sequence, not just a single character at its
beginning.
+++
@ -504,7 +510,7 @@ performance, but the latter is closer to a drop-in replacement.
---
** The thumbs.el library is now obsolete.
We recommend using 'M-x image-dired' instead.
We recommend using command 'image-dired' instead.
---
** The autoarg.el library is now marked obsolete.
@ -642,7 +648,7 @@ duplicated on its right-hand side.
+++
** 'network-lookup-address-info' can now check numeric IP address validity.
Specifying 'numeric' as the new optional 'hints' argument makes it
Specifying 'numeric' as the new optional HINTS argument makes it
check if the passed address is a valid IPv4/IPv6 address (without DNS
traffic).
@ -691,7 +697,7 @@ This is like 'save-buffers-kill-emacs', but instead of just killing
the current Emacs process at the end, it starts a new Emacs process
(using the same command line arguments as the running Emacs process).
'kill-emacs' and 'save-buffers-kill-emacs' have also gained new
optional parameters to restart instead of just killing the current
optional arguments to restart instead of just killing the current
process.
** Drag and Drop
@ -792,6 +798,7 @@ filter/sentinel error has been handled.
These faces are primarily meant for use with tree-sitter. They are:
'font-lock-bracket-face', 'font-lock-delimiter-face',
'font-lock-escape-face', 'font-lock-number-face',
'font-lock-regexp-face',
'font-lock-misc-punctuation-face', 'font-lock-operator-face',
'font-lock-property-face', and 'font-lock-punctuation-face'.
@ -896,7 +903,7 @@ the 'COLORTERM' environment variable is set to the value "truecolor".
---
*** Select active regions with xterm selection support.
On terminals with xterm setSelection support, the active region may be
On terminals with xterm "setSelection" support, the active region may be
saved to the X primary selection, following the
'select-active-regions' variable. This support is enabled when
'tty-select-active-regions' is non-nil.
@ -1035,7 +1042,7 @@ instead.
*** New user option 'help-enable-variable-value-editing'.
If enabled, 'e' on a value in "*Help*" will pop you to a new buffer
where you can edit the value. This is not enabled by default, because
it's easy to make an edit that yields an invalid result.
it is easy to make an edit that yields an invalid result.
---
*** 'C-h b' uses outlining by default.
@ -1080,7 +1087,7 @@ helpful commands for various tasks. You can toggle the display using
'C-h C-q'.
** Emacs now comes with Org v9.6.
See the file ORG-NEWS for user-visible changes in Org.
See the file "ORG-NEWS" for user-visible changes in Org.
** Outline Mode
@ -1129,14 +1136,14 @@ buffer on that frame.
*** 'display-buffer' now can set up the body size of the chosen window.
For example, a 'display-buffer-alist' entry of
'(window-width . (body-columns . 40))'
(window-width . (body-columns . 40))
will make the body of the chosen window 40 columns wide. For the
height use 'window-height' and 'body-lines', respectively.
---
*** You can customize on which window 'scroll-other-window' operates.
This is controlled by the new 'other-window-scroll-default' user option.
This is controlled by the new 'other-window-scroll-default' variable.
** Frames
@ -1176,7 +1183,7 @@ LRI). The new command 'highlight-confusing-reorderings' finds and
highlights segments of buffer text whose reordering for display is
suspicious and could be malicious.
** Emacs server and client changes
** Emacs Server and Client
+++
*** New command-line option '-r'/'--reuse-frame' for emacsclient.
@ -1209,9 +1216,9 @@ available options can be restored by enabling this option.
*** New user option 'rcirc-bridge-bot-alist'.
If you are in a channel where a bot is responsible for bridging
between networks, you can use this variable to make these messages
appear more native. For example you might set the option to:
appear more native. For example, you might set the option to:
(setq rcirc-bridge-bot-alist '(("bridge" . "{\\(.+?\\)}[[:space:]]+")))
(setopt rcirc-bridge-bot-alist '(("bridge" . "{\\(.+?\\)}[[:space:]]+")))
for messages like
@ -1250,6 +1257,7 @@ will wait forever for redisplay to finish. (We believe you won't need
this feature, given the ability to display buffers with very long
lines.)
* Editing Changes in Emacs 29.1
+++
@ -1307,12 +1315,12 @@ dragged.
---
** New user option 'yank-menu-max-items'.
Customize this option to limit the number of entries in the menu
"Edit->Paste from Kill Menu". The default is 60.
"EditPaste from Kill Menu". The default is 60.
+++
** Performing a pinch gesture on a touchpad now increases the text scale.
** show-paren-mode
** Show Paren Mode
+++
*** New user option 'show-paren-context-when-offscreen'.
@ -1352,15 +1360,16 @@ you don't want to enable input fontification by default.
---
*** New user options for alternate wheel events.
The options 'mouse-wheel-down-alternate-event',
'mouse-wheel-up-alternate-event', 'mouse-wheel-left-alternate-event',
and 'mouse-wheel-right-alternate-event' have been added to better
support systems where two kinds of wheel events can be received.
The user options 'mouse-wheel-down-alternate-event' and
'mouse-wheel-up-alternate-event' as well as the variables
'mouse-wheel-left-alternate-event' and
'mouse-wheel-right-alternate-event' have been added to better support
systems where two kinds of wheel events can be received.
** Internationalization changes
** Internationalization
---
*** The <Delete> function key now allows deleting the entire composed sequence.
*** The '<Delete>' function key now allows deleting the entire composed sequence.
For the details, see the item about the 'delete-forward-char' command
above.
@ -1465,7 +1474,7 @@ change the input method's translation rules, customize the user option
'tamil-translation-rules'.
---
*** New tamil99 input method for the Tamil language.
*** New 'tamil99' input method for the Tamil language.
This supports the keyboard layout specifically designed for the Tamil
language.
@ -1499,7 +1508,7 @@ If non-nil and there's only one matching option, auto-select that.
If non-nil, this user option describes what entries not to add to the
database stored on disk.
** Auth-Source
** Auth Source
+++
*** New user option 'auth-source-pass-extra-query-keywords'.
@ -1531,7 +1540,7 @@ The corresponding key 'Y' is now bound by default in Dired.
+++
*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
The corresponding key '% Y' is now bound by default in Dired.
The corresponding key sequence '% Y' is now bound by default in Dired.
---
*** 'M-G' is now bound to 'dired-goto-subdir'.
@ -1577,7 +1586,7 @@ Dired will now, by default, include the free space in the first line
instead of having it on a separate line. To get the previous behavior
back, say:
(setq dired-free-space 'separate)
(setopt dired-free-space 'separate)
---
*** New user option 'dired-make-directory-clickable'.
@ -1670,7 +1679,7 @@ this invocation as its default.
This is bound to 'H' and toggles whether to hide or show the widget
contents.
** Diff mode
** Diff Mode
---
*** New user option 'diff-whitespace-style'.
@ -1820,7 +1829,7 @@ only jump if the location of the first error is known), and
+++
*** New user option 'compilation-max-output-line-length'.
Lines longer than the value of this variable will have their ends
Lines longer than the value of this option will have their ends
hidden, with a button to reveal the hidden text. This speeds up
operations like grepping on files that have few newlines. The default
value is 400; set to nil to disable hiding.
@ -1852,10 +1861,10 @@ uses the 'key-parse' syntax. It replaces the old 'kmacro-lambda-form'
---
** savehist.el can now truncate variables that are too long.
An element of 'savehist-additional-variables' can now be of the form
'(VARIABLE . MAX-ELTS)', which means to truncate the VARIABLE's value to
at most MAX-ELTS elements (if the value is a list) before saving the
value.
An element of user option 'savehist-additional-variables' can now be
of the form '(VARIABLE . MAX-ELTS)', which means to truncate the
VARIABLE's value to at most MAX-ELTS elements (if the value is a list)
before saving the value.
** Minibuffer and Completions
@ -1972,7 +1981,7 @@ command accepts the Unicode name of an Emoji (for example, "smiling
face" or "heart with arrow"), like 'C-x 8 e e', with minibuffer
completion, and adds the Emoji into the search string.
** Glyphless characters
** Glyphless Characters
+++
*** New minor mode 'glyphless-display-mode'.
@ -1989,7 +1998,7 @@ and GUI terminals.
*** "Replacement character" feature for undisplayable characters on TTYs.
The 'acronym' method of displaying glyphless characters on text-mode
frames treats single-character acronyms specially: they are displayed
without the surrounding [..] "box", thus in effect treating such
without the surrounding '[..]' "box", thus in effect treating such
"acronyms" as replacement characters.
** Registers
@ -2001,7 +2010,7 @@ For instance, to enable jumping to the "*Messages*" buffer with
(set-register ?m '(buffer . "*Messages*"))
** Pixel-fill
** Pixel Fill
+++
*** This is a new package that deals with filling variable-pitch text.
@ -2013,11 +2022,11 @@ This fills the region to be no wider than a specified pixel width.
** Info
+++
*** 'M-x info-apropos' now takes a prefix argument to search for regexps.
*** Command 'info-apropos' now takes a prefix argument to search for regexps.
---
*** New command 'Info-goto-node-web' and key binding 'G'.
This will take you to the gnu.org web server's version of the current
This will take you to the "gnu.org" web server's version of the current
info node. This command only works for the Emacs and Emacs Lisp manuals.
** Shortdoc
@ -2158,9 +2167,9 @@ main Emacs initialization file ("~/.emacs" or "~/.emacs.d/init.el").
+++
*** 'eudc-expansion-overwrites-query' to 'eudc-expansion-save-query-as-kill'.
'eudc-expansion-overwrites-query' is renamed to
The user option 'eudc-expansion-overwrites-query' is renamed to
'eudc-expansion-save-query-as-kill' to reflect the actual behavior of
the user option.
the user option. The former is kept as alias.
+++
*** New command 'eudc-expand-try-all'.
@ -2174,7 +2183,7 @@ for a name that happens to match a contact in one's BBDB.
*** New behavior and default for user option 'eudc-inline-expansion-format'.
EUDC inline expansion result formatting defaulted to
'("%s %s <%s>" firstname name email)
("%s %s <%s>" firstname name email)
Since email address specifications need to comply with RFC 5322 in
order to be useful in messages, there was a risk to produce syntax
@ -2221,8 +2230,9 @@ are supported only.
The 'eww-auto-rename-buffer' user option can be configured to rename
rendered web pages by using their title, URL, or a user-defined
function which returns a string. For the first two cases, the length
of the resulting name is controlled by 'eww-buffer-name-length'. By
default, no automatic renaming is performed.
of the resulting name is controlled by the user option
'eww-buffer-name-length'. By default, no automatic renaming is
performed.
+++
*** New user option 'shr-allowed-images'.
@ -2241,7 +2251,7 @@ doesn't work on other systems. Also see etc/PROBLEMS.
These are used to alter an URL before using it. By default it removes
the common "utm_" trackers from URLs.
** Find-Dired
** Find Dired
---
*** New command 'find-dired-with-command'.
@ -2258,14 +2268,14 @@ Message, referred to as 'gnus-summary-tool-bar-retro',
'gnus-group-tool-bar-retro' and 'message-tool-bar-retro', and
'gnus-summary-tool-bar-gnome', 'gnus-group-tool-bar-gnome' and
'message-tool-bar-gnome'. The "retro" tool bars have been removed (as
well as the icons used), and the "Gnome" tool bars are now the only
well as the icons used), and the "gnome" tool bars are now the only
pre-defined toolbars.
---
*** 'gnus-summary-up-thread' and 'gnus-summary-down-thread' bindings removed.
The 'gnus-summary-down-thread' binding to "M-C-d" was shadowed by
The 'gnus-summary-down-thread' binding to 'M-C-d' was shadowed by
'gnus-summary-read-document', and these commands are also available on
"T-u" and "T-d" respectively.
'T u' and 'T d' respectively.
---
*** Gnus now uses a variable-pitch font in the headers by default.
@ -2349,7 +2359,7 @@ displayed in the "*Help*" buffer will be linked to the documentation
for the command they are bound to. This does not affect listings of
key bindings and functions (such as 'C-h b').
** Info-look
** Info Look
---
*** info-look specs can now be expanded at run time instead of a load time.
@ -2357,14 +2367,14 @@ The new ':doc-spec-function' element can be used to compute the
':doc-spec' element when the user asks for info on that particular
mode (instead of at load time).
** Ansi-color
** Ansi Color
---
*** Support for ANSI 256-color and 24-bit colors.
256-color and 24-bit color codes are now handled by ANSI color
filters and displayed with the specified color.
** Term-mode
** Term Mode
---
*** New user option 'term-bind-function-keys'.
@ -2428,7 +2438,7 @@ matches.
---
*** New function 'xref-show-xrefs'.
** File notifications
** File Notifications
+++
*** The new command 'file-notify-rm-all-watches' removes all file notifications.
@ -2499,7 +2509,7 @@ The old name was confusing, and is now an obsolete function alias.
*** Users can now add special image conversion functions.
This is done via 'image-converter-add-handler'.
** Image-Dired
** Image Dired
+++
*** 'image-dired-image-mode' is now based on 'image-mode'.
@ -2600,9 +2610,9 @@ programs. Version 0.9.0 adds two larger thumbnail sizes: 512x512 and
to use it; it is not enabled by default.
---
*** Reduce dependency on external "exiftool" command.
The 'image-dired-copy-with-exif-file-name' no longer requires an
external "exiftool" command to be available. The user options
*** Reduce dependency on external "exiftool" program.
The 'image-dired-copy-with-exif-file-name' command no longer requires
an external "exiftool" program to be available. The user options
'image-dired-cmd-read-exif-data-program' and
'image-dired-cmd-read-exif-data-options' are now obsolete.
@ -2706,7 +2716,7 @@ fringe (or nil to disable showing this marker).
This is a convenience function to extract the field data from
'exif-parse-file' and 'exif-parse-buffer'.
** Xwidgets
** Xwidget
---
*** New user option 'xwidget-webkit-buffer-name-format'.
@ -2749,7 +2759,7 @@ and friends.
+++
*** New connection methods "docker", "podman" and "kubernetes".
They allow accessing environments provided by Docker and similar
They allow accessing containers provided by Docker and similar
programs.
---
@ -2847,7 +2857,7 @@ will cause the whole command to be passed to the operating system
shell. This is particularly useful to bypass Eshell's own pipelining
support for pipelines which will move a lot of data. See section
"Running Shell Pipelines Natively" in the Eshell manual, node
"(eshell) Input/Output".
"(eshell) Pipelines".
+++
*** New module to help supplying absolute file names to remote commands.
@ -2902,8 +2912,8 @@ values passed as a single token, such as '-oVALUE' or
commands" in the "(eshell) Built-ins" node of the Eshell manual.
---
*** Eshell globs ending with '/' now match only directories.
Additionally, globs ending with '**/' or '***/' no longer raise an
*** Eshell globs ending with "/" now match only directories.
Additionally, globs ending with "**/" or "***/" no longer raise an
error, and now expand to all directories recursively (following
symlinks in the latter case).
@ -3046,7 +3056,7 @@ The old name is still available as an obsolete function alias.
*** The url-irc library now understands "ircs://" links.
---
*** New command 'world-clock-copy-time-as-kill' for 'M-x world-clock'.
*** New command 'world-clock-copy-time-as-kill' for 'world-clock-mode'.
It copies the current line into the kill ring.
---
@ -3055,17 +3065,17 @@ The new face 'abbrev-table-name' is used to display the abbrev table
name.
---
*** New key binding 'O' in 'M-x list-buffers'.
*** New key binding 'O' in "*Buffer List*".
This key is now bound to 'Buffer-menu-view-other-window', which will
view this line's buffer in View mode in another window.
** Scheme mode
** Scheme Mode
---
*** Auto-detection of Scheme library files.
Emacs now automatically enables the Scheme mode when opening R6RS
Scheme Library Source ('.sls') files and R7RS Scheme Library
Definition ('.sld') files.
Scheme Library Source (".sls") files and R7RS Scheme Library
Definition (".sld") files.
---
*** Imenu members for R6RS and R7RS library members.
@ -3080,10 +3090,10 @@ Imenu now lists the members directly nested in R6RS Scheme libraries
Emacs now comes with the Eglot package, which enhances various Emacs
features, such as completion, documentation, error detection, etc.,
based on data provided by language servers using the Language Server
Protocol (LSP).
Protocol (LSP). See the new Info manual "(eglot) Top" for more.
+++
*** use-package: Declarative package configuration.
** use-package: Declarative package configuration.
use-package is now shipped with Emacs. It provides the 'use-package'
macro, which allows you to isolate package configuration in your init
file in a way that is declarative, tidy, and performance-oriented.
@ -3151,6 +3161,15 @@ files, the new modes based on tree-sitter are for now entirely
optional, and you must turn them on manually, or customize
'auto-mode-alist' to turn them on automatically.
Where no major modes previously existed in Emacs for editing the kinds
of files for which Emacs now provides a tree-sitter based mode, Emacs
will now try to enable these new modes automatically when you visit
such files, and will display a warning if the tree-sitter library or
the parser grammar library is not available. To prevent the warnings,
either build Emacs with tree-sitter and install the grammar libraries,
or customize 'auto-mode-alist' to specify some other major mode (or
even 'fundamental-mode') for those kinds of files.
Each major mode based on tree-sitter needs a language grammar library,
usually named "libtree-sitter-LANG.so" ("libtree-sitter-LANG.dll" on
MS-Windows), where LANG is the corresponding language name. Emacs
@ -3236,9 +3255,8 @@ extension is ".cmake".
+++
*** New major mode 'toml-ts-mode'.
A major mode based on the tree-sitter library for editing files
written in TOML, a format for writing configuration files. It is
auto-enabled for files with the ".toml" extension.
An optional major mode based on the tree-sitter library for editing
files written in TOML, a format for writing configuration files.
+++
*** New major mode 'go-ts-mode'.
@ -3317,13 +3335,13 @@ auto-scaling applied. (This only makes a difference on HiDPI
displays.)
+++
** Changes in how "raw" in-memory xbm images are specified.
** Changes in how "raw" in-memory XBM images are specified.
Some years back Emacs gained the ability to scale images, and you
could then specify ':width' and ':height' when using 'create-image' on all
image types -- except xbm images, because this format already used the
image types -- except XBM images, because this format already used the
':width' and ':height' arguments to specify the width/height of the "raw"
in-memory format. This meant that if you used these specifications
on, for instance, xbm files, Emacs would refuse to display them. This
on, for instance, XBM files, Emacs would refuse to display them. This
has been changed, and ':width'/':height' now works as with all other image
formats, and the way to specify the width/height of the "raw"
in-memory format is now by using ':data-width' and ':data-height'.
@ -3334,7 +3352,7 @@ The various "loaddefs.el" files in the Emacs tree (which contain
information about autoloads, built-in packages and package prefixes)
used to be generated by functions in autoloads.el. These are now
generated by loaddefs-gen.el instead. This leads to functionally
equivalent "loaddef.el" files, but they do not use exactly the same
equivalent "loaddefs.el" files, but they do not use exactly the same
syntax, so using 'M-x update-file-autoloads' no longer works. (This
didn't work well in most files in the past, either, but it will now
signal an error in any file.)
@ -3479,7 +3497,7 @@ This change is now applied in 'dired-insert-directory'.
---
** 'compilation-last-buffer' is (finally) declared obsolete.
It's been obsolete since Emacs-22.1, actually.
It has been obsolete since Emacs 22.1, actually.
---
** Calling 'lsh' now elicits a byte-compiler warning.
@ -3509,9 +3527,9 @@ but switching to 'ash' is generally much preferable.
'command-history-map', 'compilation-parse-errors-function',
'completion-annotate-function', 'condition-case-no-debug',
'count-lines-region', 'crisp-mode-modeline-string',
'custom-print-functions', 'custom-print-functions',
'cvs-string-prefix-p', 'data-debug-map', 'deferred-action-function',
'deferred-action-list', 'dired-pop-to-buffer', 'dired-shrink-to-fit',
'custom-print-functions', 'cvs-string-prefix-p', 'data-debug-map',
'deferred-action-function', 'deferred-action-list',
'dired-pop-to-buffer', 'dired-shrink-to-fit',
'dired-sort-set-modeline', 'dired-x-submit-report',
'display-buffer-function',
'ediff-choose-window-setup-function-automatically',
@ -3533,11 +3551,10 @@ but switching to 'ash' is generally much preferable.
'inhibit-first-line-modes-suffixes', 'input-method-inactivate-hook',
'intdos', 'javascript-generic-mode', 'javascript-generic-mode-hook',
'latex-string-prefix-p', 'macro-declaration-function' (function),
'macro-declaration-function' (variable), 'mail-complete-function',
'mail-completion-at-point-function',
'mail-mailer-swallows-blank-line', 'mail-sent-via', 'make-register',
'makefile-complete', 'menu-bar-kill-ring-save',
'meta-complete-symbol', 'meta-mode-map',
'macro-declaration-function' (variable), 'mail-complete',
'mail-complete-function', 'mail-mailer-swallows-blank-line',
'mail-sent-via', 'make-register', 'makefile-complete',
'menu-bar-kill-ring-save', 'meta-complete-symbol', 'meta-mode-map',
'mh-kill-folder-suppress-prompt-hooks',
'minibuffer-completing-symbol',
'minibuffer-local-filename-must-match-map', 'mode25', 'mode4350',
@ -3708,7 +3725,7 @@ This can be used to specify what forms to put into 'command-history'
when executing commands interactively.
+++
** The FORM arg of 'time-convert' is mandatory.
** The FORM argument of 'time-convert' is mandatory.
'time-convert' can still be called without it, as before, but the
compiler now emits a warning about this deprecated usage.
@ -3725,7 +3742,7 @@ TIMEOUT is the idle time after which to deactivate the transient map.
The default timeout value can be defined by the new variable
'set-transient-map-timeout'.
** Connection-local variables
** Connection Local Variables
+++
*** Some connection-local variables are now user options.
@ -3754,7 +3771,7 @@ Reference manual for more information.
+++
** 'plist-get', 'plist-put' and 'plist-member' are no longer limited to 'eq'.
These function now take an optional comparison predicate argument.
These function now take an optional comparison PREDICATE argument.
+++
** 'read-multiple-choice' can now use long-form answers.
@ -3814,7 +3831,7 @@ When called with a new optional argument UNICODE non-nil, 'max-char'
will now report the maximum valid codepoint defined by the Unicode
Standard.
** seq
** Seq
+++
*** New function 'seq-split'.
@ -3852,8 +3869,8 @@ It is called whenever the configuration of different monitors on a
display changes.
+++
** 'prin1' and 'prin1-to-string' now take an optional OVERRIDES parameter.
This parameter can be used to override values of print-related settings.
** 'prin1' and 'prin1-to-string' now take an optional OVERRIDES argument.
This argument can be used to override values of print-related settings.
+++
** New minor mode 'header-line-indent-mode'.
@ -3862,9 +3879,9 @@ be kept aligned with the buffer contents when the user switches
'display-line-numbers-mode' on or off.
+++
** New minor mode 'lost-selection-mode'.
This minor mode makes Emacs deactivate the mark in all buffers when
the primary selection is obtained by another program.
** New global minor mode 'lost-selection-mode'.
This global minor mode makes Emacs deactivate the mark in all buffers
when the primary selection is obtained by another program.
---
** On X, Emacs will try to preserve selection ownership when a frame is deleted.
@ -3879,7 +3896,7 @@ setting the user option 'x-auto-preserve-selections' to nil.
** New predicate 'char-uppercase-p'.
This returns non-nil if its argument its an uppercase character.
** Byte compilation
** Byte Compilation
---
*** Byte compilation will now warn about some quoting mistakes in docstrings.
@ -3897,7 +3914,7 @@ should really be present in the docstring, they should be quoted with
---
*** Byte compilation will now warn about some malformed 'defcustom' types.
It's very common to write 'defcustom' types on the form:
It is very common to write 'defcustom' types on the form:
:type '(choice (const :tag "foo" 'bar))
@ -3976,7 +3993,7 @@ batch-based Emacs scripts.
This works like 'buttonize', but for a region instead of a string.
+++
** 'macroexp-let2*' can omit TEST arg and use single-var bindings.
** 'macroexp-let2*' can omit TEST argument and use single-var bindings.
+++
** New macro-writing macros, 'cl-with-gensyms' and 'cl-once-only'.
@ -3989,7 +4006,7 @@ from which the last input event originated, and 'device-class' can be
used to determine the type of an input device.
+++
** 'track-mouse' can have a new value 'drag-source'.
** Variable 'track-mouse' can have a new value 'drag-source'.
This means the same as 'dropping', but modifies the mouse position
list in reported motion events if there is no frame underneath the
mouse pointer.
@ -4037,7 +4054,7 @@ frequently than once in a second.
---
** New function 'bidi-string-strip-control-characters'.
This utility function is meant for displaying strings when it's
This utility function is meant for displaying strings when it is
essential that there's no bidirectional context. It removes all the
bidirectional formatting control characters (such as RLM, LRO, PDF,
etc.) from its argument string. The characters it removes are listed
@ -4095,21 +4112,21 @@ them towards or away from each other.
+++
** New hook 'x-pre-popup-menu-hook'.
This hook is run before 'x-popup-menu' is about to display a
This hook, run before 'x-popup-menu', is about to display a
deck-of-cards menu on screen.
---
** New hook 'post-select-region-hook'.
This hook is run immediately after 'select-active-regions' causes the
region to be set as the primary selection.
This hook is run immediately after 'select-active-regions'. It causes
the region to be set as the primary selection.
+++
** New function 'buffer-match-p'.
Check if a buffer satisfies some condition. Some examples for
conditions can be regular expressions that match a buffer name, a
cons-cell like '(major-mode . shell-mode)' that matches any buffer
where 'major-mode' is 'shell-mode' or a combined with a condition like
'(and "\\`\\*.+\\*\\'" (major-mode . special-mode))'.
where 'major-mode' is 'shell-mode' or a combination with a condition
like '(and "\\`\\*.+\\*\\'" (major-mode . special-mode))'.
+++
** New function 'match-buffers'.
@ -4117,19 +4134,19 @@ It uses 'buffer-match-p' to gather a list of buffers that match a
condition.
---
** New optional arguments 'text-face' and 'default-face' for 'tooltip-show'.
** New optional arguments TEXT-FACE and DEFAULT-FACE for 'tooltip-show'.
They allow changing the faces used for the tooltip text and frame
colors of the resulting tooltip frame from the default 'tooltip' face.
** Text security and suspiciousness
** Text Security and Suspiciousness
+++
*** New library textsec.el.
This library contains a number of checks for whether a string is
"suspicious". This usually means that the string contains characters
that have glyphs that can be confused with other, more commonly used
glyphs, or contain bidirectional (or other) formatting characters that
may be used to confuse a user.
glyphs, or contains bidirectional (or other) formatting characters
that may be used to confuse a user.
+++
*** New user option 'textsec-check'.
@ -4147,7 +4164,7 @@ This is the main function Emacs applications should be using to check
whether a string is suspicious. It heeds the 'textsec-check' user
option.
** Keymaps and key definitions
** Keymaps and Key Definitions
+++
*** 'where-is-internal' can now filter events marked as non key events.
@ -4183,7 +4200,7 @@ de-emphasized in the documentation.
*** Use 'keymap-set-after' instead of 'define-key-after'.
+++
*** Use 'keymap-lookup' instead of 'lookup-keymap' and 'key-binding'.
*** Use 'keymap-lookup' instead of 'lookup-key' and 'key-binding'.
+++
*** Use 'keymap-local-lookup' instead of 'local-key-binding'.
@ -4271,9 +4288,9 @@ instance) when covering huge amounts of data (that has no meaningful
searchable data, like image data) with a 'display' text property.
+++
** 'insert-image' now takes an INHIBIT-ISEARCH optional parameter.
** 'insert-image' now takes an INHIBIT-ISEARCH optional argument.
It marks the image with the 'inhibit-isearch' text property, which
inhibits 'isearch' matching the STRING parameter.
inhibits 'isearch' matching the STRING argument.
---
** New variable 'replace-regexp-function'.
@ -4341,7 +4358,7 @@ character width/height.
This means the vscroll will not be reset when set on a window that is
"frozen" due to a mini-window being resized.
** XDG support
** XDG Support
---
*** New function 'xdg-state-home'.
@ -4387,7 +4404,7 @@ This holds the value of the previous call to 'set-locale-environment'.
This macro can be used to change the locale temporarily while
executing code.
** table.el
** Table
---
*** New user option 'table-latex-environment'.
@ -4413,8 +4430,8 @@ local variables and removes overlays and text properties.
+++
** 'kill-all-local-variables' can now kill all local variables.
If given the new optional KILL-PERMANENT argument, also kill permanent
local variables.
If given the new optional KILL-PERMANENT argument, it also kills
permanent local variables.
+++
** Third 'mapconcat' argument SEPARATOR is now optional.
@ -4432,7 +4449,7 @@ This macro allows defining keymap variables more conveniently.
Use ':repeat t' to have all bindings be repeatable or for more
advanced usage:
':repeat (:enter (commands ...) :exit (commands ...))'
:repeat (:enter (commands ...) :exit (commands ...))
---
** 'kbd' can now be used in built-in, preloaded libraries.
@ -4473,7 +4490,7 @@ an exact match, then the lowercased '[menu-bar foo\ bar]' and finally
'[menu-bar foo-bar]'. This further improves backwards-compatibility
when converting menus to use 'easy-menu-define'.
** xwidgets
** Xwidget
+++
*** The function 'make-xwidget' now accepts an optional RELATED argument.
@ -4525,7 +4542,7 @@ commits to the load.
+++
*** New event type 'xwidget-display-event'.
These events are sent whenever an xwidget requests that Emacs display
These events are sent whenever an xwidget requests that Emacs displays
another xwidget. The only arguments to this event are the xwidget
that should be displayed, and the xwidget that asked to display it.
@ -4550,10 +4567,10 @@ temporary transition aid for Emacs 27, has served its purpose.
'(encode-time (list SECOND MINUTE HOUR DAY MONTH YEAR nil -1 nil))'.
+++
** 'date-to-time' now accepts arguments that lacks month, day, or time.
** 'date-to-time' now accepts arguments that lack month, day, or time.
The function now assumes the earliest possible values if its argument
lacks month, day, or time. For example, (date-to-time "2021-12-04")
now assumes a time of 00:00 instead of signaling an error.
now assumes a time of "00:00" instead of signaling an error.
+++
** 'format-seconds' now allows suppressing zero-value trailing elements.
@ -4562,7 +4579,7 @@ elements that appear after "%x".
+++
** New events for taking advantage of touchscreen devices.
The events 'touchscreen-begin, 'touchscreen-update', and
The events 'touchscreen-begin', 'touchscreen-update', and
'touchscreen-end' have been added to take better advantage of
touch-capable display panels.
@ -4596,7 +4613,7 @@ Use 'indian-tml-itrans-digits-v5-hash' if you want digits
translation.
+++
** 'shell-quote-argument' has a new optional parameter POSIX.
** 'shell-quote-argument' has a new optional argument POSIX.
This is useful when quoting shell arguments for a remote shell
invocation. Such shells are POSIX conformant by default.
@ -4713,7 +4730,7 @@ has built-in support for displaying BMP images.
---
*** GUI Yes/No dialogs now include a "Cancel" button.
The "Cancel" button is in addition to "Yes" and "No", and is intended
to allow users to quit the dialog, as an equivalent of C-g when Emacs
to allow users to quit the dialog, as an equivalent of 'C-g' when Emacs
asks a yes/no question via the echo area. This is controlled by the
new variable 'w32-yes-no-dialog-show-cancel', by default t. Set it to
nil to get back the old behavior of showing a modal dialog with only

View file

@ -201,18 +201,18 @@ LIBRESOLV=@LIBRESOLV@
## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
LIBS_MAIL=@LIBS_MAIL@
## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
CLOCK_TIME_LIB = @CLOCK_TIME_LIB@
## empty or -lbcrypt or -ladvapi32
LIB_GETRANDOM = @LIB_GETRANDOM@
GETRANDOM_LIB = @GETRANDOM_LIB@
## Whatever libraries are needed for euidaccess
LIB_EACCESS=@LIB_EACCESS@
EUIDACCESS_LIBGEN=@EUIDACCESS_LIBGEN@
## Libraries needed for file_has_acl
LIB_HAS_ACL=@LIB_HAS_ACL@
FILE_HAS_ACL_LIB=@FILE_HAS_ACL_LIB@
## empty or -lwsock2 for MinGW
LIB_WSOCK32=@LIB_WSOCK32@
## Extra libraries for etags
LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM)
LIBS_ETAGS = $(CLOCK_TIME_LIB) $(GETRANDOM_LIB)
HAVE_SECCOMP=@HAVE_SECCOMP@
HAVE_LIBSECCOMP=@HAVE_LIBSECCOMP@
@ -434,12 +434,14 @@ pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
$(NTLIB) $(LOADLIBES) \
$(LIB_WSOCK32) $(LIB_EACCESS) $(LIB_HAS_ACL) $(LIBS_ECLIENT) -o $@
$(LIB_WSOCK32) $(EUIDACCESS_LIBGEN) \
$(FILE_HAS_ACL_LIB) $(LIBS_ECLIENT) \
-o $@
emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \
$(LOADLIBES) \
$(LIB_WSOCK32) $(LIB_EACCESS) $(LIBS_ECLIENT) -o $@
$(LIB_WSOCK32) $(EUIDACCESS_LIBGEN) $(LIBS_ECLIENT) -o $@
be-resources: ${srcdir}/be_resources.cc ${config_h}
$(AM_V_CXXLD)$(CXX) ${ALL_CXXFLAGS} ${HAIKU_LIBS} $< -o $@

View file

@ -1,7 +1,7 @@
/* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software
Foundation, Inc.
Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -32,7 +32,7 @@
/* This file defines two types of attributes:
* C2x standard attributes. These have macro names that do not begin with
* C23 standard attributes. These have macro names that do not begin with
'ATTRIBUTE_'.
* Selected GCC attributes; see:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html

View file

@ -1,6 +1,5 @@
/* Binary mode I/O.
Copyright (C) 2001, 2003, 2005, 2008-2023 Free Software Foundation,
Inc.
Copyright (C) 2001, 2003, 2005, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -5,8 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
Copyright (C) 2000-2003, 2006, 2008-2023 Free Software Foundation,
Inc.
Copyright (C) 2000-2003, 2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,6 +1,5 @@
/* c-strcasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,6 +1,5 @@
/* c-strncasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Read symbolic links into a buffer without size limitation, relative to fd.
Copyright (C) 2001, 2003-2004, 2007, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 2001, 2003-2004, 2007, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* cloexec.c - set or clear the close-on-exec descriptor flag
Copyright (C) 1991, 2004-2006, 2009-2023 Free Software Foundation,
Inc.
Copyright (C) 1991, 2004-2006, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* Close a stream, with nicer error checking than fclose's.
Copyright (C) 1998-2002, 2004, 2006-2023 Free Software Foundation,
Inc.
Copyright (C) 1998-2002, 2004, 2006-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/* Analyze differences between two vectors.
Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2023 Free
Software Foundation, Inc.
Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2023 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,6 @@
/* Duplicate an open file descriptor to a specified file descriptor.
Copyright (C) 1999, 2004-2007, 2009-2023 Free Software Foundation,
Inc.
Copyright (C) 1999, 2004-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -81,9 +81,10 @@ acl_nfs4_nontrivial (uint32_t *xattr, ssize_t nbytes)
uint32_t flag = ntohl (xattr[1]);
uint32_t wholen = ntohl (xattr[3]);
xattr += 4;
int64_t wholen4 = wholen;
wholen4 = ((wholen4 + (BYTES_PER_NETWORK_UINT))
& ~ (BYTES_PER_NETWORK_UINT - 1));
int whowords = (wholen / BYTES_PER_NETWORK_UINT
+ (wholen % BYTES_PER_NETWORK_UINT != 0));
int64_t wholen4 = whowords;
wholen4 *= BYTES_PER_NETWORK_UINT;
/* Trivial ACLs have only ACE4_ACCESS_ALLOWED_ACE_TYPE or
ACE4_ACCESS_DENIED_ACE_TYPE. */
@ -115,7 +116,7 @@ acl_nfs4_nontrivial (uint32_t *xattr, ssize_t nbytes)
return 1;
ace_found |= ace_found_bit;
xattr = (uint32_t *) ((char *) xattr + wholen4);
xattr += whowords;
}
return 0;

View file

@ -1,7 +1,7 @@
/* Make a string describing file modes.
Copyright (C) 1998-1999, 2003, 2006, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1998-1999, 2003, 2006, 2009-2023 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/* fpending.c -- return the number of pending output bytes on a stream
Copyright (C) 2000, 2004, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 2000, 2004, 2006-2007, 2009-2023 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/* Declare __fpending.
Copyright (C) 2000, 2003, 2005-2006, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 2000, 2003, 2005-2006, 2009-2023 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/* fsusage.c -- return space usage of mounted file systems
Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2023 Free
Software Foundation, Inc.
Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* provide consistent interface to getgroups for systems that don't allow N==0
Copyright (C) 1996, 1999, 2003, 2006-2023 Free Software Foundation,
Inc.
Copyright (C) 1996, 1999, 2003, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Get the system load averages.
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2023 Free
Software Foundation, Inc.
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2023 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with gnulib.
Bugs can be reported to bug-gnulib@gnu.org.

View file

@ -1,6 +1,6 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free
Software Foundation, Inc.
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* gettime -- get the system clock
Copyright (C) 2002, 2004-2007, 2009-2023 Free Software Foundation,
Inc.
Copyright (C) 2002, 2004-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
Copyright (C) 2001-2003, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 2001-2003, 2005-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -204,6 +204,7 @@ CFLAGS_SOUND = @CFLAGS_SOUND@
CHECK_STRUCTS = @CHECK_STRUCTS@
CLIENTRES = @CLIENTRES@
CLIENTW = @CLIENTW@
CLOCK_TIME_LIB = @CLOCK_TIME_LIB@
CM_OBJ = @CM_OBJ@
COM_ERRLIB = @COM_ERRLIB@
CPP = @CPP@
@ -238,8 +239,10 @@ ENOLINK_VALUE = @ENOLINK_VALUE@
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
ERRNO_H = @ERRNO_H@
EUIDACCESS_LIBGEN = @EUIDACCESS_LIBGEN@
EXECINFO_H = @EXECINFO_H@
EXEEXT = @EXEEXT@
FILE_HAS_ACL_LIB = @FILE_HAS_ACL_LIB@
FIND_DELETE = @FIND_DELETE@
FIRSTFILE_OBJ = @FIRSTFILE_OBJ@
FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
@ -253,6 +256,7 @@ GETADDRINFO_A_LIBS = @GETADDRINFO_A_LIBS@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
GETOPT_H = @GETOPT_H@
GETRANDOM_LIB = @GETRANDOM_LIB@
GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
@ -675,6 +679,7 @@ HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
HAVE_DECL_GETW = @HAVE_DECL_GETW@
HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
@ -683,6 +688,7 @@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
HAVE_DECL_POSIX_SPAWN_SETSID = @HAVE_DECL_POSIX_SPAWN_SETSID@
HAVE_DECL_PUTW = @HAVE_DECL_PUTW@
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
@ -937,7 +943,6 @@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_EACCESS = @LIB_EACCESS@
LIB_EXECINFO = @LIB_EXECINFO@
LIB_GETRANDOM = @LIB_GETRANDOM@
LIB_HAS_ACL = @LIB_HAS_ACL@
LIB_MATH = @LIB_MATH@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
LIB_PTHREAD = @LIB_PTHREAD@
@ -957,6 +962,7 @@ MKDIR_P = @MKDIR_P@
MODULES_OBJ = @MODULES_OBJ@
MODULES_SECONDARY_SUFFIX = @MODULES_SECONDARY_SUFFIX@
MODULES_SUFFIX = @MODULES_SUFFIX@
NANOSLEEP_LIB = @NANOSLEEP_LIB@
NATIVE_COMPILATION_AOT = @NATIVE_COMPILATION_AOT@
NEXT_ASSERT_H = @NEXT_ASSERT_H@
NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
@ -1033,6 +1039,7 @@ PRE_ALLOC_OBJ = @PRE_ALLOC_OBJ@
PRIPTR_PREFIX = @PRIPTR_PREFIX@
PROFILING_CFLAGS = @PROFILING_CFLAGS@
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTHREAD_SIGMASK_LIB = @PTHREAD_SIGMASK_LIB@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RALLOC_OBJ = @RALLOC_OBJ@
RANLIB = @RANLIB@
@ -1220,6 +1227,7 @@ SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
SYSTEM_TYPE = @SYSTEM_TYPE@
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
TERMCAP_OBJ = @TERMCAP_OBJ@
TIMER_TIME_LIB = @TIMER_TIME_LIB@
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
TOOLKIT_LIBW = @TOOLKIT_LIBW@
@ -3104,7 +3112,9 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_GETW''@|$(HAVE_DECL_GETW)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_PUTW''@|$(HAVE_DECL_PUTW)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \

View file

@ -1,7 +1,7 @@
/* group-member.c -- determine whether group id is in calling user's group list
Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2023 Free
Software Foundation, Inc.
Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2023 Free Software
Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -99,7 +99,7 @@
# endif
#endif
/* Macros specified by C2x and by ISO/IEC TS 18661-1:2014. */
/* Macros specified by C23 and by ISO/IEC TS 18661-1:2014. */
#if (! defined ULLONG_WIDTH \
&& (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__ \
@ -117,7 +117,7 @@
# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
#endif
/* Macros specified by C2x. */
/* Macros specified by C23. */
#if (! defined BOOL_WIDTH \
&& (defined _GNU_SOURCE \

View file

@ -1,7 +1,6 @@
/* malloc() function that is glibc compatible.
Copyright (C) 1997-1998, 2006-2007, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1997-1998, 2006-2007, 2009-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2023 Free
Software Foundation, Inc.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2023 Free
Software Foundation, Inc.
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
/* Declaration of functions and data types used for MD5 sum computing
library functions.
Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2023 Free
Software Foundation, Inc.
Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,5 +1,5 @@
/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2023 Free
Software Foundation, Inc.
/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2023 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
/* memrchr -- find the last occurrence of a byte in a memory block
Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2023 Free
Software Foundation, Inc.
Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2023 Free Software
Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and

View file

@ -1,5 +1,5 @@
/* Erase sensitive data from memory.
Copyright 2022 Free Software Foundation, Inc.
Copyright 2022-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* Provide a replacement for the POSIX nanosleep function.
Copyright (C) 1999-2000, 2002, 2004-2023 Free Software Foundation,
Inc.
Copyright (C) 1999-2000, 2002, 2004-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Save and restore current working directory.
Copyright (C) 1995, 1997-1998, 2003, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1995, 1997-1998, 2003, 2009-2023 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,8 +1,7 @@
/* sha1.c - Functions to compute SHA1 message digest of files or
memory blocks according to the NIST specification FIPS-180-1.
Copyright (C) 2000-2001, 2003-2006, 2008-2023 Free Software
Foundation, Inc.
Copyright (C) 2000-2001, 2003-2006, 2008-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,6 @@
/* sig2str.c -- convert between signal names and numbers
Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation,
Inc.
Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -951,9 +951,13 @@ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
# endif
_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
# else
# if @HAVE_DECL_GETW@
_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
# endif
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getw);
# endif
#endif
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
@ -1190,9 +1194,13 @@ _GL_CXXALIASWARN (puts);
# endif
_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
# else
# if @HAVE_DECL_PUTW@
_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
# endif
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (putw);
# endif
#endif
#if @GNULIB_REMOVE@

View file

@ -1,7 +1,6 @@
/* A GNU-like <stdlib.h>.
Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation,
Inc.
Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -59,10 +59,11 @@
# include <unistd.h>
#endif
/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */
/* AIX 7.2 and Android 13 declare ffsl and ffsll in <strings.h>, not in
<string.h>. */
/* But in any case avoid namespace pollution on glibc systems. */
#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
&& defined _AIX) \
&& (defined _AIX || defined __ANDROID__)) \
&& ! defined __GLIBC__
# include <strings.h>
#endif
@ -82,7 +83,14 @@
can be freed via 'free'; it can be used only after declaring 'free'. */
/* Applies to: functions. Cannot be used on inline functions. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
# if defined __cplusplus && defined __GNUC__ && !defined __clang__
/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
# define _GL_ATTRIBUTE_DEALLOC_FREE \
_GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
# else
# define _GL_ATTRIBUTE_DEALLOC_FREE \
_GL_ATTRIBUTE_DEALLOC (free, 1)
# endif
#endif
/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
@ -336,7 +344,7 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr,
|| defined __clang__)
_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ());
# else
# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (memrchr);
# endif
#elif defined GNULIB_POSIXCHECK
@ -491,7 +499,7 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul,
_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
_GL_CXXALIASWARN1 (strchrnul, char const *,
(char const *__s, int __c_in) throw ());
# else
# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (strchrnul);
# endif
#elif defined GNULIB_POSIXCHECK
@ -856,7 +864,7 @@ _GL_CXXALIASWARN1 (strcasestr, char *,
(char *haystack, const char *needle) throw ());
_GL_CXXALIASWARN1 (strcasestr, const char *,
(const char *haystack, const char *needle) throw ());
# else
# elif __GLIBC__ >= 2
_GL_CXXALIASWARN (strcasestr);
# endif
#elif defined GNULIB_POSIXCHECK

View file

@ -1,7 +1,7 @@
/* Convert string representation of a number into an intmax_t value.
Copyright (C) 1999, 2001-2004, 2006, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1999, 2001-2004, 2006, 2009-2023 Free Software Foundation,
Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -1,7 +1,7 @@
/* Convert string representation of a number into an integer value.
Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2023 Free
Software Foundation, Inc.
Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2023 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@gnu.org.

View file

@ -1,6 +1,6 @@
/* Function to parse a 'long long int' from text.
Copyright (C) 1995-1997, 1999, 2001, 2009-2023 Free Software
Foundation, Inc.
Copyright (C) 1995-1997, 1999, 2001, 2009-2023 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
This file is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,6 @@
/* Reentrant time functions like localtime_r.
Copyright (C) 2003, 2006-2007, 2010-2023 Free Software Foundation,
Inc.
Copyright (C) 2003, 2006-2007, 2010-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -223,8 +223,15 @@ template <int w>
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
#ifdef _GL_STATIC_ASSERT_H
# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
# define _Static_assert(R, ...) \
_GL_VERIFY ((R), "static assertion failed", -)
# if !defined _MSC_VER || defined __clang__
# define _Static_assert(...) \
_GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
# else
/* Work around MSVC preprocessor incompatibility with ISO C; see
<https://stackoverflow.com/questions/5134523/>. */
# define _Static_assert(R, ...) \
_GL_VERIFY ((R), "static assertion failed", -)
# endif
# endif
# if (!defined static_assert \
&& __STDC_VERSION__ < 202311 \
@ -235,9 +242,8 @@ template <int w>
/* MSVC 14 in C++ mode supports the two-arguments static_assert but not
the one-argument static_assert, and it does not support _Static_assert.
We have to play preprocessor tricks to distinguish the two cases.
Since the MSVC preprocessor is not ISO C compliant (cf.
<https://stackoverflow.com/questions/5134523/>), the solution is specific
to MSVC. */
Since the MSVC preprocessor is not ISO C compliant (see above),.
the solution is specific to MSVC. */
# define _GL_EXPAND(x) x
# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
# define _GL_SA2 static_assert

View file

@ -1,7 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software
Foundation, Inc.
Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as

View file

@ -129,7 +129,7 @@ well as variants like \"2008W32\" (week number) and
See `decode-time' for the meaning of FORM."
(if (not (iso8601-valid-p string))
(signal 'wrong-type-argument string)
(signal 'wrong-type-argument (list string))
(let* ((date-string (match-string 1 string))
(time-string (match-string 2 string))
(zone-string (match-string 3 string))
@ -217,7 +217,7 @@ See `decode-time' for the meaning of FORM."
((iso8601--match "---\\([0-9][0-9]\\)" string)
(iso8601--decoded-time :day (string-to-number (match-string 1 string))))
(t
(signal 'wrong-type-argument string))))
(signal 'wrong-type-argument (list string)))))
(defun iso8601-parse-time (string &optional form)
"Parse STRING, which should be an ISO 8601 time string.
@ -226,11 +226,11 @@ hour/minute/seconds/zone fields filled in.
See `decode-time' for the meaning of FORM."
(if (not (iso8601--match iso8601--full-time-match string))
(signal 'wrong-type-argument string)
(signal 'wrong-type-argument (list string))
(let ((time (match-string 1 string))
(zone (match-string 2 string)))
(if (not (iso8601--match iso8601--time-match time))
(signal 'wrong-type-argument string)
(signal 'wrong-type-argument (list string))
(let ((hour (string-to-number (match-string 1 time)))
(minute (and (match-string 2 time)
(string-to-number (match-string 2 time))))
@ -274,7 +274,7 @@ See `decode-time' for the meaning of FORM."
"Parse STRING, which should be an ISO 8601 time zone.
Return the number of minutes."
(if (not (iso8601--match iso8601--zone-match string))
(signal 'wrong-type-argument string)
(signal 'wrong-type-argument (list string))
(if (match-string 2 string)
;; HH:MM-ish.
(let ((hour (string-to-number (match-string 3 string)))
@ -314,14 +314,14 @@ Return the number of minutes."
((iso8601--match iso8601--duration-combined-match string)
(iso8601-parse (substring string 1)))
(t
(signal 'wrong-type-argument string))))
(signal 'wrong-type-argument (list string)))))
(defun iso8601-parse-interval (string)
"Parse ISO 8601 intervals."
(let ((bits (split-string string "/"))
start end duration)
(if (not (= (length bits) 2))
(signal 'wrong-type-argument string)
(signal 'wrong-type-argument (list string))
;; The intervals may be an explicit start/end times, or either a
;; start or an end, and an accompanying duration.
(cond
@ -338,7 +338,7 @@ Return the number of minutes."
(setq start (iso8601-parse (car bits))
end (iso8601-parse (cadr bits))))
(t
(signal 'wrong-type-argument string))))
(signal 'wrong-type-argument (list string)))))
(unless end
(setq end (decoded-time-add start duration)))
(unless start

View file

@ -44,7 +44,9 @@ those hits returned.")
(defvar semantic-symref-filepattern-alist
'((c-mode "*.[ch]")
(c-ts-mode "*.[ch]")
(c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
(c++-ts-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
(html-mode "*.html" "*.shtml" "*.php")
(mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove
; duplication of
@ -53,7 +55,10 @@ those hits returned.")
; major mode definition?
(ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
"Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
(ruby-ts-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
"Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
(python-mode "*.py" "*.pyi" "*.pyw")
(python-ts-mode "*.py" "*.pyi" "*.pyw")
(perl-mode "*.pl" "*.PL")
(cperl-mode "*.pl" "*.PL")
(lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs")

View file

@ -816,7 +816,7 @@ otherwise."
(defun dired-x--string-to-number (str)
"Like `string-to-number' but recognize a trailing unit prefix.
For example, 2K is expanded to 2048.0. The caller should make
sure that a trailing letter in STR is one of BKkMGTPEZY."
sure that a trailing letter in STR is one of BKkMGTPEZYRQ."
(let* ((val (string-to-number str))
(u (unless (zerop val)
(aref str (1- (length str))))))
@ -831,7 +831,7 @@ sure that a trailing letter in STR is one of BKkMGTPEZY."
(when (and u (> u ?9))
(when (= u ?k)
(setq u ?K))
(let ((units '(?B ?K ?M ?G ?T ?P ?E ?Z ?Y)))
(let ((units '(?B ?K ?M ?G ?T ?P ?E ?Z ?Y ?R ?Q)))
(while (and units (/= (pop units) u))
(setq val (* 1024.0 val)))))
val)))
@ -904,7 +904,7 @@ only in the active region if `dired-mark-region' is non-nil."
;; GNU ls -hs suffixes the block count with a unit and
;; prints it as a float, FreeBSD does neither.
(dired-re-inode-size "\\=\\s *\\([0-9]+\\s +\\)?\
\\(?:\\([0-9]+\\(?:\\.[0-9]*\\)?[BkKMGTPEZY]?\\)? ?\\)"))
\\(?:\\([0-9]+\\(?:\\.[0-9]*\\)?[BkKMGTPEZYRQ]?\\)? ?\\)"))
(beginning-of-line)
(forward-char 2)
(search-forward-regexp dired-re-inode-size nil t)

View file

@ -530,7 +530,7 @@ The directory name must be absolute, but need not be fully expanded.")
(put 'dired-actual-switches 'safe-local-variable 'dired-safe-switches-p)
(defvar dired-re-inode-size "[0-9 \t]*[.,0-9]*[BkKMGTPEZY]?[ \t]*"
(defvar dired-re-inode-size "[0-9 \t]*[.,0-9]*[BkKMGTPEZYRQ]?[ \t]*"
"Regexp for optional initial inode and file size as made by `ls -i -s'.")
;; These regexps must be tested at beginning-of-line, but are also

View file

@ -262,7 +262,8 @@ This is used by `declare'.")
(interactive-form nil)
(warnings nil)
(warn #'(lambda (msg form)
(push (macroexp-warn-and-return msg nil nil t form)
(push (macroexp-warn-and-return
(format-message msg) nil nil t form)
warnings))))
(while
(and body
@ -679,11 +680,11 @@ Otherwise, return nil. For internal use only."
;; This is called from lread.c and therefore needs to be preloaded.
(if lread--unescaped-character-literals
(let ((sorted (sort lread--unescaped-character-literals #'<)))
(format-message "unescaped character literals %s detected, %s expected!"
(mapconcat (lambda (char) (format "`?%c'" char))
sorted ", ")
(mapconcat (lambda (char) (format "`?\\%c'" char))
sorted ", ")))))
(format "unescaped character literals %s detected, %s expected!"
(mapconcat (lambda (char) (format-message "`?%c'" char))
sorted ", ")
(mapconcat (lambda (char) (format-message "`?\\%c'" char))
sorted ", ")))))
(defun byte-compile-info (string &optional message type)
"Format STRING in a way that looks pleasing in the compilation output.

View file

@ -554,7 +554,7 @@ Return the compile-time value of FORM."
,(macroexpand-all `(progn ,@body)
macroexpand-all-environment)))
(macroexp-warn-and-return
"`with-suppressed-warnings' with empty body"
(format-message "`with-suppressed-warnings' with empty body")
nil '(empty-body with-suppressed-warnings) t warnings)))))
"The default macro-environment passed to macroexpand by the compiler.
Placing a macro here will cause a macro to have different semantics when
@ -3445,7 +3445,7 @@ lambda-expression."
(t "."))))
(if (eq (car-safe (symbol-function (car form))) 'macro)
(byte-compile-report-error
(format "`%s' defined after use in %S (missing `require' of a library file?)"
(format-message "`%s' defined after use in %S (missing `require' of a library file?)"
(car form) form)))
(if (and handler
;; Make sure that function exists.
@ -5524,8 +5524,8 @@ and corresponding effects."
(defun bytecomp--warn-dodgy-eq-arg (form type parenthesis)
(macroexp-warn-and-return
(format "`%s' called with literal %s that may never match (%s)"
(car form) type parenthesis)
(format-message "`%s' called with literal %s that may never match (%s)"
(car form) type parenthesis)
form (list 'suspicious (car form)) t))
(defun bytecomp--check-eq-args (form &optional a b &rest _ignore)

View file

@ -236,9 +236,9 @@ Returns a form where all lambdas don't have any free variables."
(not (intern-soft var))
(eq ?_ (aref (symbol-name var) 0)))
(let ((suggestions (help-uni-confusable-suggestions (symbol-name var))))
(format "Unused lexical %s `%S'%s"
varkind (bare-symbol var)
(if suggestions (concat "\n " suggestions) "")))))
(format-message "Unused lexical %s `%S'%s"
varkind (bare-symbol var)
(if suggestions (concat "\n " suggestions) "")))))
(define-inline cconv--var-classification (binder form)
(inline-quote

View file

@ -201,7 +201,7 @@ should return.
Note that Emacs Lisp doesn't really support multiple values, so
all this function does is return LIST."
(unless (listp list)
(signal 'wrong-type-argument list))
(signal 'wrong-type-argument (list list)))
list)
(defsubst cl-multiple-value-list (expression)

View file

@ -3176,8 +3176,9 @@ To see the documentation for a defined struct type, use
(when (cl-oddp (length desc))
(push
(macroexp-warn-and-return
(format "Missing value for option `%S' of slot `%s' in struct %s!"
(car (last desc)) slot name)
(format-message
"Missing value for option `%S' of slot `%s' in struct %s!"
(car (last desc)) slot name)
nil nil nil (car (last desc)))
forms)
(when (and (keywordp (car defaults))
@ -3185,8 +3186,9 @@ To see the documentation for a defined struct type, use
(let ((kw (car defaults)))
(push
(macroexp-warn-and-return
(format " I'll take `%s' to be an option rather than a default value."
kw)
(format-message
" I'll take `%s' to be an option rather than a default value."
kw)
nil nil nil kw)
forms)
(push kw desc)

View file

@ -1220,7 +1220,7 @@ clashes."
(defun comp-decrypt-arg-list (x function-name)
"Decrypt argument list X for FUNCTION-NAME."
(unless (fixnump x)
(signal 'native-compiler-error-dyn-func function-name))
(signal 'native-compiler-error-dyn-func (list function-name)))
(let ((rest (not (= (logand x 128) 0)))
(mandatory (logand x 127))
(nonrest (ash x -8)))
@ -1264,7 +1264,7 @@ clashes."
'pure))))
(when (byte-code-function-p f)
(signal 'native-compiler-error
"can't native compile an already byte-compiled function"))
'("can't native compile an already byte-compiled function")))
(setf (comp-func-byte-func func)
(byte-compile (comp-func-name func)))
(let ((lap (byte-to-native-lambda-lap
@ -1288,7 +1288,7 @@ clashes."
"Byte-compile FORM, spilling data from the byte compiler."
(unless (eq (car-safe form) 'lambda)
(signal 'native-compiler-error
"Cannot native-compile, form is not a lambda"))
'("Cannot native-compile, form is not a lambda")))
(unless (comp-ctxt-output comp-ctxt)
(setf (comp-ctxt-output comp-ctxt)
(make-temp-file "comp-lambda-" nil ".eln")))
@ -1369,7 +1369,7 @@ clashes."
(alist-get 'no-native-compile byte-native-qualities))
(throw 'no-native-compile nil))
(unless byte-to-native-top-level-forms
(signal 'native-compiler-error-empty-byte filename))
(signal 'native-compiler-error-empty-byte (list filename)))
(unless (comp-ctxt-output comp-ctxt)
(setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
filename
@ -1740,7 +1740,7 @@ Return value is the fall-through block name."
do (puthash ff-bb-name ff-bb (comp-func-blocks comp-func))
(setf (comp-limplify-curr-block comp-pass) ff-bb))))
(_ (signal 'native-ice
"missing previous setimm while creating a switch"))))
'("missing previous setimm while creating a switch")))))
(defun comp-emit-set-call-subr (subr-name sp-delta)
"Emit a call for SUBR-NAME.
@ -2823,7 +2823,7 @@ blocks."
(first-processed (l)
(if-let ((p (cl-find-if (lambda (p) (comp-block-idom p)) l)))
p
(signal 'native-ice "can't find first preprocessed"))))
(signal 'native-ice '("can't find first preprocessed")))))
(when-let ((blocks (comp-func-blocks comp-func))
(entry (gethash 'entry blocks))
@ -3721,7 +3721,7 @@ Prepare every function for final compilation and drive the C back-end."
(progn
(delete-file temp-file)
output)
(signal 'native-compiler-error (buffer-string)))
(signal 'native-compiler-error (list (buffer-string))))
(comp-log-to-buffer (buffer-string))))))))

View file

@ -250,7 +250,8 @@ INIT-VALUE LIGHTER KEYMAP.
(warnwrap (if (or (null body) (keywordp (car body))) #'identity
(lambda (exp)
(macroexp-warn-and-return
"Use keywords rather than deprecated positional arguments to `define-minor-mode'"
(format-message
"Use keywords rather than deprecated positional arguments to `define-minor-mode'")
exp))))
keyw keymap-sym tmp)

View file

@ -184,8 +184,9 @@ and reference them using the function `class-option'."
(when (and initarg (eq alloc :class))
(push
(cons sname
(format "Meaningless :initarg for class allocated slot '%S'"
sname))
(format-message
"Meaningless :initarg for class allocated slot `%S'"
sname))
warnings))
(let ((init (plist-get soptions :initform)))

View file

@ -291,10 +291,11 @@ It should normally be a symbol with position and it defaults to FORM."
(setq arglist (cdr arglist)))
(if values
(macroexp-warn-and-return
(format (if (eq values 'too-few)
"attempt to open-code `%s' with too few arguments"
"attempt to open-code `%s' with too many arguments")
name)
(format-message
(if (eq values 'too-few)
"attempt to open-code `%s' with too few arguments"
"attempt to open-code `%s' with too many arguments")
name)
form nil nil arglist)
;; The following leads to infinite recursion when loading a
@ -367,14 +368,14 @@ Assumes the caller has bound `macroexpand-all-environment'."
(if (null body)
(macroexp-unprogn
(macroexp-warn-and-return
(format "`%s' with empty body" fun)
(format-message "`%s' with empty body" fun)
nil (list 'empty-body fun) 'compile-only fun))
(macroexp--all-forms body))
(cdr form))
form)))
(`(while)
(macroexp-warn-and-return
"missing `while' condition"
(format-message "missing `while' condition")
`(signal 'wrong-number-of-arguments '(while 0))
nil 'compile-only form))
(`(setq ,(and var (pred symbolp)
@ -392,7 +393,7 @@ Assumes the caller has bound `macroexpand-all-environment'."
(let ((nargs (length args)))
(if (/= (logand nargs 1) 0)
(macroexp-warn-and-return
"odd number of arguments in `setq' form"
(format-message "odd number of arguments in `setq' form")
`(signal 'wrong-number-of-arguments '(setq ,nargs))
nil 'compile-only fn)
(let ((assignments nil))

View file

@ -947,7 +947,7 @@ Otherwise, it defers to REST which is a list of branches of the form
(let ((code (pcase--u1 matches code vars rest)))
(if (eq upat '_) code
(macroexp-warn-and-return
"Pattern t is deprecated. Use `_' instead"
(format-message "Pattern t is deprecated. Use `_' instead")
code nil nil upat))))
((eq upat 'pcase--dontcare) :pcase--dontcare)
((memq (car-safe upat) '(guard pred))

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

@ -7414,9 +7414,9 @@ files, you could say something like:
(\"src/emacs/[^/]+/\\\\(.*\\\\)\\\\\\='\" \"src/emacs/.*/\\\\1\\\\\\='\")
In this example, if you're in src/emacs/emacs-27/lisp/abbrev.el,
and you an src/emacs/emacs-28/lisp/abbrev.el file exists, it's
now defined as a sibling."
In this example, if you're in \"src/emacs/emacs-27/lisp/abbrev.el\",
and a \"src/emacs/emacs-28/lisp/abbrev.el\" file exists, it's now
defined as a sibling."
:type 'sexp
:version "29.1")
@ -7645,7 +7645,7 @@ If DIR's free space cannot be obtained, this function returns nil."
;; This avoids recognizing `1 may 1997' as a date in the line:
;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README
;; The "[BkKMGTPEZY]?" below supports "ls -alh" output.
;; The "[BkKMGTPEZYRQ]?" below supports "ls -alh" output.
;; For non-iso date formats, we add the ".*" in order to find
;; the last possible match. This avoids recognizing
@ -7657,8 +7657,8 @@ If DIR's free space cannot be obtained, this function returns nil."
;; parentheses:
;; -rw-r--r-- (modified) 2005-10-22 21:25 files.el
;; This is not supported yet.
(purecopy (concat "\\([0-9][BkKMGTPEZY]? " iso
"\\|.*[0-9][BkKMGTPEZY]? "
(purecopy (concat "\\([0-9][BkKMGTPEZYRQ]? " iso
"\\|.*[0-9][BkKMGTPEZYRQ]? "
"\\(" western "\\|" western-comma
"\\|" DD-MMM-YYYY "\\|" east-asian "\\)"
"\\) +")))

View file

@ -2073,6 +2073,12 @@ as the constructs of Haddock, Javadoc and similar systems."
"Font Lock mode face used to highlight preprocessor directives."
:group 'font-lock-faces)
(defface font-lock-regexp-face
'((t :inherit font-lock-string-face))
"Font Lock mode face used to highlight regexp literals."
:group 'font-lock-faces
:version "29.1")
(defface font-lock-regexp-grouping-backslash
'((t :inherit bold))
"Font Lock mode face for backslashes in Lisp regexp grouping constructs."

View file

@ -444,7 +444,7 @@ type if we can't otherwise guess it."
(require 'image-converter)
(image-convert-p source))))))
(unless type
(signal 'unknown-image-type "Cannot determine image type")))
(signal 'unknown-image-type '("Cannot determine image type"))))
(when (and (not (eq type 'image-convert))
(not (memq type (and (boundp 'image-types) image-types))))
(error "Invalid image type `%s'" type))

View file

@ -151,7 +151,7 @@ If the orientation isn't present in the data, return nil."
(defun exif--parse-jpeg ()
(unless (= (exif--read-number-be 2) #xffd8) ; SOI (start of image)
(signal 'exif-error "Not a valid JPEG file"))
(signal 'exif-error '("Not a valid JPEG file")))
(cl-loop for segment = (exif--read-number-be 2)
for size = (exif--read-number-be 2)
;; Stop parsing when we get to SOS (start of stream);
@ -168,7 +168,7 @@ If the orientation isn't present in the data, return nil."
;; The Exif data is in the APP1 JPEG chunk and starts with
;; "Exif\0\0".
(unless (equal (exif--read-chunk 6) (string ?E ?x ?i ?f ?\0 ?\0))
(signal 'exif-error "Not a valid Exif chunk"))
(signal 'exif-error '("Not a valid Exif chunk")))
(delete-region (point-min) (point))
(let* ((endian-marker (exif--read-chunk 2))
(le (cond
@ -180,14 +180,15 @@ If the orientation isn't present in the data, return nil."
t)
(t
(signal 'exif-error
(format "Invalid endian-ness %s" endian-marker))))))
(list (format "Invalid endian-ness %s"
endian-marker)))))))
;; Another magical number.
(unless (= (exif--read-number 2 le) #x002a)
(signal 'exif-error "Invalid TIFF header length"))
(signal 'exif-error '("Invalid TIFF header length")))
(let ((offset (exif--read-number 4 le)))
;; Jump to where the IFD (directory) starts and parse it.
(when (> (1+ offset) (point-max))
(signal 'exif-error "Invalid IFD (directory) offset"))
(signal 'exif-error '("Invalid IFD (directory) offset")))
(goto-char (1+ offset))
(exif--parse-directory le)))))
@ -230,7 +231,7 @@ If the orientation isn't present in the data, return nil."
(when (> (+ (1+ value) length)
(point-max))
(signal 'exif-error
"Premature end of file"))
'("Premature end of file")))
(buffer-substring
(1+ value)
(+ (1+ value) length)))
@ -248,7 +249,7 @@ If the orientation isn't present in the data, return nil."
;; keep parsing.
(progn
(when (> (1+ next) (point-max))
(signal 'exif-error "Invalid IFD (directory) next-offset"))
(signal 'exif-error '("Invalid IFD (directory) next-offset")))
(goto-char (1+ next))
(nconc dir (exif--parse-directory le)))
;; We've reached the end of the directories.
@ -283,7 +284,7 @@ VALUE is an integer representing BYTES characters."
(defun exif--read-chunk (bytes)
"Return BYTES octets from the buffer and advance point that much."
(when (> (+ (point) bytes) (point-max))
(signal 'exif-error "Premature end of file"))
(signal 'exif-error '("Premature end of file")))
(prog1
(buffer-substring (point) (+ (point) bytes))
(forward-char bytes)))
@ -292,7 +293,7 @@ VALUE is an integer representing BYTES characters."
"Read BYTES octets from the buffer as a chunk of big-endian bytes.
Advance point to after the read bytes."
(when (> (+ (point) bytes) (point-max))
(signal 'exif-error "Premature end of file"))
(signal 'exif-error '("Premature end of file")))
(let ((sum 0))
(dotimes (_ bytes)
(setq sum (+ (* sum 256) (following-char)))
@ -303,7 +304,7 @@ Advance point to after the read bytes."
"Read BYTES octets from the buffer as a chunk of low-endian bytes.
Advance point to after the read bytes."
(when (> (+ (point) bytes) (point-max))
(signal 'exif-error "Premature end of file"))
(signal 'exif-error '("Premature end of file")))
(let ((sum 0))
(dotimes (i bytes)
(setq sum (+ (* (following-char) (expt 256 i)) sum))

View file

@ -71,14 +71,14 @@ It is used for TCP/IP devices."
"Regexp for date time format in ls output."))
(defconst tramp-adb-ls-date-regexp
(tramp-compat-rx
(rx
blank (regexp tramp-adb-ls-date-year-regexp)
blank (regexp tramp-adb-ls-date-time-regexp)
blank)
"Regexp for date format in ls output.")
(defconst tramp-adb-ls-toolbox-regexp
(tramp-compat-rx
(rx
bol (* blank) (group (+ (any ".-" alpha))) ; \1 permissions
(? (+ blank) (+ digit)) ; links (Android 7/toybox)
(* blank) (group (+ (not blank))) ; \2 username
@ -327,8 +327,7 @@ arguments to pass to the OPERATION."
(tramp-shell-quote-argument
(tramp-compat-file-name-concat localname ".."))))
(tramp-compat-replace-regexp-in-region
(tramp-compat-rx (literal (tramp-compat-file-name-unquote
(file-name-as-directory localname))))
(rx (literal (file-name-unquote (file-name-as-directory localname))))
"" (point-min))
(widen)))
(tramp-adb-sh-fix-ls-output)
@ -366,14 +365,12 @@ Emacs dired can't find files."
(goto-char (point-min))
(while
(search-forward-regexp
(tramp-compat-rx
blank (group blank (regexp tramp-adb-ls-date-year-regexp) blank))
(rx blank (group blank (regexp tramp-adb-ls-date-year-regexp) blank))
nil t)
(replace-match "0\\1" "\\1" nil)
;; Insert missing "/".
(when (looking-at-p
(tramp-compat-rx
(regexp tramp-adb-ls-date-time-regexp) (+ blank) eol))
(rx (regexp tramp-adb-ls-date-time-regexp) (+ blank) eol))
(end-of-line)
(insert "/")))
;; Sort entries.
@ -393,12 +390,10 @@ Emacs dired can't find files."
(defun tramp-adb-ls-output-time-less-p (a b)
"Sort \"ls\" output by time, descending."
(let (time-a time-b)
;; Once we can assume Emacs 27 or later, the two calls
;; (apply #'encode-time X) can be replaced by (encode-time X).
(string-match tramp-adb-ls-date-regexp a)
(setq time-a (apply #'encode-time (parse-time-string (match-string 0 a))))
(setq time-a (encode-time (parse-time-string (match-string 0 a))))
(string-match tramp-adb-ls-date-regexp b)
(setq time-b (apply #'encode-time (parse-time-string (match-string 0 b))))
(setq time-b (encode-time (parse-time-string (match-string 0 b))))
(time-less-p time-b time-a)))
(defun tramp-adb-ls-output-name-less-p (a b)
@ -474,7 +469,7 @@ Emacs dired can't find files."
;; "adb pull ..." does not always return an error code.
(unless
(and (tramp-adb-execute-adb-command
v "pull" (tramp-compat-file-name-unquote localname) tmpfile)
v "pull" (file-name-unquote localname) tmpfile)
(file-exists-p tmpfile))
(ignore-errors (delete-file tmpfile))
(tramp-error
@ -554,8 +549,7 @@ Emacs dired can't find files."
"Moving tmp file `%s' to `%s'" tmpfile filename)
(unwind-protect
(unless (tramp-adb-execute-adb-command
v "push" tmpfile
(tramp-compat-file-name-unquote localname))
v "push" tmpfile (file-name-unquote localname))
(tramp-error v 'file-error "Cannot write: `%s'" filename))
(delete-file tmpfile)))))))
@ -570,11 +564,7 @@ Emacs dired can't find files."
(defun tramp-adb-handle-set-file-times (filename &optional time flag)
"Like `set-file-times' for Tramp files."
(tramp-skeleton-set-file-modes-times-uid-gid filename
(let ((time (if (or (null time)
(tramp-compat-time-equal-p time tramp-time-doesnt-exist)
(tramp-compat-time-equal-p time tramp-time-dont-know))
(current-time)
time))
(let ((time (tramp-defined-time time))
(nofollow (if (eq flag 'nofollow) "-h" ""))
(quoted-name (tramp-shell-quote-argument localname)))
;; Older versions of toybox 'touch' mishandle nanoseconds and/or
@ -660,8 +650,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(tramp-flush-file-properties v localname)
(unless (tramp-adb-execute-adb-command
v "push"
(tramp-compat-file-name-unquote filename)
(tramp-compat-file-name-unquote localname))
(file-name-unquote filename)
(file-name-unquote localname))
(tramp-error
v 'file-error
"Cannot copy `%s' `%s'" filename newname)))))))))
@ -727,11 +717,6 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
"Strings to return by `process-file' in case of signals."
(with-tramp-connection-property vec "signal-strings"
(let ((default-directory (tramp-make-tramp-file-name vec 'noloc))
;; `shell-file-name' and `shell-command-switch' are needed
;; for Emacs < 27.1, which doesn't support connection-local
;; variables in `shell-command'.
(shell-file-name "/system/bin/sh")
(shell-command-switch "-c")
process-file-return-signal-string signals result)
(dotimes (i 128) (push (format "Signal %d" i) result))
(setq result (reverse result)
@ -764,7 +749,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; Determine input.
(if (null infile)
(setq input (tramp-get-remote-null-device v))
(setq infile (tramp-compat-file-name-unquote (expand-file-name infile)))
(setq infile (file-name-unquote (expand-file-name infile)))
(if (tramp-equal-remote default-directory infile)
;; INFILE is on the same remote host.
(setq input (tramp-unquote-file-local-name infile))
@ -940,7 +925,7 @@ implementation will be used."
(i 0)
p)
(when (string-match-p (tramp-compat-rx multibyte) command)
(when (string-match-p (rx multibyte) command)
(tramp-error
v 'file-error "Cannot apply multi-byte command `%s'" command))
@ -1132,7 +1117,7 @@ error and non-nil on success."
(defun tramp-adb-send-command (vec command &optional neveropen nooutput)
"Send the COMMAND to connection VEC."
(if (string-match-p (tramp-compat-rx multibyte) command)
(if (string-match-p (rx multibyte) command)
;; Multibyte codepoints with four bytes are not supported at
;; least by toybox.
@ -1156,7 +1141,7 @@ error and non-nil on success."
;; We can't use stty to disable echo of command. stty is said
;; to be added to toybox 0.7.6. busybox shall have it, but this
;; isn't used any longer for Android.
(delete-matching-lines (tramp-compat-rx bol (literal command) eol))
(delete-matching-lines (rx bol (literal command) eol))
;; When the local machine is W32, there are still trailing ^M.
;; There must be a better solution by setting the correct coding
;; system, but this requires changes in core Tramp.
@ -1279,7 +1264,7 @@ connection if a previous connection has died for some reason."
;; Change prompt.
(tramp-set-connection-property
p "prompt" (tramp-compat-rx "///" (literal prompt) "#$"))
p "prompt" (rx "///" (literal prompt) "#$"))
(tramp-adb-send-command
vec (format "PS1=\"///\"\"%s\"\"#$\"" prompt))

View file

@ -110,12 +110,7 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
;; Sometimes, compilation fails with "Variable binding depth exceeds
;; max-specpdl-size". Shall be fixed in Emacs 27.
(with-no-warnings ;; max-specpdl-size
(eval-and-compile
(let ((max-specpdl-size (* 2 max-specpdl-size)))
(require 'tramp-gvfs))))
(require 'tramp-gvfs)
(autoload 'dired-uncache "dired")
(autoload 'url-tramp-convert-url-to-tramp "url-tramp")
@ -183,20 +178,9 @@ It must be supported by libarchive(3).")
;; The definition of `tramp-archive-file-name-regexp' contains calls
;; to `regexp-opt', which cannot be autoloaded while loading
;; loaddefs.el. So we use a macro, which is evaluated only when needed.
;; Emacs 26 and earlier cannot use the autoload form
;; `tramp-compat-rx'. So we refrain from using `rx'.
;;;###autoload
(progn (defmacro tramp-archive-autoload-file-name-regexp ()
"Regular expression matching archive file names."
(if (<= emacs-major-version 26)
'(concat
"\\`" "\\(" ".+" "\\."
;; Default suffixes ...
(regexp-opt tramp-archive-suffixes)
;; ... with compression.
"\\(?:" "\\." (regexp-opt tramp-archive-compression-suffixes) "\\)*"
"\\)" ;; \1
"\\(" "/" ".*" "\\)" "\\'") ;; \2
`(rx
bos
;; This group is used in `tramp-archive-file-name-archive'.
@ -208,13 +192,10 @@ It must be supported by libarchive(3).")
(? "." (| ,@tramp-archive-compression-suffixes)))
;; This group is used in `tramp-archive-file-name-localname'.
(group "/" (* nonl))
eos))))
eos)))
(put #'tramp-archive-autoload-file-name-regexp 'tramp-autoload t)
;; In older Emacs (prior 27.1), `tramp-archive-autoload-file-name-regexp'
;; is not autoloaded. So we cannot expect it to be known in
;; tramp-loaddefs.el. But it exists, when tramp-archive.el is loaded.
;; We must wrap it into `eval-when-compile'. Otherwise, there could
;; be an "Eager macro-expansion failure" when unloading/reloading Tramp.
;;;###tramp-autoload
@ -222,11 +203,6 @@ It must be supported by libarchive(3).")
(eval-when-compile (ignore-errors (tramp-archive-autoload-file-name-regexp)))
"Regular expression matching archive file names.")
;; The value above is nil for Emacs 26. Set it now.
(if (<= emacs-major-version 26)
(setq tramp-archive-file-name-regexp
(ignore-errors (tramp-archive-autoload-file-name-regexp))))
;;;###tramp-autoload
(defconst tramp-archive-method "archive"
"Method name for archives in GVFS.")
@ -299,7 +275,7 @@ It must be supported by libarchive(3).")
(lock-file . ignore)
(make-auto-save-file-name . ignore)
(make-directory . tramp-archive-handle-not-implemented)
(make-directory-internal . tramp-archive-handle-not-implemented)
(make-directory-internal . ignore)
(make-lock-file-name . ignore)
(make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
(make-process . ignore)
@ -360,13 +336,9 @@ arguments to pass to the OPERATION."
(tramp-register-file-name-handlers)
(tramp-archive-run-real-handler operation args))
(with-no-warnings ;; max-specpdl-size
(let* ((filename (apply #'tramp-archive-file-name-for-operation
operation args))
(archive (tramp-archive-file-name-archive filename))
;; Sometimes, it fails with "Variable binding depth exceeds
;; max-specpdl-size". Shall be fixed in Emacs 27.
(max-specpdl-size (* 2 max-specpdl-size)))
(archive (tramp-archive-file-name-archive filename)))
;; `filename' could be a quoted file name. Or the file
;; archive could be a directory, see Bug#30293.
@ -394,7 +366,7 @@ arguments to pass to the OPERATION."
(setq args (cons operation args)))
(if fn
(save-match-data (apply (cdr fn) args))
(tramp-archive-run-real-handler operation args))))))))
(tramp-archive-run-real-handler operation args)))))))
;;;###autoload
(progn (defun tramp-archive-autoload-file-name-handler (operation &rest args)
@ -432,10 +404,6 @@ arguments to pass to the OPERATION."
(remove-hook
'after-init-hook #'tramp-register-archive-autoload-file-name-handler))))
;; In older Emacsen (prior 27.1), the autoload above does not exist.
;; So we call it again; it doesn't hurt.
(tramp-register-archive-autoload-file-name-handler)
;; Mark `operations' the handler is responsible for.
(put #'tramp-archive-file-name-handler 'operations
(mapcar #'car tramp-archive-file-name-handler-alist))
@ -458,7 +426,7 @@ arguments to pass to the OPERATION."
"Return t if NAME is a string with archive file name syntax."
(and (stringp name)
;; `tramp-archive-file-name-regexp' does not suppress quoted file names.
(not (tramp-compat-file-name-quoted-p name t))
(not (file-name-quoted-p name t))
;; We cannot use `string-match-p', the matches are used.
(string-match tramp-archive-file-name-regexp name)
t))
@ -511,7 +479,6 @@ name is kept in slot `hop'"
;; http://...
((and url-handler-mode
tramp-compat-use-url-tramp-p
(string-match-p url-handler-regexp archive)
(string-match-p
"https?" (url-type (url-generic-parse-url archive))))

View file

@ -267,8 +267,7 @@ Return VALUE."
(defun tramp-flush-directory-properties (key directory)
"Remove all properties of DIRECTORY in the cache context of KEY.
Remove also properties of all files in subdirectories."
(let* ((directory
(directory-file-name (tramp-compat-file-name-unquote directory)))
(let* ((directory (directory-file-name (file-name-unquote directory)))
(truename (tramp-get-file-property key directory "file-truename")))
(tramp-message key 8 "%s" directory)
(dolist (key (hash-table-keys tramp-cache-data))
@ -677,4 +676,8 @@ for all methods. Resulting data are derived from connection history."
(provide 'tramp-cache)
;;; TODO:
;;
;; * Use multisession.el, starting with Emacs 29.1.
;;; tramp-cache.el ends here

View file

@ -359,7 +359,7 @@ The remote connection identified by SOURCE is flushed by
(dir (tramp-rename-read-file-name-dir default))
(init (tramp-rename-read-file-name-init default))
(tramp-ignored-file-name-regexp
(tramp-compat-rx (literal (file-remote-p source)))))
(rx (literal (file-remote-p source)))))
(read-file-name-default
"Enter new Tramp connection: "
dir default 'confirm init #'file-directory-p)))))
@ -470,7 +470,7 @@ For details, see `tramp-rename-files'."
(dir (tramp-rename-read-file-name-dir default))
(init (tramp-rename-read-file-name-init default))
(tramp-ignored-file-name-regexp
(tramp-compat-rx (literal (file-remote-p source)))))
(rx (literal (file-remote-p source)))))
(read-file-name-default
(format "Change Tramp connection `%s': " source)
dir default 'confirm init #'file-directory-p)))))
@ -625,7 +625,7 @@ buffer in your bug report.
(unless (hash-table-p val)
;; Remove string quotation.
(when (looking-at
(tramp-compat-rx
(rx
bol (group (* anychar)) "\"" ;; \1 "
(group "(base64-decode-string ") "\\" ;; \2 \
(group "\"" (* anychar)) "\\" ;; \3 \

View file

@ -23,9 +23,9 @@
;;; Commentary:
;; Tramp's main Emacs version for development is Emacs 29. This
;; package provides compatibility functions for Emacs 26, Emacs 27 and
;; Emacs 28.
;; Tramp's main Emacs version for development is Emacs 30. This
;; package provides compatibility functions for Emacs 27, Emacs 28 and
;; Emacs 29.
;;; Code:
@ -36,7 +36,6 @@
(require 'shell)
(require 'subr-x)
(declare-function tramp-compat-rx "tramp")
(declare-function tramp-error "tramp")
(declare-function tramp-file-name-handler "tramp")
(declare-function tramp-tramp-file-p "tramp")
@ -85,153 +84,6 @@ Add the extension of F, if existing."
tramp-temp-name-prefix tramp-compat-temporary-file-directory)
dir-flag (file-name-extension f t)))
;; `file-name-quoted-p', `file-name-quote' and `file-name-unquote' got
;; a second argument in Emacs 27.1.
;;;###tramp-autoload
(defalias 'tramp-compat-file-name-quoted-p
(if (equal (func-arity #'file-name-quoted-p) '(1 . 2))
#'file-name-quoted-p
(lambda (name &optional top)
"Whether NAME is quoted with prefix \"/:\".
If NAME is a remote file name and TOP is nil, check the local part of NAME."
(let ((file-name-handler-alist (unless top file-name-handler-alist)))
(string-prefix-p "/:" (file-local-name name))))))
(defalias 'tramp-compat-file-name-quote
(if (equal (func-arity #'file-name-quote) '(1 . 2))
#'file-name-quote
(lambda (name &optional top)
"Add the quotation prefix \"/:\" to file NAME.
If NAME is a remote file name and TOP is nil, the local part of NAME is quoted."
(let ((file-name-handler-alist (unless top file-name-handler-alist)))
(if (tramp-compat-file-name-quoted-p name top)
name
(concat (file-remote-p name) "/:" (file-local-name name)))))))
(defalias 'tramp-compat-file-name-unquote
(if (equal (func-arity #'file-name-unquote) '(1 . 2))
#'file-name-unquote
(lambda (name &optional top)
"Remove quotation prefix \"/:\" from file NAME.
If NAME is a remote file name and TOP is nil, the local part of
NAME is unquoted."
(let* ((file-name-handler-alist (unless top file-name-handler-alist))
(localname (file-local-name name)))
(when (tramp-compat-file-name-quoted-p localname top)
(setq
localname (if (= (length localname) 2) "/" (substring localname 2))))
(concat (file-remote-p name) localname)))))
;; `tramp-syntax' has changed its meaning in Emacs 26.1. We still
;; support old settings.
(defsubst tramp-compat-tramp-syntax ()
"Return proper value of `tramp-syntax'."
(defvar tramp-syntax)
(cond ((eq tramp-syntax 'ftp) 'default)
((eq tramp-syntax 'sep) 'separate)
(t tramp-syntax)))
;; The signature of `tramp-make-tramp-file-name' has been changed.
;; Therefore, we cannot use `url-tramp-convert-url-to-tramp' prior
;; Emacs 26.1. We use `temporary-file-directory' as indicator.
(defconst tramp-compat-use-url-tramp-p (fboundp 'temporary-file-directory)
"Whether to use url-tramp.el.")
;; `exec-path' is new in Emacs 27.1.
(defalias 'tramp-compat-exec-path
(if (fboundp 'exec-path)
#'exec-path
(lambda ()
"List of directories to search programs to run in remote subprocesses."
(if (tramp-tramp-file-p default-directory)
(tramp-file-name-handler 'exec-path)
exec-path))))
;; `time-equal-p' has appeared in Emacs 27.1.
(defalias 'tramp-compat-time-equal-p
(if (fboundp 'time-equal-p)
#'time-equal-p
(lambda (t1 t2)
"Return non-nil if time value T1 is equal to time value T2.
A nil value for either argument stands for the current time."
(equal (or t1 (current-time)) (or t2 (current-time))))))
;; `flatten-tree' has appeared in Emacs 27.1.
(defalias 'tramp-compat-flatten-tree
(if (fboundp 'flatten-tree)
#'flatten-tree
(lambda (tree)
"Take TREE and \"flatten\" it."
(let (elems)
(setq tree (list tree))
(while (let ((elem (pop tree)))
(cond ((consp elem)
(setq tree (cons (car elem) (cons (cdr elem) tree))))
(elem
(push elem elems)))
tree))
(nreverse elems)))))
;; `progress-reporter-update' got argument SUFFIX in Emacs 27.1.
(defalias 'tramp-compat-progress-reporter-update
(if (equal (func-arity #'progress-reporter-update) '(1 . 3))
#'progress-reporter-update
(lambda (reporter &optional value _suffix)
(progress-reporter-update reporter value))))
;; `ignore-error' is new in Emacs 27.1.
(defmacro tramp-compat-ignore-error (condition &rest body)
"Execute BODY; if the error CONDITION occurs, return nil.
Otherwise, return result of last form in BODY.
CONDITION can also be a list of error conditions."
(declare (debug t) (indent 1))
`(condition-case nil (progn ,@body) (,condition nil)))
;; `rx' in Emacs 26 doesn't know the `literal', `anychar' and
;; `multibyte' constructs. The `not' construct requires an `any'
;; construct as argument. The `regexp' construct requires a literal
;; string.
(defvar tramp-compat-rx--runtime-params)
(defun tramp-compat-rx--transform-items (items)
(mapcar #'tramp-compat-rx--transform-item items))
;; There is an error in Emacs 26. `(rx "a" (? ""))' => "a?".
;; We must protect the string in regexp and literal, therefore.
(defun tramp-compat-rx--transform-item (item)
(pcase item
('anychar 'anything)
('multibyte 'nonascii)
(`(not ,expr)
(if (consp expr) item (list 'not (list 'any expr))))
(`(regexp ,expr)
(setq tramp-compat-rx--runtime-params t)
`(regexp ,(list '\, `(concat "\\(?:" ,expr "\\)"))))
(`(literal ,expr)
(setq tramp-compat-rx--runtime-params t)
`(regexp ,(list '\, `(concat "\\(?:" (regexp-quote ,expr) "\\)"))))
(`(eval . ,_) item)
(`(,head . ,rest) (cons head (tramp-compat-rx--transform-items rest)))
(_ item)))
(defun tramp-compat-rx--transform (items)
(let* ((tramp-compat-rx--runtime-params nil)
(new-rx (cons ': (tramp-compat-rx--transform-items items))))
(if tramp-compat-rx--runtime-params
`(rx-to-string ,(list '\` new-rx) t)
(rx-to-string new-rx t))))
(if (ignore-errors (rx-to-string '(literal "a"))) ;; Emacs 27+.
(defalias 'tramp-compat-rx #'rx)
(defmacro tramp-compat-rx (&rest items)
(tramp-compat-rx--transform items)))
;; This is needed for compilation in the Emacs source tree.
;;;###autoload (defalias 'tramp-compat-rx #'rx)
(put #'tramp-compat-rx 'tramp-autoload t)
;; `file-modes', `set-file-modes' and `set-file-times' got argument
;; FLAG in Emacs 28.1.
(defalias 'tramp-compat-file-modes
@ -419,8 +271,5 @@ CONDITION can also be a list of error conditions."
;;
;; * Starting with Emacs 27.1, there's no need to escape open
;; parentheses with a backslash in docstrings anymore.
;;
;; * Starting with Emacs 27.1, there's `make-empty-file'. Could be
;; used instead of `(write-region "" ...)'.
;;; tramp-compat.el ends here

View file

@ -41,6 +41,7 @@
;; CONTAINER is the container to connect to
;;
;;
;;
;; Open file in a Kubernetes container:
;;
;; C-x C-f /kubernetes:POD:/path/to/file
@ -54,6 +55,18 @@
;; namespace, use this command to change it:
;;
;; "kubectl config set-context --current --namespace=<name>"
;;
;;
;;
;; Open a file on an existing toolbox container via Toolbox:
;;
;; C-x C-f /toolbox:CONTAINER:/path/to/file
;;
;; Where:
;; CONTAINER is the container to connect to (optional)
;;
;; If the container is not running, it is started. If no container is
;; specified, the default Toolbox container is used.
;;; Code:
@ -83,6 +96,14 @@
:type '(choice (const "kubectl")
(string)))
;;;###tramp-autoload
(defcustom tramp-toolbox-program "toolbox"
"Name of the Toolbox client program."
:group 'tramp
:version "30.1"
:type '(choice (const "toolbox")
(string)))
;;;###tramp-autoload
(defconst tramp-docker-method "docker"
"Tramp method name to use to connect to Docker containers.")
@ -95,6 +116,10 @@
(defconst tramp-kubernetes-method "kubernetes"
"Tramp method name to use to connect to Kubernetes containers.")
;;;###tramp-autoload
(defconst tramp-toolbox-method "toolbox"
"Tramp method name to use to connect to Toolbox containers.")
;;;###tramp-autoload
(defun tramp-docker--completion-function (&rest _args)
"List Docker-like containers available for connection.
@ -150,6 +175,27 @@ see its function help for a description of the format."
"jsonpath='{.contexts[?(@.name == \"%s\")]}'" current-context)))
(buffer-string))))))
;;;###tramp-autoload
(defun tramp-toolbox--completion-function (&rest _args)
"List Toolbox containers available for connection.
This function is used by `tramp-set-completion-function', please
see its function help for a description of the format."
(when-let ((default-directory tramp-compat-temporary-file-directory)
(raw-list (shell-command-to-string
(concat tramp-toolbox-program " list -c")))
;; Ignore header line.
(lines (cdr (split-string raw-list "\n" 'omit)))
(names (mapcar
(lambda (line)
(when (string-match
(rx bol (1+ (not space))
(1+ space) (group (1+ (not space))) space)
line)
(match-string 1 line)))
lines)))
(mapcar (lambda (m) (list nil m)) (delq nil names))))
;;;###tramp-autoload
(defvar tramp-default-remote-shell) ;; Silence byte compiler.
@ -167,6 +213,7 @@ see its function help for a description of the format."
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c"))))
(add-to-list 'tramp-methods
`(,tramp-podman-method
(tramp-login-program ,tramp-podman-program)
@ -179,6 +226,7 @@ see its function help for a description of the format."
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c"))))
(add-to-list 'tramp-methods
`(,tramp-kubernetes-method
(tramp-login-program ,tramp-kubernetes-program)
@ -193,6 +241,19 @@ see its function help for a description of the format."
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c"))))
(add-to-list 'tramp-methods
`(,tramp-toolbox-method
(tramp-login-program ,tramp-toolbox-program)
(tramp-login-args (("run")
("-c" "%h")
("%l")))
(tramp-direct-async (,tramp-default-remote-shell "-c"))
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-c"))))
(add-to-list 'tramp-default-host-alist `(,tramp-toolbox-method nil ""))
(tramp-set-completion-function
tramp-docker-method
'((tramp-docker--completion-function "")))
@ -203,7 +264,11 @@ see its function help for a description of the format."
(tramp-set-completion-function
tramp-kubernetes-method
'((tramp-kubernetes--completion-function ""))))
'((tramp-kubernetes--completion-function "")))
(tramp-set-completion-function
tramp-toolbox-method
'((tramp-toolbox--completion-function ""))))
(add-hook 'tramp-unload-hook
(lambda ()

View file

@ -146,7 +146,7 @@ They are completed by \"M-x TAB\" only when encryption support is enabled."
If NAME doesn't belong to an encrypted remote directory, return nil."
(catch 'crypt-file-name-p
(and tramp-crypt-enabled (stringp name)
(not (tramp-compat-file-name-quoted-p name))
(not (file-name-quoted-p name))
(not (string-suffix-p tramp-crypt-encfs-config name))
(dolist (dir tramp-crypt-directories)
(and (string-prefix-p
@ -497,7 +497,7 @@ directory. File names will be also encrypted."
(tramp-user-error nil "Feature is not enabled."))
(unless (and (tramp-tramp-file-p name) (file-directory-p name))
(tramp-user-error nil "%s must be an existing remote directory." name))
(when (tramp-compat-file-name-quoted-p name)
(when (file-name-quoted-p name)
(tramp-user-error nil "%s must not be quoted." name))
(setq name (file-name-as-directory (expand-file-name name)))
(unless (member name tramp-crypt-directories)
@ -556,7 +556,7 @@ localname."
(defun tramp-crypt-handle-access-file (filename string)
"Like `access-file' for Tramp files."
(let* ((encrypt-filename (tramp-crypt-encrypt-file-name filename))
(encrypt-regexp (tramp-compat-rx (literal encrypt-filename) eos))
(encrypt-regexp (rx (literal encrypt-filename) eos))
tramp-crypt-enabled)
(condition-case err
(access-file encrypt-filename string)
@ -709,8 +709,7 @@ absolute file names."
(mapcar
(lambda (x)
(replace-regexp-in-string
(tramp-compat-rx bos (literal directory)) ""
(tramp-crypt-decrypt-file-name x)))
(rx bos (literal directory)) "" (tramp-crypt-decrypt-file-name x)))
(directory-files (tramp-crypt-encrypt-file-name directory) 'full)))))
(defun tramp-crypt-handle-file-attributes (filename &optional id-format)
@ -756,9 +755,7 @@ absolute file names."
(defun tramp-crypt-handle-file-system-info (filename)
"Like `file-system-info' for Tramp files."
(let (tramp-crypt-enabled)
;; `file-system-info' exists since Emacs 27.1.
(tramp-compat-funcall
'file-system-info (tramp-crypt-encrypt-file-name filename))))
(file-system-info (tramp-crypt-encrypt-file-name filename))))
(defun tramp-crypt-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
@ -769,27 +766,26 @@ absolute file names."
(filename switches &optional wildcard full-directory-p)
"Like `insert-directory' for Tramp files.
WILDCARD is not supported."
;; This package has been added to Emacs 27.1.
(when (load "text-property-search" 'noerror 'nomessage)
(let (tramp-crypt-enabled)
(tramp-handle-insert-directory
(tramp-crypt-encrypt-file-name filename)
switches wildcard full-directory-p)
(let* ((filename (file-name-as-directory filename))
(enc (tramp-crypt-encrypt-file-name filename))
match string)
(goto-char (point-min))
(while (setq match (text-property-search-forward 'dired-filename t t))
(setq string
(buffer-substring
(prop-match-beginning match) (prop-match-end match))
string (if (file-name-absolute-p string)
(tramp-crypt-decrypt-file-name string)
(substring
(tramp-crypt-decrypt-file-name (concat enc string))
(length filename))))
(delete-region (prop-match-beginning match) (prop-match-end match))
(insert (propertize string 'dired-filename t)))))))
(require 'text-property-search)
(let (tramp-crypt-enabled)
(tramp-handle-insert-directory
(tramp-crypt-encrypt-file-name filename)
switches wildcard full-directory-p)
(let* ((filename (file-name-as-directory filename))
(enc (tramp-crypt-encrypt-file-name filename))
match string)
(goto-char (point-min))
(while (setq match (text-property-search-forward 'dired-filename t t))
(setq string
(buffer-substring
(prop-match-beginning match) (prop-match-end match))
string (if (file-name-absolute-p string)
(tramp-crypt-decrypt-file-name string)
(substring
(tramp-crypt-decrypt-file-name (concat enc string))
(length filename))))
(delete-region (prop-match-beginning match) (prop-match-end match))
(insert (propertize string 'dired-filename t))))))
(defun tramp-crypt-handle-lock-file (filename)
"Like `lock-file' for Tramp files."

View file

@ -69,15 +69,15 @@
(tramp-fuse-local-file-name directory))))))))
(if full
;; Massage the result.
(let ((local (tramp-compat-rx
(let ((local (rx
bol
(literal
(tramp-fuse-mount-point
(tramp-dissect-file-name directory)))))
(remote (directory-file-name
(funcall
(if (tramp-compat-file-name-quoted-p directory)
#'tramp-compat-file-name-quote #'identity)
(if (file-name-quoted-p directory)
#'file-name-quote #'identity)
(file-remote-p directory)))))
(mapcar
(lambda (x) (replace-regexp-in-string local remote x))
@ -174,8 +174,7 @@ It has the same meaning as `remote-file-name-inhibit-cache'.")
(tramp-set-file-property
vec "/" "mounted"
(when (string-match
(tramp-compat-rx
bol (group (literal (tramp-fuse-mount-spec vec))) blank)
(rx bol (group (literal (tramp-fuse-mount-spec vec))) blank)
mount)
(match-string 1 mount)))))))
@ -205,7 +204,7 @@ It has the same meaning as `remote-file-name-inhibit-cache'.")
(defun tramp-fuse-local-file-name (filename)
"Return local mount name of FILENAME."
(setq filename (tramp-compat-file-name-unquote (expand-file-name filename)))
(setq filename (file-name-unquote (expand-file-name filename)))
(with-parsed-tramp-file-name filename nil
;; As long as we call `tramp-*-maybe-open-connection' here,
;; we cache the result.
@ -214,10 +213,10 @@ It has the same meaning as `remote-file-name-inhibit-cache'.")
(intern
(format "tramp-%s-maybe-open-connection" (tramp-file-name-method v)))
v)
(let ((quoted (tramp-compat-file-name-quoted-p localname))
(localname (tramp-compat-file-name-unquote localname)))
(let ((quoted (file-name-quoted-p localname))
(localname (file-name-unquote localname)))
(funcall
(if quoted #'tramp-compat-file-name-quote #'identity)
(if quoted #'file-name-quote #'identity)
(expand-file-name
(if (file-name-absolute-p localname)
(substring localname 1) localname)

View file

@ -414,7 +414,7 @@ It has been changed in GVFS 1.14.")
;; </interface>
(defconst tramp-goa-identity-regexp
(tramp-compat-rx
(rx
bol (? (group (regexp tramp-user-regexp)))
"@" (? (group (regexp tramp-host-regexp)))
(? ":" (group (regexp tramp-port-regexp))))
@ -716,13 +716,13 @@ It has been changed in GVFS 1.14.")
"GVFS file attributes."))
(defconst tramp-gvfs-file-attributes-with-gvfs-ls-regexp
(tramp-compat-rx
(rx
blank (group (regexp (regexp-opt tramp-gvfs-file-attributes)))
"=" (group (+? nonl)))
"Regexp to parse GVFS file attributes with `gvfs-ls'.")
(defconst tramp-gvfs-file-attributes-with-gvfs-info-regexp
(tramp-compat-rx
(rx
bol (* blank) (group (regexp (regexp-opt tramp-gvfs-file-attributes)))
":" (+ blank) (group (* nonl)) eol)
"Regexp to parse GVFS file attributes with `gvfs-info'.")
@ -734,7 +734,7 @@ It has been changed in GVFS 1.14.")
"GVFS file system attributes.")
(defconst tramp-gvfs-file-system-attributes-regexp
(tramp-compat-rx
(rx
bol (* blank)
(group (regexp (regexp-opt tramp-gvfs-file-system-attributes)))
":" (+ blank) (group (* nonl)) eol)
@ -744,7 +744,7 @@ It has been changed in GVFS 1.14.")
"Default prefix for owncloud / nextcloud methods.")
(defconst tramp-gvfs-nextcloud-default-prefix-regexp
(tramp-compat-rx (literal tramp-gvfs-nextcloud-default-prefix) eol)
(rx (literal tramp-gvfs-nextcloud-default-prefix) eol)
"Regexp of default prefix for owncloud / nextcloud methods.")
@ -1168,8 +1168,7 @@ file names."
(with-parsed-tramp-file-name name nil
;; If there is a default location, expand tilde.
(when (string-match
(tramp-compat-rx bos "~" (group (* (not "/"))) (group (* nonl)) eos)
localname)
(rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) localname)
(let ((uname (match-string 1 localname))
(fname (match-string 2 localname))
hname)
@ -1186,8 +1185,7 @@ file names."
;; We do not pass "/..".
(if (string-match-p (rx bos (| "afp" (: "dav" (? "s")) "smb") eos) method)
(when (string-match
(tramp-compat-rx bos "/" (+ (not "/")) (group "/.." (? "/")))
localname)
(rx bos "/" (+ (not "/")) (group "/.." (? "/"))) localname)
(setq localname (replace-match "/" t t localname 1)))
(when (string-match (rx bol "/.." (? "/")) localname)
(setq localname (replace-match "/" t t localname))))
@ -1222,7 +1220,7 @@ file names."
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(while (looking-at
(tramp-compat-rx
(rx
bol (group (+ nonl)) blank
(group (+ digit)) blank
"(" (group (+? nonl)) ")"
@ -1232,7 +1230,7 @@ file names."
(cons "name" (match-string 1)))))
(goto-char (1+ (match-end 3)))
(while (looking-at
(tramp-compat-rx
(rx
(regexp tramp-gvfs-file-attributes-with-gvfs-ls-regexp)
(group
(| (regexp
@ -1281,11 +1279,10 @@ If FILE-SYSTEM is non-nil, return file system attributes."
"Return GVFS attributes association list of FILENAME."
(setq filename (directory-file-name (expand-file-name filename)))
(with-parsed-tramp-file-name filename nil
(setq localname (tramp-compat-file-name-unquote localname))
(setq localname (file-name-unquote localname))
(if (or (and (string-match-p
(rx bol (| "afp" (: "dav" (? "s")) "smb") eol) method)
(string-match-p
(tramp-compat-rx bol (? "/") (+ (not "/")) eol) localname))
(string-match-p (rx bol (? "/") (+ (not "/")) eol) localname))
(string-equal localname "/"))
(tramp-gvfs-get-root-attributes filename)
(assoc
@ -1485,7 +1482,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(let* ((events (process-get proc 'events))
(rest-string (process-get proc 'rest-string))
(dd (tramp-get-default-directory (process-buffer proc)))
(ddu (tramp-compat-rx (literal (tramp-gvfs-url-file-name dd)))))
(ddu (rx (literal (tramp-gvfs-url-file-name dd)))))
(when rest-string
(tramp-message proc 10 "Previous string:\n%s" rest-string))
(tramp-message proc 6 "%S\n%s" proc string)
@ -1504,7 +1501,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(delete-process proc))
(while (string-match
(tramp-compat-rx
(rx
bol (+ nonl) ":"
blank (group (+ nonl)) ":"
blank (group (regexp (regexp-opt tramp-gio-events)))
@ -1607,12 +1604,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(tramp-gvfs-set-attribute
v (if (eq flag 'nofollow) "-nt" "-t") "uint64"
(tramp-gvfs-url-file-name filename) "time::modified"
(format-time-string
"%s" (if (or (null time)
(tramp-compat-time-equal-p time tramp-time-doesnt-exist)
(tramp-compat-time-equal-p time tramp-time-dont-know))
nil
time)))))
(format-time-string "%s" (tramp-defined-time time)))))
(defun tramp-gvfs-handle-get-home-directory (vec &optional _user)
"The remote home directory for connection VEC as local file name.
@ -1705,7 +1697,7 @@ ID-FORMAT valid values are `string' and `integer'."
(defun tramp-gvfs-url-file-name (filename)
"Return FILENAME in URL syntax."
(setq filename (tramp-compat-file-name-unquote filename))
(setq filename (file-name-unquote filename))
(let* (;; "/" must NOT be hexified.
(url-unreserved-chars (cons ?/ url-unreserved-chars))
(result
@ -1725,8 +1717,7 @@ ID-FORMAT valid values are `string' and `integer'."
"Retrieve file name from D-Bus OBJECT-PATH."
(dbus-unescape-from-identifier
(replace-regexp-in-string
(tramp-compat-rx bol (* nonl) "/" (group (+ (not "/"))) eol) "\\1"
object-path)))
(rx bol (* nonl) "/" (group (+ (not "/"))) eol) "\\1" object-path)))
(defun tramp-gvfs-url-host (url)
"Return the host name part of URL, a string.
@ -2002,7 +1993,7 @@ Their full names are \"org.gtk.vfs.MountTracker.mounted\" and
(string-equal host (tramp-file-name-host vec))
(string-equal port (tramp-file-name-port vec))
(string-match-p
(tramp-compat-rx bol "/" (literal (or share "")))
(rx bol "/" (literal (or share "")))
(tramp-file-name-unquote-localname vec)))
;; Set mountpoint and location.
(tramp-set-file-property vec "/" "fuse-mountpoint" fuse-mountpoint)
@ -2047,8 +2038,7 @@ It was \"a(say)\", but has changed to \"a{sv})\"."
(tramp-media-device-port media) (tramp-file-name-port vec)))
(localname (tramp-file-name-unquote-localname vec))
(share (when (string-match
(tramp-compat-rx bol (? "/") (group (+ (not "/"))))
localname)
(rx bol (? "/") (group (+ (not "/")))) localname)
(match-string 1 localname)))
(ssl (if (string-match-p (rx bol (| "davs" "nextcloud")) method)
"true" "false"))
@ -2091,8 +2081,7 @@ It was \"a(say)\", but has changed to \"a{sv})\"."
(list (tramp-gvfs-mount-spec-entry "port" port)))))
(mount-pref
(if (and (string-match-p (rx bol "dav") method)
(string-match
(tramp-compat-rx bol (? "/") (+ (not "/"))) localname))
(string-match (rx bol (? "/") (+ (not "/"))) localname))
(match-string 0 localname)
(tramp-gvfs-get-remote-prefix vec))))
@ -2492,12 +2481,8 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
result))))
(when tramp-gvfs-enabled
(with-no-warnings ;; max-specpdl-size
;; Suppress D-Bus error messages and Tramp traces.
(let (;; Sometimes, it fails with "Variable binding depth exceeds
;; max-specpdl-size". Shall be fixed in Emacs 27.
(max-specpdl-size (* 2 max-specpdl-size))
(tramp-verbose 0)
(let ((tramp-verbose 0)
tramp-gvfs-dbus-event-vector fun)
;; Add completion functions for services announced by DNS-SD.
;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
@ -2550,7 +2535,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
"mtp"
(mapcar
(lambda (method) `(tramp-parse-media-names ,(format "_%s._tcp" method)))
tramp-media-methods)))))
tramp-media-methods))))
(add-hook 'tramp-unload-hook
(lambda ()

View file

@ -133,8 +133,7 @@ been set up by `rfn-eshadow-setup-minibuffer'."
;; Use `path-separator' as it does eshell.
(setq eshell-path-env
(if (file-remote-p default-directory)
(mapconcat
#'identity (butlast (tramp-compat-exec-path)) path-separator)
(mapconcat #'identity (butlast (exec-path)) path-separator)
(getenv "PATH"))))
(with-eval-after-load 'esh-util

View file

@ -337,7 +337,7 @@ file names."
(defun tramp-rclone-remote-file-name (filename)
"Return FILENAME as used in the `rclone' command."
(setq filename (tramp-compat-file-name-unquote (expand-file-name filename)))
(setq filename (file-name-unquote (expand-file-name filename)))
(if (tramp-rclone-file-name-p filename)
(with-parsed-tramp-file-name filename nil
;; As long as we call `tramp-rclone-maybe-open-connection' here,

View file

@ -411,7 +411,7 @@ The string is used in `tramp-methods'.")
(add-to-list 'tramp-default-method-alist
`(,tramp-local-host-regexp
,(tramp-compat-rx bos (literal tramp-root-id-string) eos) "su"))
,(rx bos (literal tramp-root-id-string) eos) "su"))
(add-to-list 'tramp-default-user-alist
`(,(rx bos (| "su" "sudo" "doas" "ksu") eos)
@ -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 {
@ -1151,8 +1149,7 @@ component is used as the target of the symlink."
;; If TARGET is still remote, quote it.
(if (tramp-tramp-file-p target)
(make-symbolic-link
(tramp-compat-file-name-quote target 'top)
linkname ok-if-already-exists)
(file-name-quote target 'top) linkname ok-if-already-exists)
(let ((ln (tramp-get-remote-ln v))
(cwd (tramp-run-real-handler
@ -1202,10 +1199,9 @@ component is used as the target of the symlink."
(if (directory-name-p filename) #'file-name-as-directory #'identity)
;; Quote properly.
(funcall
(if (tramp-compat-file-name-quoted-p filename)
#'tramp-compat-file-name-quote #'identity)
(if (file-name-quoted-p filename) #'file-name-quote #'identity)
(with-parsed-tramp-file-name
(tramp-compat-file-name-unquote (expand-file-name filename)) nil
(file-name-unquote (expand-file-name filename)) nil
(tramp-make-tramp-file-name
v
(with-tramp-file-property v localname "file-truename"
@ -1245,7 +1241,7 @@ component is used as the target of the symlink."
;; If the resulting localname looks remote, we must quote it
;; for security reasons.
(when (file-remote-p result)
(setq result (tramp-compat-file-name-quote result 'top)))
(setq result (file-name-quote result 'top)))
(tramp-message v 4 "True name of `%s' is `%s'" localname result)
result)))))))
@ -1440,7 +1436,7 @@ component is used as the target of the symlink."
(modtime (or (file-attribute-modification-time attr)
tramp-time-doesnt-exist)))
(setq coding-system-used last-coding-system-used)
(if (not (tramp-compat-time-equal-p modtime tramp-time-dont-know))
(if (not (time-equal-p modtime tramp-time-dont-know))
(tramp-run-real-handler #'set-visited-file-modtime (list modtime))
(progn
(tramp-send-command
@ -1480,9 +1476,7 @@ of."
(cond
;; File exists, and has a known modtime.
((and attr
(not
(tramp-compat-time-equal-p modtime tramp-time-dont-know)))
((and attr (not (time-equal-p modtime tramp-time-dont-know)))
(< (abs (tramp-time-diff modtime mt)) 2))
;; Modtime has the don't know value.
(attr
@ -1499,7 +1493,7 @@ of."
v localname "visited-file-modtime-ild" "")))
;; If file does not exist, say it is not modified if and
;; only if that agrees with the buffer's record.
(t (tramp-compat-time-equal-p mt tramp-time-doesnt-exist)))))))))
(t (time-equal-p mt tramp-time-doesnt-exist)))))))))
(defun tramp-sh-handle-set-file-modes (filename mode &optional flag)
"Like `set-file-modes' for Tramp files."
@ -1521,21 +1515,17 @@ of."
"Like `set-file-times' for Tramp files."
(tramp-skeleton-set-file-modes-times-uid-gid filename
(when (tramp-get-remote-touch v)
(let ((time
(if (or (null time)
(tramp-compat-time-equal-p time tramp-time-doesnt-exist)
(tramp-compat-time-equal-p time tramp-time-dont-know))
nil
time)))
(tramp-send-command-and-check
v (format
"env TZ=UTC0 %s %s %s %s"
(tramp-get-remote-touch v)
(if (tramp-get-connection-property v "touch-t")
(format "-t %s" (format-time-string "%Y%m%d%H%M.%S" time t))
"")
(if (eq flag 'nofollow) "-h" "")
(tramp-shell-quote-argument localname)))))))
(tramp-send-command-and-check
v (format
"env TZ=UTC0 %s %s %s %s"
(tramp-get-remote-touch v)
(if (tramp-get-connection-property v "touch-t")
(format
"-t %s"
(format-time-string "%Y%m%d%H%M.%S" (tramp-defined-time time) t))
"")
(if (eq flag 'nofollow) "-h" "")
(tramp-shell-quote-argument localname))))))
(defun tramp-sh-handle-get-home-directory (vec &optional user)
"The remote home directory for connection VEC as local file name.
@ -1633,7 +1623,7 @@ ID-FORMAT valid values are `string' and `integer'."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-selinux-context"
(let ((context '(nil nil nil nil))
(regexp (tramp-compat-rx
(regexp (rx
(group (+ (any "_" alnum))) ":"
(group (+ (any "_" alnum))) ":"
(group (+ (any "_" alnum))) ":"
@ -2391,10 +2381,10 @@ The method used must be an out-of-band method."
#'identity)
(if v1
(tramp-make-copy-program-file-name v1)
(tramp-compat-file-name-unquote filename)))
(file-name-unquote filename)))
target (if v2
(tramp-make-copy-program-file-name v2)
(tramp-compat-file-name-unquote newname)))
(file-name-unquote newname)))
;; Check for listener port.
(when (tramp-get-method-parameter v 'tramp-remote-copy-args)
@ -2438,7 +2428,7 @@ The method used must be an out-of-band method."
;; `tramp-ssh-controlmaster-options' is a string instead
;; of a list. Unflatten it.
copy-args
(tramp-compat-flatten-tree
(flatten-tree
(mapcar
(lambda (x) (if (tramp-compat-string-search " " x)
(split-string x) x))
@ -2823,8 +2813,7 @@ the result will be a local, non-Tramp, file name."
;; there could be the false positive "/:".
(if (or (and (eq system-type 'windows-nt)
(string-match-p
(tramp-compat-rx bol (| (: alpha ":") (: (literal null-device) eol)))
name))
(rx bol (| (: alpha ":") (: (literal null-device) eol))) name))
(and (not (tramp-tramp-file-p name))
(not (tramp-tramp-file-p dir))))
(tramp-run-real-handler #'expand-file-name (list name dir))
@ -2843,9 +2832,7 @@ the result will be a local, non-Tramp, file name."
;; supposed to find such a shell on the remote host. Please
;; tell me about it when this doesn't work on your system.
(when (string-match
(tramp-compat-rx
bos "~" (group (* (not "/"))) (group (* nonl)) eos)
localname)
(rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) localname)
(let ((uname (match-string 1 localname))
(fname (match-string 2 localname))
hname)
@ -3237,7 +3224,7 @@ implementation will be used."
;; Determine input.
(if (null infile)
(setq input (tramp-get-remote-null-device v))
(setq infile (tramp-compat-file-name-unquote (expand-file-name infile)))
(setq infile (file-name-unquote (expand-file-name infile)))
(if (tramp-equal-remote default-directory infile)
;; INFILE is on the same remote host.
(setq input (tramp-unquote-file-local-name infile))
@ -3918,7 +3905,7 @@ Fall back to normal file name handler if no Tramp handler exists."
(setq string (tramp-compat-string-replace "\n\n" "\n" string))
(while (string-match
(tramp-compat-rx
(rx
bol (+ (not ":")) ":" blank
(group (+ (not ":"))) ":" blank
(group (regexp (regexp-opt tramp-gio-events)))
@ -4021,66 +4008,55 @@ commands. \"%n\" is replaced by \"2>/dev/null\", and \"%t\" is
replaced by a temporary file name. If VEC is nil, the respective
local commands are used. If there is a format specifier which
cannot be expanded, this function returns nil."
(if (not (string-match-p
(tramp-compat-rx (| bol (not "%")) "%" (any "ahlnoprsty")) script))
(if (not (string-match-p (rx (| bol (not "%")) "%" (any "ahlnoprsty")) script))
script
(catch 'wont-work
(let ((awk (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%a") script)
(let ((awk (when (string-match-p (rx (| bol (not "%")) "%a") script)
(or
(if vec (tramp-get-remote-awk vec) (executable-find "awk"))
(throw 'wont-work nil))))
(hdmp (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%h") script)
(hdmp (when (string-match-p (rx (| bol (not "%")) "%h") script)
(or
(if vec (tramp-get-remote-hexdump vec)
(executable-find "hexdump"))
(throw 'wont-work nil))))
(dev (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%n") script)
(dev (when (string-match-p (rx (| bol (not "%")) "%n") script)
(or
(if vec (concat "2>" (tramp-get-remote-null-device vec))
(if (eq system-type 'windows-nt) ""
(concat "2>" null-device)))
(throw 'wont-work nil))))
(ls (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%l") script)
(ls (when (string-match-p (rx (| bol (not "%")) "%l") script)
(format "%s %s"
(or (tramp-get-ls-command vec)
(throw 'wont-work nil))
(tramp-sh--quoting-style-options vec))))
(od (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%o") script)
(od (when (string-match-p (rx (| bol (not "%")) "%o") script)
(or (if vec (tramp-get-remote-od vec) (executable-find "od"))
(throw 'wont-work nil))))
(perl (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%p") script)
(perl (when (string-match-p (rx (| bol (not "%")) "%p") script)
(or
(if vec
(tramp-get-remote-perl vec) (executable-find "perl"))
(throw 'wont-work nil))))
(python (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%y") script)
(or
(if vec
(tramp-get-remote-python vec)
(executable-find "python"))
(throw 'wont-work nil))))
(readlink (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%r") script)
(python (when (string-match-p (rx (| bol (not "%")) "%y") script)
(or
(if vec
(tramp-get-remote-python vec)
(executable-find "python"))
(throw 'wont-work nil))))
(readlink (when (string-match-p (rx (| bol (not "%")) "%r") script)
(or
(if vec
(tramp-get-remote-readlink vec)
(executable-find "readlink"))
(throw 'wont-work nil))))
(stat (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%s") script)
(tramp-get-remote-readlink vec)
(executable-find "readlink"))
(throw 'wont-work nil))))
(stat (when (string-match-p (rx (| bol (not "%")) "%s") script)
(or
(if vec
(tramp-get-remote-stat vec) (executable-find "stat"))
(throw 'wont-work nil))))
(tmp (when (string-match-p
(tramp-compat-rx (| bol (not "%")) "%t") script)
(tmp (when (string-match-p (rx (| bol (not "%")) "%t") script)
(or
(if vec
(tramp-file-local-name (tramp-make-tramp-temp-name vec))
@ -4341,8 +4317,7 @@ file exists and nonzero exit status otherwise."
"Couldn't find remote shell prompt for %s" shell)
(unless
(tramp-check-for-regexp
(tramp-get-connection-process vec)
(tramp-compat-rx (literal tramp-end-of-output)))
(tramp-get-connection-process vec) (rx (literal tramp-end-of-output)))
(tramp-wait-for-output (tramp-get-connection-process vec))
(tramp-message vec 5 "Setting shell prompt")
(tramp-send-command
@ -4383,8 +4358,7 @@ file exists and nonzero exit status otherwise."
(tramp-send-command
vec (format "echo ~%s" tramp-root-id-string) t)
(if (or (string-match-p
(tramp-compat-rx
bol "~" (literal tramp-root-id-string) eol)
(rx bol "~" (literal tramp-root-id-string) eol)
(buffer-string))
;; The default shell (ksh93) of OpenSolaris
;; and Solaris is buggy. We've got reports
@ -4423,7 +4397,7 @@ seconds. If not, it produces an error message with the given ERROR-ARGS."
(condition-case nil
(tramp-wait-for-regexp
proc timeout
(tramp-compat-rx
(rx
(| (regexp shell-prompt-pattern) (regexp tramp-shell-prompt-pattern))
eos))
(error
@ -4810,7 +4784,7 @@ Goes through the list `tramp-local-coding-commands' and
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-min))
(unless (looking-at-p (tramp-compat-rx (literal magic)))
(unless (looking-at-p (rx (literal magic)))
(throw 'wont-work-remote nil)))
;; `rem-enc' and `rem-dec' could be a string meanwhile.
@ -4896,7 +4870,7 @@ Goes through the list `tramp-inline-compress-commands'."
nil t))
(throw 'next nil))
(goto-char (point-min))
(unless (looking-at-p (tramp-compat-rx (literal magic)))
(unless (looking-at-p (rx (literal magic)))
(throw 'next nil)))
(tramp-message
vec 5
@ -4907,7 +4881,7 @@ Goes through the list `tramp-inline-compress-commands'."
(throw 'next nil))
(with-current-buffer (tramp-get-buffer vec)
(goto-char (point-min))
(unless (looking-at-p (tramp-compat-rx (literal magic)))
(unless (looking-at-p (rx (literal magic)))
(throw 'next nil)))
(setq found t)))
@ -5252,7 +5226,7 @@ connection if a previous connection has died for some reason."
(tramp-get-method-parameter hop 'tramp-remote-shell))
(extra-args (tramp-get-sh-extra-args remote-shell))
(async-args
(tramp-compat-flatten-tree
(flatten-tree
(tramp-get-method-parameter hop 'tramp-async-args)))
(connection-timeout
(tramp-get-method-parameter
@ -5396,7 +5370,7 @@ function waits for output unless NOOUTPUT is set."
;; Busyboxes built with the EDITING_ASK_TERMINAL config
;; option send also escape sequences, which must be
;; ignored.
(regexp (tramp-compat-rx
(regexp (rx
(* (not (any "#$\n")))
(literal tramp-end-of-output)
(? (regexp tramp-device-escape-sequence-regexp))
@ -5404,7 +5378,7 @@ function waits for output unless NOOUTPUT is set."
;; Sometimes, the commands do not return a newline but a
;; null byte before the shell prompt, for example "git
;; ls-files -c -z ...".
(regexp1 (tramp-compat-rx (| bol "\000") (regexp regexp)))
(regexp1 (rx (| bol "\000") (regexp regexp)))
(found (tramp-wait-for-regexp proc timeout regexp1)))
(if found
(let ((inhibit-read-only t))
@ -5444,8 +5418,7 @@ the exit status."
(let (cmd data)
(if (and (stringp command)
(string-match
(tramp-compat-rx
(* nonl) "<<'" (literal tramp-end-of-heredoc) "'" (* nonl))
(rx (* nonl) "<<'" (literal tramp-end-of-heredoc) "'" (* nonl))
command))
(setq cmd (match-string 0 command)
data (substring command (match-end 0)))
@ -5615,7 +5588,7 @@ Nonexistent directories are removed from spec."
(tramp-get-method-parameter vec 'tramp-remote-shell-args)
" ")
(tramp-shell-quote-argument tramp-end-of-heredoc))
'noerror (tramp-compat-rx (literal tramp-end-of-heredoc)))
'noerror (rx (literal tramp-end-of-heredoc)))
(progn
(tramp-message
vec 2 "Could not retrieve `tramp-own-remote-path'")
@ -5665,8 +5638,7 @@ Nonexistent directories are removed from spec."
(while candidates
(goto-char (point-min))
(if (string-match-p
(tramp-compat-rx bol (literal (car candidates)) (? "\r") eol)
(buffer-string))
(rx bol (literal (car candidates)) (? "\r") eol) (buffer-string))
(setq locale (car candidates)
candidates nil)
(setq candidates (cdr candidates)))))
@ -5744,7 +5716,7 @@ Nonexistent directories are removed from spec."
vec (format "( %s / -nt / )" (tramp-get-test-command vec)))
(with-current-buffer (tramp-get-buffer vec)
(goto-char (point-min))
(when (looking-at-p (tramp-compat-rx (literal tramp-end-of-output)))
(when (looking-at-p (rx (literal tramp-end-of-output)))
(format "%s %%s -nt %%s" (tramp-get-test-command vec)))))
(progn
(tramp-send-command
@ -5827,14 +5799,6 @@ Nonexistent directories are removed from spec."
vec (format "%s --canonicalize-missing /" result)))
result))))
(defun tramp-get-remote-trash (vec)
"Determine remote `trash' command.
This command is returned only if `delete-by-moving-to-trash' is non-nil."
(and delete-by-moving-to-trash
(with-tramp-connection-property vec "trash"
(tramp-message vec 5 "Finding a suitable `trash' command")
(tramp-find-executable vec "trash" (tramp-get-remote-path vec)))))
(defun tramp-get-remote-touch (vec)
"Determine remote `touch' command."
(with-tramp-connection-property vec "touch"

View file

@ -53,7 +53,7 @@
;;;###tramp-autoload
(tramp--with-startup
(add-to-list 'tramp-default-user-alist
`(,(tramp-compat-rx bos (literal tramp-smb-method) eos) nil nil))
`(,(rx bos (literal tramp-smb-method) eos) nil nil))
;; Add completion function for SMB method.
(tramp-set-completion-function
@ -92,9 +92,9 @@ this variable \"client min protocol=NT1\"."
"Version string of the SMB client.")
(defconst tramp-smb-server-version
(tramp-compat-rx "Domain=[" (* (not "]")) "] "
"OS=[" (* (not "]")) "] "
"Server=[" (* (not "]")) "]")
(rx "Domain=[" (* (not "]")) "] "
"OS=[" (* (not "]")) "] "
"Server=[" (* (not "]")) "]")
"Regexp of SMB server identification.")
(defconst tramp-smb-prompt
@ -730,8 +730,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(with-parsed-tramp-file-name name nil
;; Tilde expansion if necessary.
(when (string-match
(tramp-compat-rx bos "~" (group (* (not "/"))) (group (* nonl)) eos)
localname)
(rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) localname)
(let ((uname (match-string 1 localname))
(fname (match-string 2 localname))
hname)
@ -1083,8 +1082,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; Check for matching entries.
(mapcar
(lambda (x)
(when (string-match-p
(tramp-compat-rx bol (literal base)) (nth 0 x))
(when (string-match-p (rx bol (literal base)) (nth 0 x))
x))
entries)
;; We just need the only and only entry FILENAME.
@ -1181,26 +1179,6 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(unless (file-directory-p dir)
(tramp-error v 'file-error "Couldn't make directory %s" dir))))
;; This is not used anymore.
(defun tramp-smb-handle-make-directory-internal (directory)
"Like `make-directory-internal' for Tramp files."
(declare (obsolete nil "29.1"))
(setq directory (directory-file-name (expand-file-name directory)))
(unless (file-name-absolute-p directory)
(setq directory (expand-file-name directory default-directory)))
(with-parsed-tramp-file-name directory nil
(when (file-directory-p (file-name-directory directory))
(tramp-smb-send-command
v (if (tramp-smb-get-cifs-capabilities v)
(format "posix_mkdir %s %o"
(tramp-smb-shell-quote-localname v) (default-file-modes))
(format "mkdir %s" (tramp-smb-shell-quote-localname v))))
;; We must also flush the cache of the directory, because
;; `file-attributes' reads the values from there.
(tramp-flush-file-properties v localname))
(unless (file-directory-p directory)
(tramp-error v 'file-error "Couldn't make directory %s" directory))))
(defun tramp-smb-handle-make-symbolic-link
(target linkname &optional ok-if-already-exists)
"Like `make-symbolic-link' for Tramp files.
@ -1218,8 +1196,7 @@ component is used as the target of the symlink."
;; If TARGET is still remote, quote it.
(if (tramp-tramp-file-p target)
(make-symbolic-link
(tramp-compat-file-name-quote target 'top)
linkname ok-if-already-exists)
(file-name-quote target 'top) linkname ok-if-already-exists)
;; Do the 'confirm if exists' thing.
(when (file-exists-p linkname)
@ -1264,7 +1241,7 @@ component is used as the target of the symlink."
;; Determine input.
(when infile
(setq infile (tramp-compat-file-name-unquote (expand-file-name infile)))
(setq infile (file-name-unquote (expand-file-name infile)))
(if (tramp-equal-remote default-directory infile)
;; INFILE is on the same remote host.
(setq input (tramp-unquote-file-local-name infile))
@ -1572,7 +1549,7 @@ component is used as the target of the symlink."
\"//\" substitutes only in the local filename part. Catches
errors for shares like \"C$/\", which are common in Microsoft Windows."
;; Check, whether the local part is a quoted file name.
(if (tramp-compat-file-name-quoted-p filename)
(if (file-name-quoted-p filename)
filename
(with-parsed-tramp-file-name filename nil
;; Ignore in LOCALNAME everything before "//".
@ -1623,8 +1600,7 @@ VEC or USER, or if there is no home directory, return nil."
"Return the share name of LOCALNAME."
(save-match-data
(let ((localname (tramp-file-name-unquote-localname vec)))
(when (string-match
(tramp-compat-rx bol (? "/") (group (+ (not "/"))) "/") localname)
(when (string-match (rx bol (? "/") (group (+ (not "/"))) "/") localname)
(match-string 1 localname)))))
(defun tramp-smb-get-localname (vec)
@ -1635,8 +1611,7 @@ If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"."
(setq
localname
(if (string-match
(tramp-compat-rx bol (? "/") (+ (not "/")) (group "/" (* nonl)))
localname)
(rx bol (? "/") (+ (not "/")) (group "/" (* nonl))) localname)
;; There is a share, separated by "/".
(if (not (tramp-smb-get-cifs-capabilities vec))
(mapconcat
@ -1644,8 +1619,7 @@ If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"."
(match-string 1 localname) "")
(match-string 1 localname))
;; There is just a share.
(if (string-match
(tramp-compat-rx bol (? "/") (group (+ (not "/"))) eol) localname)
(if (string-match (rx bol (? "/") (group (+ (not "/"))) eol) localname)
(match-string 1 localname)
"")))
@ -1773,8 +1747,7 @@ are listed. Result is the list (LOCALNAME MODE SIZE MTIME)."
(if (not share)
;; Read share entries.
(when (string-match
(tramp-compat-rx bol "Disk|" (group (+ (not "|"))) "|") line)
(when (string-match (rx bol "Disk|" (group (+ (not "|"))) "|") line)
(setq localname (match-string 1 line)
mode "dr-xr-xr-x"
size 0))

View file

@ -228,8 +228,7 @@ arguments to pass to the OPERATION."
(defun tramp-sshfs-handle-file-system-info (filename)
"Like `file-system-info' for Tramp files."
;;`file-system-info' exists since Emacs 27.1.
(tramp-compat-funcall 'file-system-info (tramp-fuse-local-file-name filename)))
(file-system-info (tramp-fuse-local-file-name filename)))
(defun tramp-sshfs-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
@ -266,7 +265,7 @@ arguments to pass to the OPERATION."
;; Determine input.
(if (null infile)
(setq input (tramp-get-remote-null-device v))
(setq infile (tramp-compat-file-name-unquote (expand-file-name infile)))
(setq infile (file-name-unquote (expand-file-name infile)))
(if (tramp-equal-remote default-directory infile)
;; INFILE is on the same remote host.
(setq input (tramp-unquote-file-local-name infile))

View file

@ -49,7 +49,7 @@
(tramp-password-previous-hop t)))
(add-to-list 'tramp-default-user-alist
`(,(tramp-compat-rx bos (literal tramp-sudoedit-method) eos)
`(,(rx bos (literal tramp-sudoedit-method) eos)
nil ,tramp-root-id-string))
(tramp-set-completion-function
@ -212,8 +212,8 @@ arguments to pass to the OPERATION."
(unless
(tramp-sudoedit-send-command
v1 "ln"
(tramp-compat-file-name-unquote v1-localname)
(tramp-compat-file-name-unquote v2-localname))
(file-name-unquote v1-localname)
(file-name-unquote v2-localname))
(tramp-error
v1 'file-error
"error with add-name-to-file, see buffer `%s' for details"
@ -342,7 +342,7 @@ absolute file names."
(tramp-skeleton-delete-directory directory recursive trash
(unless (tramp-sudoedit-send-command
v (if recursive '("rm" "-rf") "rmdir")
(tramp-compat-file-name-unquote localname))
(file-name-unquote localname))
(tramp-error v 'file-error "Couldn't delete %s" directory))))
(defun tramp-sudoedit-handle-delete-file (filename &optional trash)
@ -352,7 +352,7 @@ absolute file names."
(if (and delete-by-moving-to-trash trash)
(move-file-to-trash filename)
(unless (tramp-sudoedit-send-command
v "rm" "-f" (tramp-compat-file-name-unquote localname))
v "rm" "-f" (file-name-unquote localname))
;; Propagate the error.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
@ -382,8 +382,7 @@ the result will be a local, non-Tramp, file name."
(unless (file-name-absolute-p localname)
(setq localname (format "~%s/%s" user localname)))
(when (string-match
(tramp-compat-rx bos "~" (group (* (not "/"))) (group (* nonl)) eos)
localname)
(rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) localname)
(let ((uname (match-string 1 localname))
(fname (match-string 2 localname))
hname)
@ -413,7 +412,7 @@ the result will be a local, non-Tramp, file name."
(let ((result (and (tramp-sudoedit-remote-acl-p v)
(tramp-sudoedit-send-command-string
v "getfacl" "-acp"
(tramp-compat-file-name-unquote localname)))))
(file-name-unquote localname)))))
;; The acl string must have a trailing \n, which is not
;; provided by `tramp-sudoedit-send-command-string'. Add it.
(and (stringp result) (concat result "\n"))))))
@ -440,8 +439,7 @@ the result will be a local, non-Tramp, file name."
(tramp-convert-file-attributes v localname id-format
(tramp-sudoedit-send-command-and-read
v "env" "QUOTING_STYLE=locale" "stat" "-c"
tramp-sudoedit-file-attributes
(tramp-compat-file-name-unquote localname)))))
tramp-sudoedit-file-attributes (file-name-unquote localname)))))
(defun tramp-sudoedit-handle-file-executable-p (filename)
"Like `file-executable-p' for Tramp files."
@ -453,7 +451,7 @@ the result will be a local, non-Tramp, file name."
(or (tramp-check-cached-permissions v ?x)
(tramp-check-cached-permissions v ?s))
(tramp-sudoedit-send-command
v "test" "-x" (tramp-compat-file-name-unquote localname))))))
v "test" "-x" (file-name-unquote localname))))))
(defun tramp-sudoedit-handle-file-exists-p (filename)
"Like `file-exists-p' for Tramp files."
@ -466,7 +464,7 @@ the result will be a local, non-Tramp, file name."
(if (tramp-file-property-p v localname "file-attributes")
(not (null (tramp-get-file-property v localname "file-attributes")))
(tramp-sudoedit-send-command
v "test" "-e" (tramp-compat-file-name-unquote localname)))))))
v "test" "-e" (file-name-unquote localname)))))))
(defun tramp-sudoedit-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."
@ -477,7 +475,7 @@ the result will be a local, non-Tramp, file name."
(tramp-sudoedit-send-command
v "ls" "-a1" "--quoting-style=literal" "--show-control-chars"
(if (zerop (length localname))
"" (tramp-compat-file-name-unquote localname)))
"" (file-name-unquote localname)))
(mapcar
(lambda (f)
(if (file-directory-p (expand-file-name f directory))
@ -500,7 +498,7 @@ the result will be a local, non-Tramp, file name."
(if (tramp-file-property-p v localname "file-attributes")
(tramp-handle-file-readable-p filename)
(tramp-sudoedit-send-command
v "test" "-r" (tramp-compat-file-name-unquote localname))))))
v "test" "-r" (file-name-unquote localname))))))
(defun tramp-sudoedit-handle-set-file-modes (filename mode &optional flag)
"Like `set-file-modes' for Tramp files."
@ -508,8 +506,7 @@ the result will be a local, non-Tramp, file name."
(unless (and (eq flag 'nofollow) (file-symlink-p filename))
(tramp-skeleton-set-file-modes-times-uid-gid filename
(unless (tramp-sudoedit-send-command
v "chmod" (format "%o" mode)
(tramp-compat-file-name-unquote localname))
v "chmod" (format "%o" mode) (file-name-unquote localname))
(tramp-error
v 'file-error "Error while changing file's mode %s" filename)))))
@ -523,15 +520,14 @@ the result will be a local, non-Tramp, file name."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-selinux-context"
(let ((context '(nil nil nil nil))
(regexp (tramp-compat-rx
(regexp (rx
(group (+ (any "_" alnum))) ":"
(group (+ (any "_" alnum))) ":"
(group (+ (any "_" alnum))) ":"
(group (+ (any "_" alnum))))))
(when (and (tramp-sudoedit-remote-selinux-p v)
(tramp-sudoedit-send-command
v "ls" "-d" "-Z"
(tramp-compat-file-name-unquote localname)))
v "ls" "-d" "-Z" (file-name-unquote localname)))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(when (re-search-forward regexp (line-end-position) t)
@ -547,7 +543,7 @@ the result will be a local, non-Tramp, file name."
(tramp-message v 5 "file system info: %s" localname)
(when (tramp-sudoedit-send-command
v "df" "--block-size=1" "--output=size,used,avail"
(tramp-compat-file-name-unquote localname))
(file-name-unquote localname))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(forward-line)
@ -565,17 +561,11 @@ the result will be a local, non-Tramp, file name."
(defun tramp-sudoedit-handle-set-file-times (filename &optional time flag)
"Like `set-file-times' for Tramp files."
(tramp-skeleton-set-file-modes-times-uid-gid filename
(let ((time
(if (or (null time)
(tramp-compat-time-equal-p time tramp-time-doesnt-exist)
(tramp-compat-time-equal-p time tramp-time-dont-know))
nil
time)))
(tramp-sudoedit-send-command
v "env" "TZ=UTC0" "touch" "-t"
(format-time-string "%Y%m%d%H%M.%S" time t)
(if (eq flag 'nofollow) "-h" "")
(tramp-compat-file-name-unquote localname)))))
(tramp-sudoedit-send-command
v "env" "TZ=UTC0" "touch" "-t"
(format-time-string "%Y%m%d%H%M.%S" (tramp-defined-time time) t)
(if (eq flag 'nofollow) "-h" "")
(file-name-unquote localname))))
(defun tramp-sudoedit-handle-file-truename (filename)
"Like `file-truename' for Tramp files."
@ -584,10 +574,9 @@ the result will be a local, non-Tramp, file name."
(if (directory-name-p filename) #'file-name-as-directory #'identity)
;; Quote properly.
(funcall
(if (tramp-compat-file-name-quoted-p filename)
#'tramp-compat-file-name-quote #'identity)
(if (file-name-quoted-p filename) #'file-name-quote #'identity)
(with-parsed-tramp-file-name
(tramp-compat-file-name-unquote (expand-file-name filename)) nil
(file-name-unquote (expand-file-name filename)) nil
(tramp-make-tramp-file-name
v
(with-tramp-file-property v localname "file-truename"
@ -604,7 +593,7 @@ the result will be a local, non-Tramp, file name."
;; If the resulting localname looks remote, we must quote it
;; for security reasons.
(when (file-remote-p result)
(setq result (tramp-compat-file-name-quote result 'top)))
(setq result (file-name-quote result 'top)))
(tramp-message v 4 "True name of `%s' is `%s'" localname result)
result)))))))
@ -618,7 +607,7 @@ the result will be a local, non-Tramp, file name."
;; be satisfied without remote operation.
(tramp-check-cached-permissions v ?w)
(tramp-sudoedit-send-command
v "test" "-w" (tramp-compat-file-name-unquote localname)))
v "test" "-w" (file-name-unquote localname)))
;; If file doesn't exist, check if directory is writable.
(and
(file-directory-p (file-name-directory filename))
@ -629,7 +618,7 @@ the result will be a local, non-Tramp, file name."
(tramp-skeleton-make-directory dir parents
(unless (tramp-sudoedit-send-command
v "mkdir" "-m" (format "%#o" (default-file-modes))
(tramp-compat-file-name-unquote localname))
(file-name-unquote localname))
(tramp-error v 'file-error "Couldn't make directory %s" dir))))
(defun tramp-sudoedit-handle-make-symbolic-link
@ -649,8 +638,7 @@ component is used as the target of the symlink."
;; If TARGET is still remote, quote it.
(if (tramp-tramp-file-p target)
(make-symbolic-link
(tramp-compat-file-name-quote target 'top)
linkname ok-if-already-exists)
(file-name-quote target 'top) linkname ok-if-already-exists)
;; Do the 'confirm if exists' thing.
(when (file-exists-p linkname)
@ -668,8 +656,8 @@ component is used as the target of the symlink."
(tramp-flush-file-properties v localname)
(tramp-sudoedit-send-command
v "ln" "-sf"
(tramp-compat-file-name-unquote target)
(tramp-compat-file-name-unquote localname)))))
(file-name-unquote target)
(file-name-unquote localname)))))
(defun tramp-sudoedit-handle-rename-file
(filename newname &optional ok-if-already-exists)
@ -693,8 +681,7 @@ component is used as the target of the symlink."
(setq acl-string (string-join (split-string acl-string "\n" 'omit) ","))
(prog1
(tramp-sudoedit-send-command
v "setfacl" "-m"
acl-string (tramp-compat-file-name-unquote localname))
v "setfacl" "-m" acl-string (file-name-unquote localname))
(tramp-flush-file-property v localname "file-acl")))))
(defun tramp-sudoedit-handle-set-file-selinux-context (filename context)
@ -712,7 +699,7 @@ component is used as the target of the symlink."
(when role (format "--role=%s" role))
(when type (format "--type=%s" type))
(when range (format "--range=%s" range))
(tramp-compat-file-name-unquote localname))
(file-name-unquote localname))
(if (and user role type range)
(tramp-set-file-property
v localname "file-selinux-context" context)
@ -820,7 +807,7 @@ in case of error, t otherwise."
vec 'tramp-sudo-login
?h (or (tramp-file-name-host vec) "")
?u (or (tramp-file-name-user vec) ""))
(tramp-compat-flatten-tree args))))
(flatten-tree args))))
;; We suppress the messages `Waiting for prompts from remote shell'.
(tramp-verbose (if (= tramp-verbose 3) 2 tramp-verbose))
;; The password shall be cached also in case of "emacs -Q".

View file

@ -443,9 +443,7 @@ See `tramp-methods' for a list of possibilities for METHOD."
(defcustom tramp-default-user nil
"Default user to use for transferring files.
It is nil by default; otherwise settings in configuration files like
\"~/.ssh/config\" would be overwritten. Also see `tramp-default-user-alist'.
This variable is regarded as obsolete, and will be removed soon."
\"~/.ssh/config\" would be overwritten. Also see `tramp-default-user-alist'."
:type '(choice (const nil) string))
;;;###tramp-autoload
@ -525,7 +523,7 @@ interpreted as a regular expression which always matches."
(defcustom tramp-restricted-shell-hosts-alist
(when (and (eq system-type 'windows-nt)
(not (string-match-p (rx "sh" eol) tramp-encoding-shell)))
(list (tramp-compat-rx
(list (rx
bos (| (literal (downcase tramp-system-name))
(literal (upcase tramp-system-name)))
eos)))
@ -539,7 +537,7 @@ host runs a restricted shell, it shall be added to this list, too."
;;;###tramp-autoload
(defcustom tramp-local-host-regexp
(tramp-compat-rx
(rx
bos
(| (literal tramp-system-name)
(| "localhost" "localhost4" "localhost6" "127.0.0.1" "::1"))
@ -640,7 +638,7 @@ This regexp must match both `tramp-initial-end-of-output' and
:type 'regexp)
(defcustom tramp-password-prompt-regexp
(tramp-compat-rx
(rx
bol (* nonl)
(group (regexp (regexp-opt password-word-equivalents)))
(* nonl) ":" (? "\^@") (* blank))
@ -899,18 +897,17 @@ Used in `tramp-make-tramp-file-name'.")
(defun tramp-build-prefix-regexp ()
"Return `tramp-prefix-regexp'."
(tramp-compat-rx bol (literal (tramp-build-prefix-format))))
(rx bol (literal (tramp-build-prefix-format))))
(defvar tramp-prefix-regexp nil ; Initialized when defining `tramp-syntax'!
"Regexp matching the very beginning of Tramp file names.
Should always start with \"^\". Derived from `tramp-prefix-format'.")
(defconst tramp-method-regexp-alist
`((default . ,(tramp-compat-rx
(| (literal tramp-default-method-marker) (>= 2 alnum))))
`((default . ,(rx (| (literal tramp-default-method-marker) (>= 2 alnum))))
(simplified . "")
(separate . ,(tramp-compat-rx
(? (| (literal tramp-default-method-marker) (>= 2 alnum))))))
(separate
. ,(rx (? (| (literal tramp-default-method-marker) (>= 2 alnum))))))
"Alist mapping Tramp syntax to regexps matching methods identifiers.")
(defun tramp-build-method-regexp ()
@ -938,7 +935,7 @@ Used in `tramp-make-tramp-file-name'.")
(defun tramp-build-postfix-method-regexp ()
"Return `tramp-postfix-method-regexp'."
(tramp-compat-rx (literal (tramp-build-postfix-method-format))))
(rx (literal (tramp-build-postfix-method-format))))
(defvar tramp-postfix-method-regexp nil ; Init'd when defining `tramp-syntax'!
"Regexp matching delimiter between method and user or host names.
@ -950,8 +947,7 @@ Derived from `tramp-postfix-method-format'.")
(defconst tramp-prefix-domain-format "%"
"String matching delimiter between user and domain names.")
(defconst tramp-prefix-domain-regexp
(tramp-compat-rx (literal tramp-prefix-domain-format))
(defconst tramp-prefix-domain-regexp (rx (literal tramp-prefix-domain-format))
"Regexp matching delimiter between user and domain names.
Derived from `tramp-prefix-domain-format'.")
@ -959,7 +955,7 @@ Derived from `tramp-prefix-domain-format'.")
"Regexp matching domain names.")
(defconst tramp-user-with-domain-regexp
(tramp-compat-rx
(rx
(group (regexp tramp-user-regexp))
(regexp tramp-prefix-domain-regexp)
(group (regexp tramp-domain-regexp)))
@ -969,8 +965,7 @@ Derived from `tramp-prefix-domain-format'.")
"String matching delimiter between user and host names.
Used in `tramp-make-tramp-file-name'.")
(defconst tramp-postfix-user-regexp
(tramp-compat-rx (literal tramp-postfix-user-format))
(defconst tramp-postfix-user-regexp (rx (literal tramp-postfix-user-format))
"Regexp matching delimiter between user and host names.
Derived from `tramp-postfix-user-format'.")
@ -993,7 +988,7 @@ Used in `tramp-make-tramp-file-name'.")
(defun tramp-build-prefix-ipv6-regexp ()
"Return `tramp-prefix-ipv6-regexp'."
(tramp-compat-rx (literal tramp-prefix-ipv6-format)))
(rx (literal tramp-prefix-ipv6-format)))
(defvar tramp-prefix-ipv6-regexp nil ; Initialized when defining `tramp-syntax'!
"Regexp matching left hand side of IPv6 addresses.
@ -1021,7 +1016,7 @@ Used in `tramp-make-tramp-file-name'.")
(defun tramp-build-postfix-ipv6-regexp ()
"Return `tramp-postfix-ipv6-regexp'."
(tramp-compat-rx (literal tramp-postfix-ipv6-format)))
(rx (literal tramp-postfix-ipv6-format)))
(defvar tramp-postfix-ipv6-regexp nil ; Initialized when defining `tramp-syntax'!
"Regexp matching right hand side of IPv6 addresses.
@ -1030,8 +1025,7 @@ Derived from `tramp-postfix-ipv6-format'.")
(defconst tramp-prefix-port-format "#"
"String matching delimiter between host names and port numbers.")
(defconst tramp-prefix-port-regexp
(tramp-compat-rx (literal tramp-prefix-port-format))
(defconst tramp-prefix-port-regexp (rx (literal tramp-prefix-port-format))
"Regexp matching delimiter between host names and port numbers.
Derived from `tramp-prefix-port-format'.")
@ -1039,7 +1033,7 @@ Derived from `tramp-prefix-port-format'.")
"Regexp matching port numbers.")
(defconst tramp-host-with-port-regexp
(tramp-compat-rx
(rx
(group (regexp tramp-host-regexp))
(regexp tramp-prefix-port-regexp)
(group (regexp tramp-port-regexp)))
@ -1048,8 +1042,7 @@ Derived from `tramp-prefix-port-format'.")
(defconst tramp-postfix-hop-format "|"
"String matching delimiter after ad-hoc hop definitions.")
(defconst tramp-postfix-hop-regexp
(tramp-compat-rx (literal tramp-postfix-hop-format))
(defconst tramp-postfix-hop-regexp (rx (literal tramp-postfix-hop-format))
"Regexp matching delimiter after ad-hoc hop definitions.
Derived from `tramp-postfix-hop-format'.")
@ -1069,7 +1062,7 @@ Used in `tramp-make-tramp-file-name'.")
(defun tramp-build-postfix-host-regexp ()
"Return `tramp-postfix-host-regexp'."
(tramp-compat-rx (literal tramp-postfix-host-format)))
(rx (literal tramp-postfix-host-format)))
(defvar tramp-postfix-host-regexp nil ; Initialized when defining `tramp-syntax'!
"Regexp matching delimiter between host names and localnames.
@ -1096,7 +1089,7 @@ Derived from `tramp-postfix-host-format'.")
(defun tramp-build-remote-file-name-spec-regexp ()
"Construct a regexp matching a Tramp file name for a Tramp syntax.
It is expected, that `tramp-syntax' has the proper value."
(tramp-compat-rx
(rx
;; Method.
(group (regexp tramp-method-regexp)) (regexp tramp-postfix-method-regexp)
;; Optional user. This includes domain.
@ -1118,7 +1111,7 @@ It is expected, that `tramp-syntax' has the proper value."
It is expected, that `tramp-syntax' has the proper value.
See `tramp-file-name-structure'."
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(? (group (+ (regexp tramp-remote-file-name-spec-regexp)
(regexp tramp-postfix-hop-regexp))))
@ -1178,11 +1171,9 @@ initial value is overwritten by the car of `tramp-file-name-structure'.")
;; `tramp-method-regexp' needs at least two characters, in order to
;; distinguish from volume letter. This is in the way when completing.
(defconst tramp-completion-method-regexp-alist
`((default . ,(tramp-compat-rx
(| (literal tramp-default-method-marker) (+ alnum))))
`((default . ,(rx (| (literal tramp-default-method-marker) (+ alnum))))
(simplified . "")
(separate . ,(tramp-compat-rx
(| (literal tramp-default-method-marker) (* alnum)))))
(separate . ,(rx (| (literal tramp-default-method-marker) (* alnum)))))
"Alist mapping Tramp syntax to regexps matching completion methods.")
(defun tramp-build-completion-method-regexp ()
@ -1198,8 +1189,8 @@ The `ftp' syntax does not support methods.")
"Return `tramp-completion-file-name-regexp' according to `tramp-syntax'."
(if (eq tramp-syntax 'separate)
;; FIXME: This shouldn't be necessary.
(tramp-compat-rx bos "/" (? "[" (* (not "]"))) eos)
(tramp-compat-rx
(rx bos "/" (? "[" (* (not "]"))) eos)
(rx
bos
;; `file-name-completion' uses absolute paths for matching.
;; This means that on W32 systems, something like
@ -1402,20 +1393,6 @@ based on the Tramp and Emacs versions, and should not be set here."
:version "26.1"
:type '(repeat string))
(defcustom tramp-completion-reread-directory-timeout 10
"Defines seconds since last remote command before rereading a directory.
A remote directory might have changed its contents. In order to
make it visible during file name completion in the minibuffer,
Tramp flushes its cache and rereads the directory contents when
more than `tramp-completion-reread-directory-timeout' seconds
have been gone since last remote command execution. A value of t
would require an immediate reread during filename completion, nil
means to use always cached values for the directory contents."
:type '(choice (const nil) (const t) integer))
(make-obsolete-variable
'tramp-completion-reread-directory-timeout
'remote-file-name-inhibit-cache "27.2")
;;; Internal Variables:
(defvar tramp-current-connection nil
@ -1525,8 +1502,7 @@ same connection. Make a copy in order to avoid side effects."
(setq vec (copy-tramp-file-name vec))
(setf (tramp-file-name-localname vec)
(and (stringp localname)
(tramp-compat-file-name-unquote
(directory-file-name localname)))
(file-name-unquote (directory-file-name localname)))
(tramp-file-name-hop vec) nil))
vec))
@ -1559,7 +1535,7 @@ entry does not exist, return nil."
;; The localname can be quoted with "/:". Extract this.
(defun tramp-file-name-unquote-localname (vec)
"Return unquoted localname component of VEC."
(tramp-compat-file-name-unquote (tramp-file-name-localname vec)))
(file-name-unquote (tramp-file-name-localname vec)))
;;;###tramp-autoload
(defun tramp-tramp-file-p (name)
@ -1597,7 +1573,7 @@ of `process-file', `start-file-process', or `shell-command'."
;; The localname can be quoted with "/:". Extract this.
(defun tramp-unquote-file-local-name (name)
"Return unquoted localname of NAME."
(tramp-compat-file-name-unquote (tramp-file-local-name name)))
(file-name-unquote (tramp-file-local-name name)))
(defun tramp-find-method (method user host)
"Return the right method string to use depending on USER and HOST.
@ -1759,7 +1735,7 @@ See `tramp-dissect-file-name' for details."
(let ((v (tramp-dissect-file-name
(concat tramp-prefix-format
(replace-regexp-in-string
(tramp-compat-rx (regexp tramp-postfix-hop-regexp) eos)
(rx (regexp tramp-postfix-hop-regexp) eos)
tramp-postfix-host-format name))
nodefault)))
;; Only some methods from tramp-sh.el do support multi-hops.
@ -1855,8 +1831,7 @@ the form (METHOD USER DOMAIN HOST PORT LOCALNAME &optional HOP)."
(replace-regexp-in-string
tramp-prefix-regexp ""
(replace-regexp-in-string
(tramp-compat-rx
(regexp tramp-postfix-host-regexp) eos)
(rx (regexp tramp-postfix-host-regexp) eos)
tramp-postfix-hop-format
(tramp-make-tramp-file-name vec 'noloc)))))
@ -1986,7 +1961,7 @@ of `current-buffer'."
;; Also, in `font-lock-defaults' you can specify a function name for
;; the "KEYWORDS" part, so font-lock calls it to get the actual keywords!
'(list
(tramp-compat-rx bol (regexp tramp-debug-outline-regexp) (+ nonl))
(rx bol (regexp tramp-debug-outline-regexp) (+ nonl))
'(1 font-lock-warning-face t t)
'(0 (outline-font-lock-face) keep t))
"Used for highlighting Tramp debug buffers in `outline-mode'.")
@ -2400,7 +2375,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user',
(let* ((parameters (cdr reporter))
(message (aref parameters 3)))
(when (tramp-compat-string-search message (or (current-message) ""))
(tramp-compat-progress-reporter-update reporter value suffix))))
(progress-reporter-update reporter value suffix))))
(defmacro with-tramp-progress-reporter (vec level message &rest body)
"Execute BODY, spinning a progress reporter with MESSAGE in interactive mode.
@ -2438,13 +2413,12 @@ locally on a remote file name. When the local system is a W32 system
but the remote system is Unix, this introduces a superfluous drive
letter into the file name. This function removes it."
(save-match-data
(let ((quoted (tramp-compat-file-name-quoted-p name 'top))
(result (tramp-compat-file-name-unquote name 'top)))
(let ((quoted (file-name-quoted-p name 'top))
(result (file-name-unquote name 'top)))
(setq result
(replace-regexp-in-string
(tramp-compat-rx (regexp tramp-volume-letter-regexp) "/")
"/" result))
(if quoted (tramp-compat-file-name-quote result 'top) result))))
(rx (regexp tramp-volume-letter-regexp) "/") "/" result))
(if quoted (file-name-quote result 'top) result))))
;;; Config Manipulation Functions:
@ -2552,7 +2526,7 @@ coding system might not be determined. This function repairs it."
;; We found a matching entry in `file-coding-system-alist'.
;; So we add a similar entry, but with the temporary file name
;; as regexp.
(push (cons (tramp-compat-rx (literal tmpname)) (cdr elt)) result)))))
(push (cons (rx (literal tmpname)) (cdr elt)) result)))))
(defun tramp-run-real-handler (operation args)
"Invoke normal file name handler for OPERATION.
@ -2602,15 +2576,13 @@ Must be handled by the callers."
file-name-nondirectory file-name-sans-versions
file-notify-add-watch file-ownership-preserved-p
file-readable-p file-regular-p file-remote-p
file-selinux-context file-symlink-p file-truename
file-writable-p find-backup-file-name get-file-buffer
insert-directory insert-file-contents load
make-directory set-file-acl set-file-modes
file-selinux-context file-symlink-p file-system-info
file-truename file-writable-p find-backup-file-name
get-file-buffer insert-directory insert-file-contents
load make-directory set-file-acl set-file-modes
set-file-selinux-context set-file-times
substitute-in-file-name unhandled-file-name-directory
vc-registered
;; Emacs 27+ only.
file-system-info
;; Emacs 28- only.
make-directory-internal
;; Emacs 28+ only.
@ -2653,10 +2625,8 @@ Must be handled by the callers."
(if (bufferp (nth 0 args)) (nth 0 args) (current-buffer))))
;; COMMAND.
((member operation
'(make-nearby-temp-file process-file shell-command
start-file-process temporary-file-directory
;; Emacs 27+ only.
exec-path make-process
'(exec-path make-nearby-temp-file make-process process-file
shell-command start-file-process temporary-file-directory
;; Emacs 29+ only.
list-system-processes memory-info process-attributes))
default-directory)
@ -2837,7 +2807,7 @@ remote file names."
#'file-name-sans-extension
(directory-files
dir nil (rx bos "tramp" (+ nonl) ".el" (? "c") eos)))))
(files-regexp (tramp-compat-rx bol (regexp (regexp-opt files)) eol)))
(files-regexp (rx bol (regexp (regexp-opt files)) eol)))
(mapatoms
(lambda (atom)
(when (and (functionp atom)
@ -2874,7 +2844,7 @@ remote file names."
(put #'tramp-completion-file-name-handler 'operations
(mapcar #'car tramp-completion-file-name-handler-alist))
;; Integrated in Emacs 27.
;; After unloading, `tramp-archive-enabled' might not be defined.
(when (bound-and-true-p tramp-archive-enabled)
(add-to-list 'file-name-handler-alist
(cons tramp-archive-file-name-regexp
@ -2983,7 +2953,7 @@ not in completion mode."
;; Suppress hop from completion.
(when (string-match
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (+ (regexp tramp-remote-file-name-spec-regexp)
(regexp tramp-postfix-hop-regexp))))
@ -3076,14 +3046,14 @@ They are collected by `tramp-completion-dissect-file-name1'."
(let (;; "/method" "/[method"
(tramp-completion-file-name-structure1
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (? (regexp tramp-completion-method-regexp))) eol)
1 nil nil nil))
;; "/method:user" "/[method/user"
(tramp-completion-file-name-structure2
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
@ -3092,7 +3062,7 @@ They are collected by `tramp-completion-dissect-file-name1'."
;; "/method:host" "/[method/host"
(tramp-completion-file-name-structure3
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
@ -3101,7 +3071,7 @@ They are collected by `tramp-completion-dissect-file-name1'."
;; "/method:[ipv6" "/[method/ipv6"
(tramp-completion-file-name-structure4
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
@ -3111,7 +3081,7 @@ They are collected by `tramp-completion-dissect-file-name1'."
;; "/method:user@host" "/[method/user@host"
(tramp-completion-file-name-structure5
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
@ -3122,7 +3092,7 @@ They are collected by `tramp-completion-dissect-file-name1'."
;; "/method:user@[ipv6" "/[method/user@ipv6"
(tramp-completion-file-name-structure6
(list
(tramp-compat-rx
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
@ -3255,7 +3225,7 @@ Either user or host may be nil."
Either user or host may be nil."
(let (result
(regexp
(tramp-compat-rx
(rx
bol (group (regexp tramp-host-regexp))
(? (+ blank) (group (regexp tramp-user-regexp))))))
(when (re-search-forward regexp (line-end-position) t)
@ -3271,8 +3241,7 @@ User is always nil."
(defun tramp-parse-shosts-group ()
"Return a (user host) tuple allowed to access.
User is always nil."
(tramp-parse-group
(tramp-compat-rx bol (group (regexp tramp-host-regexp))) 1 ","))
(tramp-parse-group (rx bol (group (regexp tramp-host-regexp))) 1 ","))
(defun tramp-parse-sconfig (filename)
"Return a list of (user host) tuples allowed to access.
@ -3283,7 +3252,7 @@ User is always nil."
"Return a (user host) tuple allowed to access.
User is always nil."
(tramp-parse-group
(tramp-compat-rx
(rx
(| (: bol (* blank) "Host")
(: bol (+ nonl)) ;; ???
(group (regexp tramp-host-regexp))))
@ -3308,15 +3277,14 @@ User is always nil."
User is always nil."
(tramp-parse-shostkeys-sknownhosts
dirname
(tramp-compat-rx
bol "key_" (+ digit) "_" (group (regexp tramp-host-regexp)) ".pub" eol)))
(rx bol "key_" (+ digit) "_" (group (regexp tramp-host-regexp)) ".pub" eol)))
(defun tramp-parse-sknownhosts (dirname)
"Return a list of (user host) tuples allowed to access.
User is always nil."
(tramp-parse-shostkeys-sknownhosts
dirname
(tramp-compat-rx
(rx
bol (group (regexp tramp-host-regexp)) ".ssh-" (| "dss" "rsa") ".pub" eol)))
(defun tramp-parse-hosts (filename)
@ -3328,8 +3296,7 @@ User is always nil."
"Return a (user host) tuple allowed to access.
User is always nil."
(tramp-parse-group
(tramp-compat-rx
bol (group (| (regexp tramp-ipv6-regexp) (regexp tramp-host-regexp))))
(rx bol (group (| (regexp tramp-ipv6-regexp) (regexp tramp-host-regexp))))
1 (rx blank)))
(defun tramp-parse-passwd (filename)
@ -3348,7 +3315,7 @@ Host is always \"localhost\"."
"Return a (user host) tuple allowed to access.
Host is always \"localhost\"."
(let (result
(regexp (tramp-compat-rx bol (group (regexp tramp-user-regexp)) ":")))
(regexp (rx bol (group (regexp tramp-user-regexp)) ":")))
(when (re-search-forward regexp (line-end-position) t)
(setq result (list (match-string 1) "localhost")))
(forward-line 1)
@ -3399,14 +3366,13 @@ User is always nil."
(tramp-parse-putty-group registry-or-dirname)))))
;; UNIX case.
(tramp-parse-shostkeys-sknownhosts
registry-or-dirname
(tramp-compat-rx bol (group (regexp tramp-host-regexp)) eol))))
registry-or-dirname (rx bol (group (regexp tramp-host-regexp)) eol))))
(defun tramp-parse-putty-group (registry)
"Return a (user host) tuple allowed to access.
User is always nil."
(let (result
(regexp (tramp-compat-rx (literal registry) "\\" (group (+ nonl)))))
(regexp (rx (literal registry) "\\" (group (+ nonl)))))
(when (re-search-forward regexp (line-end-position) t)
(setq result (list nil (match-string 1))))
(forward-line 1)
@ -3828,8 +3794,7 @@ Let-bind it when necessary.")
;; not support tilde expansion. But users could declare a
;; respective connection property. (Bug#53847)
(when (string-match
(tramp-compat-rx bos "~" (group (* (not "/"))) (group (* nonl)) eos)
localname)
(rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) localname)
(let ((uname (match-string 1 localname))
(fname (match-string 2 localname))
hname)
@ -3990,9 +3955,7 @@ Let-bind it when necessary.")
(and
completion-ignored-extensions
(string-match-p
(tramp-compat-rx
(regexp (regexp-opt completion-ignored-extensions)) eos)
x)
(rx (regexp (regexp-opt completion-ignored-extensions)) eos) x)
;; We remember the hit.
(push x hits-ignored-extensions))))))
;; No match. So we try again for ignored files.
@ -4023,18 +3986,11 @@ Let-bind it when necessary.")
((not (file-exists-p file2)) t)
;; Tramp reads and writes timestamps on second level. So we round
;; the timestamps to seconds without fractions.
;; `time-convert' has been introduced with Emacs 27.1.
((fboundp 'time-convert)
(time-less-p
(tramp-compat-funcall
'time-convert
(file-attribute-modification-time (file-attributes file2)) 'integer)
(tramp-compat-funcall
'time-convert
(file-attribute-modification-time (file-attributes file1)) 'integer)))
(t (time-less-p
(file-attribute-modification-time (file-attributes file2))
(file-attribute-modification-time (file-attributes file1))))))
(time-convert
(file-attribute-modification-time (file-attributes file2)) 'integer)
(time-convert
(file-attribute-modification-time (file-attributes file1)) 'integer)))))
(defun tramp-handle-file-readable-p (filename)
"Like `file-readable-p' for Tramp files."
@ -4097,9 +4053,8 @@ Let-bind it when necessary.")
(if (directory-name-p filename) #'file-name-as-directory #'identity)
;; Quote properly.
(funcall
(if (tramp-compat-file-name-quoted-p filename)
#'tramp-compat-file-name-quote #'identity)
(let ((result (tramp-compat-file-name-unquote (expand-file-name filename)))
(if (file-name-quoted-p filename) #'file-name-quote #'identity)
(let ((result (file-name-unquote (expand-file-name filename)))
(numchase 0)
;; Don't make the following value larger than necessary.
;; People expect an error message in a timely fashion when
@ -4123,7 +4078,7 @@ Let-bind it when necessary.")
v2
(if (stringp symlink-target)
(if (file-remote-p symlink-target)
(tramp-compat-file-name-quote symlink-target 'top)
(file-name-quote symlink-target 'top)
(tramp-drop-volume-letter
(expand-file-name
symlink-target
@ -4433,53 +4388,49 @@ Parsing the remote \"ps\" output is controlled by
It is not guaranteed, that all process attributes as described in
`process-attributes' are returned. The additional attribute
`pid' shall be returned always."
;; Since Emacs 27.1.
(when (fboundp 'connection-local-criteria-for-default-directory)
(with-tramp-file-property vec "/" "process-attributes"
(ignore-errors
(with-temp-buffer
(hack-connection-local-variables-apply
(connection-local-criteria-for-default-directory))
;; (pop-to-buffer (current-buffer))
(when (zerop
(apply
#'process-file
"ps" nil t nil tramp-process-attributes-ps-args))
(let (result res)
(goto-char (point-min))
(while (not (eobp))
;; (tramp-test-message
;; "%s" (buffer-substring (point) (line-end-position)))
(when (save-excursion
(search-forward-regexp
(rx digit) (line-end-position) 'noerror))
(setq res nil)
(dolist (elt tramp-process-attributes-ps-format)
(push
(cons
(car elt)
(cond
((eq (cdr elt) 'number) (read (current-buffer)))
((eq (cdr elt) 'string)
(search-forward-regexp (rx (+ (not blank))))
(match-string 0))
((numberp (cdr elt))
(search-forward-regexp (rx (+ blank)))
(search-forward-regexp
(rx (+ nonl)) (+ (point) (cdr elt)))
(string-trim (match-string 0)))
((fboundp (cdr elt))
(funcall (cdr elt)))
((null (cdr elt))
(search-forward-regexp (rx (+ blank)))
(buffer-substring (point) (line-end-position)))))
res))
;; `nice' could be `-'.
(setq res (rassq-delete-all '- res))
(push (append res) result))
(forward-line))
;; Return result.
result)))))))
(with-tramp-file-property vec "/" "process-attributes"
(ignore-errors
(with-temp-buffer
(hack-connection-local-variables-apply
(connection-local-criteria-for-default-directory))
;; (pop-to-buffer (current-buffer))
(when (zerop
(apply
#'process-file "ps" nil t nil tramp-process-attributes-ps-args))
(let (result res)
(goto-char (point-min))
(while (not (eobp))
;; (tramp-test-message
;; "%s" (buffer-substring (point) (line-end-position)))
(when (save-excursion
(search-forward-regexp
(rx digit) (line-end-position) 'noerror))
(setq res nil)
(dolist (elt tramp-process-attributes-ps-format)
(push
(cons
(car elt)
(cond
((eq (cdr elt) 'number) (read (current-buffer)))
((eq (cdr elt) 'string)
(search-forward-regexp (rx (+ (not blank))))
(match-string 0))
((numberp (cdr elt))
(search-forward-regexp (rx (+ blank)))
(search-forward-regexp (rx (+ nonl)) (+ (point) (cdr elt)))
(string-trim (match-string 0)))
((fboundp (cdr elt))
(funcall (cdr elt)))
((null (cdr elt))
(search-forward-regexp (rx (+ blank)))
(buffer-substring (point) (line-end-position)))))
res))
;; `nice' could be `-'.
(setq res (rassq-delete-all '- res))
(push (append res) result))
(forward-line))
;; Return result.
result))))))
(defun tramp-handle-list-system-processes ()
"Like `list-system-processes' for Tramp files."
@ -4640,9 +4591,9 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.")
tramp-prefix-format proxy tramp-postfix-host-format))
(entry
(list (and (stringp host-port)
(tramp-compat-rx bol (literal host-port) eol))
(rx bol (literal host-port) eol))
(and (stringp user-domain)
(tramp-compat-rx bol (literal user-domain) eol))
(rx bol (literal user-domain) eol))
(propertize proxy 'tramp-ad-hoc t))))
(tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
;; Add the hop.
@ -4715,13 +4666,14 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.")
(or
;; The host name is used for the remote shell command.
(member
'("%h") (tramp-get-method-parameter item 'tramp-login-args))
"%h" (flatten-tree
(tramp-get-method-parameter item 'tramp-login-args)))
;; The host name must match previous hop.
(string-match-p previous-host host))
(setq tramp-default-proxies-alist saved-tdpa)
(tramp-user-error
vec "Host name `%s' does not match `%s'" host previous-host))
(setq previous-host (tramp-compat-rx bol (literal host) eol)))))
(setq previous-host (rx bol (literal host) eol)))))
;; Result.
target-alist))
@ -4735,7 +4687,7 @@ substitution. SPEC-LIST is a list of char/value pairs used for
(let ((args (tramp-get-method-parameter vec parameter))
(spec (apply 'format-spec-make spec-list)))
;; Expand format spec.
(tramp-compat-flatten-tree
(flatten-tree
(mapcar
(lambda (x)
(setq x (mapcar (lambda (y) (format-spec y spec)) x))
@ -4872,9 +4824,8 @@ substitution. SPEC-LIST is a list of char/value pairs used for
(setq
login-args
(append
(tramp-compat-flatten-tree
(tramp-get-method-parameter v 'tramp-async-args))
(tramp-compat-flatten-tree
(flatten-tree (tramp-get-method-parameter v 'tramp-async-args))
(flatten-tree
(mapcar
(lambda (x) (split-string x " "))
(tramp-expand-args
@ -5076,19 +5027,11 @@ support symbolic links."
(when current-buffer-p
(barf-if-buffer-read-only)
(push-mark nil t))
;; `shell-command-save-pos-or-erase' has been introduced with
;; Emacs 27.1.
(if (fboundp 'shell-command-save-pos-or-erase)
(tramp-compat-funcall
'shell-command-save-pos-or-erase current-buffer-p)
(setq buffer-read-only nil)
(erase-buffer)))
(shell-command-save-pos-or-erase current-buffer-p))
(if (integerp asynchronous)
(let ((tramp-remote-process-environment
;; `async-shell-command-width' has been introduced with
;; Emacs 27.1.
(if (natnump (bound-and-true-p async-shell-command-width))
(if (natnump async-shell-command-width)
(cons (format "COLUMNS=%d"
(bound-and-true-p async-shell-command-width))
tramp-remote-process-environment)
@ -5139,11 +5082,7 @@ support symbolic links."
(goto-char (prog1 (mark t)
(set-marker (mark-marker) (point)
(current-buffer))))
;; `shell-command-set-point-after-cmd' has been
;; introduced with Emacs 27.1.
(if (fboundp 'shell-command-set-point-after-cmd)
(tramp-compat-funcall
'shell-command-set-point-after-cmd)))
(shell-command-set-point-after-cmd))
;; There's some output, display it.
(when (with-current-buffer output-buffer (> (point-max) (point-min)))
(display-message-or-buffer output-buffer)))))))
@ -5151,10 +5090,7 @@ support symbolic links."
(defun tramp-handle-start-file-process (name buffer program &rest args)
"Like `start-file-process' for Tramp files.
BUFFER might be a list, in this case STDERR is separated."
;; `make-process' knows the `:file-handler' argument since Emacs
;; 27.1 only. Therefore, we invoke it via `tramp-file-name-handler'.
(tramp-file-name-handler
'make-process
(make-process
:name name
:buffer (if (consp buffer) (car buffer) buffer)
:command (and program (cons program args))
@ -5167,7 +5103,7 @@ BUFFER might be a list, in this case STDERR is separated."
"Like `substitute-in-file-name' for Tramp files.
\"//\" and \"/~\" substitute only in the local filename part."
;; Check, whether the local part is a quoted file name.
(if (tramp-compat-file-name-quoted-p filename)
(if (file-name-quoted-p filename)
filename
;; First, we must replace environment variables.
(setq filename (tramp-replace-environment-variables filename))
@ -5198,6 +5134,12 @@ BUFFER might be a list, in this case STDERR is separated."
(defconst tramp-time-doesnt-exist '(-1 65535)
"An invalid time value, used as \"Doesn't exist\" value.")
(defsubst tramp-defined-time (time)
"Return TIME or nil (when TIME is not a time spec)."
(unless (or (time-equal-p time tramp-time-doesnt-exist)
(time-equal-p time tramp-time-dont-know))
time))
(defun tramp-handle-set-visited-file-modtime (&optional time-list)
"Like `set-visited-file-modtime' for Tramp files."
(unless (buffer-file-name)
@ -5209,7 +5151,7 @@ BUFFER might be a list, in this case STDERR is separated."
(or (file-attribute-modification-time
(file-attributes (buffer-file-name)))
tramp-time-doesnt-exist))))
(unless (tramp-compat-time-equal-p time-list tramp-time-dont-know)
(unless (time-equal-p time-list tramp-time-dont-know)
(tramp-run-real-handler #'set-visited-file-modtime (list time-list))))
(defun tramp-handle-verify-visited-file-modtime (&optional buf)
@ -5235,14 +5177,13 @@ of."
(cond
;; File exists, and has a known modtime.
((and attr
(not (tramp-compat-time-equal-p modtime tramp-time-dont-know)))
((and attr (not (time-equal-p modtime tramp-time-dont-know)))
(< (abs (tramp-time-diff modtime mt)) 2))
;; Modtime has the don't know value.
(attr t)
;; If file does not exist, say it is not modified if and
;; only if that agrees with the buffer's record.
(t (tramp-compat-time-equal-p mt tramp-time-doesnt-exist))))))))
(t (time-equal-p mt tramp-time-doesnt-exist))))))))
(defun tramp-handle-write-region
(start end filename &optional append visit lockname mustbenew)
@ -5439,7 +5380,7 @@ Wait, until the connection buffer changes."
;; Hide message in buffer.
(narrow-to-region (point-max) (point-max))
;; Wait for new output.
(while (not (tramp-compat-ignore-error file-error
(while (not (ignore-error file-error
(tramp-wait-for-regexp
proc 0.1 tramp-security-key-confirmed-regexp)))
(when (tramp-check-for-regexp proc tramp-security-key-timeout-regexp)
@ -5771,8 +5712,7 @@ the remote host use line-endings as defined in the variable
(tramp-flush-directory-properties vec "/"))
(when (buffer-live-p buf)
(with-current-buffer buf
(when (and prompt
(tramp-search-regexp (tramp-compat-rx (literal prompt))))
(when (and prompt (tramp-search-regexp (rx (literal prompt))))
(delete-region (point) (point-max))))))))
(defun tramp-get-inode (vec)
@ -5957,9 +5897,7 @@ ID-FORMAT valid values are `string' and `integer'."
(with-tramp-connection-property nil (format "gid-%s" id-format)
(cond
((equal id-format 'integer) (group-gid))
;; `group-name' has been introduced with Emacs 27.1.
((and (fboundp 'group-name) (equal id-format 'string))
(tramp-compat-funcall 'group-name (group-gid)))
((equal id-format 'string) (group-name (group-gid)))
((file-attribute-group-id (file-attributes "~/" id-format))))))
(defun tramp-get-local-locale (&optional vec)
@ -5976,7 +5914,7 @@ VEC is used for tracing."
(while candidates
(goto-char (point-min))
(if (string-match-p
(tramp-compat-rx bol (literal (car candidates)) (? "\r") eol)
(rx bol (literal (car candidates)) (? "\r") eol)
(buffer-string))
(setq locale (car candidates)
candidates nil)
@ -6307,7 +6245,7 @@ this file, if that variable is non-nil."
("|" . "__")
("[" . "_l")
("]" . "_r"))
(tramp-compat-file-name-unquote (buffer-file-name)))
(file-name-unquote (buffer-file-name)))
tramp-auto-save-directory)))
result)
(prog1 ;; Run plain `make-auto-save-file-name'.
@ -6336,7 +6274,7 @@ ALIST is of the form ((FROM . TO) ...)."
(let* ((pr (car alist))
(from (car pr))
(to (cdr pr)))
(while (string-match (tramp-compat-rx (literal from)) string)
(while (string-match (rx (literal from)) string)
(setq string (replace-match to t t string)))
(setq alist (cdr alist))))
string))
@ -6571,7 +6509,7 @@ T1 and T2 are time values (as returned by `current-time' for example)."
Suppress `shell-file-name'. This is needed on w32 systems, which
would use a wrong quoting for local file names. See `w32-shell-name'."
(let (shell-file-name)
(shell-quote-argument (tramp-compat-file-name-unquote s))))
(shell-quote-argument (file-name-unquote s))))
;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
;; does not deal well with newline characters. Newline is replaced by
@ -6604,7 +6542,7 @@ Only works for Bourne-like shells."
(string= (substring result 0 2) "\\~"))
(setq result (substring result 1)))
(replace-regexp-in-string
(tramp-compat-rx "\\" (literal tramp-rsh-end-of-line))
(rx "\\" (literal tramp-rsh-end-of-line))
(format "'%s'" tramp-rsh-end-of-line) result)))))
;;; Signal handling. This works for remote processes, which have set

Some files were not shown because too many files have changed in this diff Show more