commit abeb29bfcc68c578f11d59dcc1522738d493770a (HEAD, refs/remotes/origin/master) Merge: 39b77970c61 9d410f8de64 Author: Stefan Kangas Date: Sat Jan 7 06:30:10 2023 +0100 Merge from origin/emacs-29 9d410f8de64 (treesit-simple-indent-presets): Ensure 'and' works for a... ff66a5d324b (treesit--indent-rules-optimize): Optimize 'and' and 'or'... f2ebe43362c (treesit-simple-indent-presets): Short-circuit 'and' and ... 2ea6ee5cbfa (font-lock-regexp-face): New face 5ab03bcc433 Unify the string interpolation delimiters face across ts ... 92e8c0c091c ruby-ts-mode: Highlight more kinds of parameters 7420b6dcc37 Fix `pr-interface' 699711786ac Further generic-related improvements in csharp-ts-mode (b... # Conflicts: # etc/NEWS commit 39b77970c6155d7d2f1ffd1f9d609ec94ade3165 Author: Paul Eggert Date: Fri Jan 6 17:59:11 2023 -0800 Port to current Gnulib file-has-acl * lib-src/Makefile.in (FILE_HAS_ACL_LIB): Rename from LIB_HAS_ACL, to adjust to recent Gnulib renaming. All uses changed. diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index b246d832943..3f144401d65 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -199,7 +199,7 @@ LIB_GETRANDOM = ## Whatever libraries are needed for euidaccess LIB_EACCESS=@LIB_EACCESS@ ## 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@ @@ -426,7 +426,8 @@ pop.o: 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) $(LIB_EACCESS) $(FILE_HAS_ACL_LIB) $(LIBS_ECLIENT) \ + -o $@ emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \ commit 9e98ff562b4b8f2dae92bd4c64d15934c7d5877f Author: Paul Eggert Date: Fri Jan 6 17:53:54 2023 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/build-aux/config.guess b/build-aux/config.guess index b30b9fdc8ef..980b0208381 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -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 diff --git a/build-aux/config.sub b/build-aux/config.sub index 9e118bdee3c..baf1512b3c0 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -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 diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 7c4520637a7..3cccf01d958 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -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 -} - -% \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. + \turnoffactive +} + +\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,109 +11643,120 @@ % 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. - -% \otherbackslash defines an active \ to be a literal `\' character with -% catcode other. -@gdef@otherbackslash{@let\=@realbackslash} - -% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. -% -{@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 - @let\=@ttbackslash - @setregularquotes - @unsepspaces - } -} +\def\ttbackslash{{\tt \ifmmode \mathchar29020 \else \backslashcurfont \fi}} +\let\backslashchar = \ttbackslash % \backslashchar{} is for user documents. -% 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}% +% 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{@fixbackslash@originalparsearg} + \let\originalparsearg\parsearg% + \def\parsearg{\loadconf\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% - %@par% +{\catcode`\^=7 \catcode13=13% +\gdef\enableemergencynewline{% + \gdef^^M{% + \par% + %\par% }}} -@gdef@fixbackslash{% - @ifx\@eatinput @let\ = @ttbackslash @fi - @catcode13=5 % regular end of line - @enableemergencynewline - @let@c=@comment - @let@parsearg@originalparsearg +% \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 - % - % 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. + \catcode`+=\active + \catcode`\_=\active % - @openin 1 texinfo.cnf - @ifeof 1 @else @input texinfo.cnf @fi - @closein 1 + \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. +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @turnoffactive + @let\=@ttbackslash + } +} % 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 diff --git a/lib/alloca.in.h b/lib/alloca.in.h index b9ce9ef5603..a1bb3d758dc 100644 --- a/lib/alloca.in.h +++ b/lib/alloca.in.h @@ -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 diff --git a/lib/attribute.h b/lib/attribute.h index 36b2978bb2c..130644d8798 100644 --- a/lib/attribute.h +++ b/lib/attribute.h @@ -32,7 +32,7 @@ #define _GL_ATTRIBUTE_H /* 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 diff --git a/lib/binary-io.h b/lib/binary-io.h index dd9829aa88d..6f4db253354 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -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 diff --git a/lib/c-ctype.h b/lib/c-ctype.h index 9d093f7f722..35ca83d7d43 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -5,8 +5,7 @@ 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 diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c index c90c6d6a09c..8a958dc4fd9 100644 --- a/lib/c-strcasecmp.c +++ b/lib/c-strcasecmp.c @@ -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 diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c index bc30ce0ffc4..4ca8c5f4001 100644 --- a/lib/c-strncasecmp.c +++ b/lib/c-strncasecmp.c @@ -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 diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c index 1d7db893731..359d497396c 100644 --- a/lib/careadlinkat.c +++ b/lib/careadlinkat.c @@ -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 diff --git a/lib/cloexec.c b/lib/cloexec.c index ba53d0020b1..e4cecbd2e8a 100644 --- a/lib/cloexec.c +++ b/lib/cloexec.c @@ -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 diff --git a/lib/close-stream.c b/lib/close-stream.c index b68b30e6ff0..ab686bac2ae 100644 --- a/lib/close-stream.c +++ b/lib/close-stream.c @@ -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 diff --git a/lib/diffseq.h b/lib/diffseq.h index ad3f258ab6b..dfaf4f295e8 100644 --- a/lib/diffseq.h +++ b/lib/diffseq.h @@ -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 diff --git a/lib/dup2.c b/lib/dup2.c index 1597d9d1e6e..7d197ca3123 100644 --- a/lib/dup2.c +++ b/lib/dup2.c @@ -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 diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index d0e11e631ca..b31a2ea2523 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -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; diff --git a/lib/filemode.h b/lib/filemode.h index d456cc585b3..15a8dcc3760 100644 --- a/lib/filemode.h +++ b/lib/filemode.h @@ -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 diff --git a/lib/filename.h b/lib/filename.h index a2400a9dfe3..ab77ca2df91 100644 --- a/lib/filename.h +++ b/lib/filename.h @@ -1,5 +1,5 @@ /* Basic filename support macros. - Copyright (C) 2001-2023 Free Software Foundation, Inc. + Copyright (C) 2001-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/fpending.c b/lib/fpending.c index df3cd85f3a6..afa840b8512 100644 --- a/lib/fpending.c +++ b/lib/fpending.c @@ -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 diff --git a/lib/fpending.h b/lib/fpending.h index fe310384f7e..5e860db6810 100644 --- a/lib/fpending.h +++ b/lib/fpending.h @@ -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 diff --git a/lib/fsusage.c b/lib/fsusage.c index 2be120a06de..f6f4b1c35fd 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -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 diff --git a/lib/getgroups.c b/lib/getgroups.c index 6a2bda8d71e..93829d3b15e 100644 --- a/lib/getgroups.c +++ b/lib/getgroups.c @@ -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 diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 37fcea0a76b..59b53e79980 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -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. diff --git a/lib/gettext.h b/lib/gettext.h index 582886f9f51..d0462c47e17 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -1,6 +1,6 @@ /* Convenience header for conditional use of GNU . - 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 diff --git a/lib/gettime.c b/lib/gettime.c index cfba830478e..f86cc4efbff 100644 --- a/lib/gettime.c +++ b/lib/gettime.c @@ -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 diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index 7207c851272..d896ec132b9 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -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 diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 9e2eaf51381..0b4e0458a3c 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -240,6 +240,7 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ 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@ @@ -675,6 +676,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 +685,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@ @@ -3104,7 +3107,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' \ diff --git a/lib/group-member.c b/lib/group-member.c index 6e3f640dcf0..96a09f94a8f 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -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 diff --git a/lib/limits.in.h b/lib/limits.in.h index ae46a5aa25f..eaeac472299 100644 --- a/lib/limits.in.h +++ b/lib/limits.in.h @@ -99,7 +99,7 @@ #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) # 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 _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) # 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 \ diff --git a/lib/malloc.c b/lib/malloc.c index 92f8c841cd7..3ade35cb63f 100644 --- a/lib/malloc.c +++ b/lib/malloc.c @@ -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 diff --git a/lib/malloc/scratch_buffer.h b/lib/malloc/scratch_buffer.h index 33fd2b29cd5..a9bdcadec21 100644 --- a/lib/malloc/scratch_buffer.h +++ b/lib/malloc/scratch_buffer.h @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2023 Free Software Foundation, Inc. + Copyright (C) 2015-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/malloc/scratch_buffer_grow.c b/lib/malloc/scratch_buffer_grow.c index a5e8f2f7230..9a5e4dbb1eb 100644 --- a/lib/malloc/scratch_buffer_grow.c +++ b/lib/malloc/scratch_buffer_grow.c @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2023 Free Software Foundation, Inc. + Copyright (C) 2015-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/malloc/scratch_buffer_grow_preserve.c b/lib/malloc/scratch_buffer_grow_preserve.c index c0b5d87b7e4..3fe5a0720ec 100644 --- a/lib/malloc/scratch_buffer_grow_preserve.c +++ b/lib/malloc/scratch_buffer_grow_preserve.c @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2023 Free Software Foundation, Inc. + Copyright (C) 2015-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/malloc/scratch_buffer_set_array_size.c b/lib/malloc/scratch_buffer_set_array_size.c index 24c39350ade..89c37a950e9 100644 --- a/lib/malloc/scratch_buffer_set_array_size.c +++ b/lib/malloc/scratch_buffer_set_array_size.c @@ -1,5 +1,5 @@ /* Variable-sized buffer with on-stack default allocation. - Copyright (C) 2015-2023 Free Software Foundation, Inc. + Copyright (C) 2015-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/md5-stream.c b/lib/md5-stream.c index ab48fe3261a..ba76792cbbe 100644 --- a/lib/md5-stream.c +++ b/lib/md5-stream.c @@ -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 diff --git a/lib/md5.c b/lib/md5.c index b1e139339f4..4a6accf28ff 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -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 diff --git a/lib/md5.h b/lib/md5.h index 3b0b4ff730f..f34e7cb8dfa 100644 --- a/lib/md5.h +++ b/lib/md5.h @@ -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 diff --git a/lib/memmem.c b/lib/memmem.c index 665815efb1a..c0b48c1b25d 100644 --- a/lib/memmem.c +++ b/lib/memmem.c @@ -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 diff --git a/lib/memrchr.c b/lib/memrchr.c index a34fc71f7da..c5b1fe8b2e3 100644 --- a/lib/memrchr.c +++ b/lib/memrchr.c @@ -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 diff --git a/lib/memset_explicit.c b/lib/memset_explicit.c index eabeb3ec2b8..6d21a5e8797 100644 --- a/lib/memset_explicit.c +++ b/lib/memset_explicit.c @@ -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 diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h index 709c36bdf56..170764eabc8 100644 --- a/lib/mktime-internal.h +++ b/lib/mktime-internal.h @@ -1,5 +1,5 @@ /* Internals of mktime and related functions - Copyright 2016-2023 Free Software Foundation, Inc. + Copyright 2016-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . diff --git a/lib/mktime.c b/lib/mktime.c index 94a4320e6ca..7dc9d67ef9d 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -1,5 +1,5 @@ /* Convert a 'struct tm' to a time_t value. - Copyright (C) 1993-2023 Free Software Foundation, Inc. + Copyright (C) 1993-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . diff --git a/lib/nanosleep.c b/lib/nanosleep.c index 6383115c0f1..3f295f49b5d 100644 --- a/lib/nanosleep.c +++ b/lib/nanosleep.c @@ -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 diff --git a/lib/regex.c b/lib/regex.c index 3beb0deb987..ff1176782e4 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2023 Free Software Foundation, Inc. + Copyright (C) 2002-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff --git a/lib/regex.h b/lib/regex.h index 9ef0252ffff..a7e0bd02757 100644 --- a/lib/regex.h +++ b/lib/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-2023 Free Software Foundation, Inc. + Copyright (C) 1985, 1989-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/save-cwd.h b/lib/save-cwd.h index f26319389c2..d089b0e2145 100644 --- a/lib/save-cwd.h +++ b/lib/save-cwd.h @@ -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 diff --git a/lib/sha1.c b/lib/sha1.c index 3f6d86a285c..80f0b7a3314 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -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 diff --git a/lib/sig2str.c b/lib/sig2str.c index 4f68cb7ca8a..c5219caaaed 100644 --- a/lib/sig2str.c +++ b/lib/sig2str.c @@ -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 diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 59cbea3d47d..8b5ef4bd2dd 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -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@ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 4c8aad76124..b79e5f70965 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1,7 +1,6 @@ /* A GNU-like . - 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 diff --git a/lib/string.in.h b/lib/string.in.h index 1e27deed982..b227a178873 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -59,10 +59,11 @@ #define _@GUARD_PREFIX@_STRING_H # include #endif -/* AIX 7.2 declares ffsl and ffsll in , not in . */ +/* AIX 7.2 and Android 13 declare ffsl and ffsll in , not in + . */ /* 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 #endif @@ -82,7 +83,14 @@ #define _@GUARD_PREFIX@_STRING_H 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 */ +# 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 diff --git a/lib/strtoimax.c b/lib/strtoimax.c index d8d74e8c699..f7977e28e64 100644 --- a/lib/strtoimax.c +++ b/lib/strtoimax.c @@ -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 diff --git a/lib/strtol.c b/lib/strtol.c index 6bc1f061877..d11269b2622 100644 --- a/lib/strtol.c +++ b/lib/strtol.c @@ -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. diff --git a/lib/strtoll.c b/lib/strtoll.c index 919b453984c..9fdfa19b220 100644 --- a/lib/strtoll.c +++ b/lib/strtoll.c @@ -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 diff --git a/lib/time_r.c b/lib/time_r.c index c8143a6900a..97be4fd0544 100644 --- a/lib/time_r.c +++ b/lib/time_r.c @@ -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 diff --git a/lib/timegm.c b/lib/timegm.c index b47025a0545..a1b19efc392 100644 --- a/lib/timegm.c +++ b/lib/timegm.c @@ -1,6 +1,6 @@ /* Convert UTC calendar time to simple time. Like mktime but assumes UTC. - Copyright (C) 1994-2023 Free Software Foundation, Inc. + Copyright (C) 1994-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/verify.h b/lib/verify.h index ff8438c9269..17d6e78c816 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -223,8 +223,15 @@ #define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ /* _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 + . */ +# define _Static_assert(R, ...) \ + _GL_VERIFY ((R), "static assertion failed", -) +# endif # endif # if (!defined static_assert \ && __STDC_VERSION__ < 202311 \ @@ -235,9 +242,8 @@ #define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ /* 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. - ), 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 diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h index 05ef7028137..5dbdfb5506a 100644 --- a/lib/xalloc-oversized.h +++ b/lib/xalloc-oversized.h @@ -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 diff --git a/m4/acl.m4 b/m4/acl.m4 index 98362858ce5..6c2db7d3203 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 - check for access control list (ACL) primitives -# serial 24 +# serial 25 # Copyright (C) 2002, 2004-2023 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -139,7 +139,10 @@ AC_DEFUN AC_MSG_WARN([AC_PACKAGE_NAME will be built without ACL support.]) fi fi - test -n "$gl_need_lib_has_acl" && LIB_HAS_ACL=$LIB_ACL + if test -n "$gl_need_lib_has_acl"; then + FILE_HAS_ACL_LIB=$LIB_ACL + LIB_HAS_ACL="$FILE_HAS_ACL_LIB" + fi AC_SUBST([LIB_ACL]) AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl], [Define to nonzero if you want access control list support.]) @@ -197,15 +200,18 @@ AC_DEFUN [gl_cv_getxattr_with_posix_acls=yes])]) fi if test "$gl_cv_getxattr_with_posix_acls" = yes; then - LIB_HAS_ACL= + FILE_HAS_ACL_LIB= AC_DEFINE([GETXATTR_WITH_POSIX_ACLS], 1, [Define to 1 if getxattr works with XATTR_NAME_POSIX_ACL_ACCESS and XATTR_NAME_POSIX_ACL_DEFAULT.]) else dnl Set gl_need_lib_has_acl to a nonempty value, so that any - dnl later gl_FUNC_ACL call will set LIB_HAS_ACL=$LIB_ACL. + dnl later gl_FUNC_ACL call will set FILE_HAS_ACL_LIB=$LIB_ACL. gl_need_lib_has_acl=1 - LIB_HAS_ACL=$LIB_ACL + FILE_HAS_ACL_LIB=$LIB_ACL fi + AC_SUBST([FILE_HAS_ACL_LIB]) + dnl For backward compatibility (e.g. coreutils still uses LIB_HAS_ACL). + LIB_HAS_ACL="$FILE_HAS_ACL_LIB" AC_SUBST([LIB_HAS_ACL]) ]) diff --git a/m4/alloca.m4 b/m4/alloca.m4 index 75851875910..c685fac918a 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,6 +1,6 @@ # alloca.m4 serial 21 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/d-type.m4 b/m4/d-type.m4 index 05eb8ac0cfa..3f63bbe78ee 100644 --- a/m4/d-type.m4 +++ b/m4/d-type.m4 @@ -5,8 +5,7 @@ dnl Check whether struct dirent has a member named d_type. dnl -# Copyright (C) 1997, 1999-2004, 2006, 2009-2023 Free Software -# Foundation, Inc. +# Copyright (C) 1997, 1999-2004, 2006, 2009-2023 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/dup2.m4 b/m4/dup2.m4 index 8a040d4c369..e1cc73e18db 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 @@ -1,6 +1,5 @@ #serial 27 -dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/extensions.m4 b/m4/extensions.m4 index 6596e7efc06..5336b8daf7e 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 @@ -1,4 +1,4 @@ -# serial 22 -*- Autoconf -*- +# serial 23 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc. @@ -31,7 +31,7 @@ # its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS # invocation occurs in gl_EARLY, not in gl_INIT. -m4_version_prereq([2.70.1], [], [ +m4_version_prereq([2.72], [], [ # AC_USE_SYSTEM_EXTENSIONS # ------------------------ @@ -113,11 +113,15 @@ AC_DEFUN_ONCE #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif @@ -187,6 +191,7 @@ AC_DEFUN_ONCE AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) AC_DEFINE([__STDC_WANT_LIB_EXT2__]) diff --git a/m4/filemode.m4 b/m4/filemode.m4 index 2fcc69d119b..3cafc5cd1e1 100644 --- a/m4/filemode.m4 +++ b/m4/filemode.m4 @@ -1,6 +1,5 @@ # filemode.m4 serial 9 -dnl Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index aeb3467a272..88f3ca817cb 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -1,8 +1,7 @@ # serial 35 # Obtaining file system usage information. -# Copyright (C) 1997-1998, 2000-2001, 2003-2023 Free Software -# Foundation, Inc. +# Copyright (C) 1997-1998, 2000-2001, 2003-2023 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/getgroups.m4 b/m4/getgroups.m4 index d5a18ea88b0..241fec88e3c 100644 --- a/m4/getgroups.m4 +++ b/m4/getgroups.m4 @@ -3,8 +3,7 @@ dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. -# Copyright (C) 1996-1997, 1999-2004, 2008-2023 Free Software -# Foundation, Inc. +# Copyright (C) 1996-1997, 1999-2004, 2008-2023 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index 7097e5dd512..79e420baae8 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -1,7 +1,7 @@ # Check for getloadavg. -# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2023 Free -# Software Foundation, Inc. +# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2023 Free Software +# Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 95111567d79..f2010c0213f 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,4 @@ -# getrandom.m4 serial 8 +# getrandom.m4 serial 9 dnl Copyright 2020-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,13 @@ AC_DEFUN([gl_FUNC_GETRANDOM], [ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([getrandom]) + gl_CHECK_FUNCS_ANDROID([getrandom], + [[/* Additional includes are needed before on uClibc + and Mac OS X. */ + #include + #include + #include + ]]) if test "$ac_cv_func_getrandom" != yes; then HAVE_GETRANDOM=0 else diff --git a/m4/gettime.m4 b/m4/gettime.m4 index 39067be6fa8..06f32fe26c2 100644 --- a/m4/gettime.m4 +++ b/m4/gettime.m4 @@ -1,6 +1,5 @@ # gettime.m4 serial 12 -dnl Copyright (C) 2002, 2004-2006, 2009-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2004-2006, 2009-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 66231e0174f..5051d61cc87 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,7 +1,6 @@ # serial 29 -# 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; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 138f498451d..26239caa2b1 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 74 +# gnulib-common.m4 serial 76 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -187,7 +187,14 @@ AC_DEFUN to use this earlier definition, since may not have been included yet. */ #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 */ +# 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_DEPRECATED: Declares that an entity is deprecated. @@ -309,7 +316,7 @@ AC_DEFUN - enumeration, enumeration item, - typedef, in C++ also: class. */ -/* In C++ and C2x, this is spelled [[__maybe_unused__]]. +/* In C++ and C23, this is spelled [[__maybe_unused__]]. GCC's syntax is __attribute__ ((__unused__)). clang supports both syntaxes. */ #ifdef __has_c_attribute @@ -1016,6 +1023,30 @@ AC_DEFUN m4_popdef([gl_header_name]) ]) +dnl gl_CHECK_FUNCS_ANDROID([func], [[#include ]]) +dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem +dnl on Android. +dnl Namely, if func was added to Android API level, say, 28, then the libc.so +dnl has the symbol func always, whereas the header file declares func +dnl conditionally: +dnl #if __ANDROID_API__ >= 28 +dnl ... func (...) __INTRODUCED_IN(28); +dnl #endif +dnl Thus, when compiling with "clang -target armv7a-unknown-linux-android28", +dnl the function func is declared and exists in libc. +dnl Whereas when compiling with "clang -target armv7a-unknown-linux-android27", +dnl the function func is not declared but exists in libc. We need to treat this +dnl case like the case where func does not exist. +AC_DEFUN([gl_CHECK_FUNCS_ANDROID], +[ + AC_CHECK_DECL([$1], , , [$2]) + if test $ac_cv_have_decl_[$1] = yes; then + AC_CHECK_FUNCS([$1]) + else + ac_cv_func_[$1]=no + fi +]) + dnl Expands to some code for use in .c programs that, on native Windows, defines dnl the Microsoft deprecated alias function names to the underscore-prefixed dnl actual function names. With this macro, these function names are available diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 6435bcd149c..ae5001c44b5 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -123,7 +123,6 @@ AC_DEFUN # Code from module intprops: # Code from module inttypes-incomplete: # Code from module largefile: - AC_REQUIRE([gl_YEAR2038_EARLY]) AC_REQUIRE([AC_SYS_LARGEFILE]) # Code from module lchmod: # Code from module libc-config: @@ -1544,6 +1543,5 @@ AC_DEFUN m4/warnings.m4 m4/wchar_t.m4 m4/wint_t.m4 - m4/year2038.m4 m4/zzgnulib.m4 ]) diff --git a/m4/group-member.m4 b/m4/group-member.m4 index 6e860c6189d..7c56ee3de7d 100644 --- a/m4/group-member.m4 +++ b/m4/group-member.m4 @@ -1,7 +1,6 @@ # serial 14 -# Copyright (C) 1999-2001, 2003-2007, 2009-2023 Free Software -# Foundation, Inc. +# Copyright (C) 1999-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/largefile.m4 b/m4/largefile.m4 index bc8a2b93534..7fb81b864af 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -12,8 +12,7 @@ # and ftello in C++ mode as well. # Fixed in Autoconf 2.72, which has AC_SYS_YEAR2038. AC_DEFUN([gl_SET_LARGEFILE_SOURCE], -[ - m4_ifndef([AC_SYS_YEAR2038], [ + m4_ifndef([AC_SYS_YEAR2038], [[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_FUNC_FSEEKO case "$host_os" in @@ -22,11 +21,10 @@ AC_DEFUN [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).]) ;; esac - ]) -]) + ]]) +) -# Work around a problem in Autoconf through 2.71 on glibc 2.34+ -# with _TIME_BITS. Also, work around a problem in autoconf <= 2.69: +# Work around a problem in autoconf <= 2.69: # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, # or configures them incorrectly in some cases. m4_version_prereq([2.70], [], [ @@ -46,34 +44,258 @@ m4_define ]) ])# m4_version_prereq 2.70 +# Support AC_SYS_YEAR2038, even if Autoconf 2.71 or earlier. +# This code is taken from Autoconf master. m4_ifndef([AC_SYS_YEAR2038], [ -# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, -# CACHE-VAR, -# DESCRIPTION, -# PROLOGUE, [FUNCTION-BODY]) -# -------------------------------------------------------- -m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], -[AC_CACHE_CHECK([for $1 value needed for large files], [$3], -[while :; do - m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([$5], [$6])], - [$3=no; break]) - m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([#undef $1 -#define $1 $2 -$5], [$6])], - [$3=$2; break]) - $3=unknown - break -done]) -case $$3 in #( - no | unknown) ;; - *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);; -esac -rm -rf conftest*[]dnl -])# _AC_SYS_LARGEFILE_MACRO_VALUE +# _AC_SYS_YEAR2038_TEST_CODE +# -------------------------- +# C code used to probe for time_t that can represent time points more +# than 2**31 - 1 seconds after the epoch. With the usual Unix epoch, +# these correspond to dates after 2038-01-18 22:14:07 +0000 (Gregorian), +# hence the name. +AC_DEFUN([_AC_SYS_YEAR2038_TEST_CODE], +[[ + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; +]]) + +# _AC_SYS_YEAR2038_OPTIONS +# ------------------------ +# List of known ways to enable support for large time_t. If you change +# this list you probably also need to change the AS_CASE at the end of +# _AC_SYS_YEAR2038_PROBE. +m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize( + ["none needed"] dnl 64-bit and newer 32-bit Unix + ["-D_TIME_BITS=64"] dnl glibc 2.34 with some 32-bit ABIs + ["-D__MINGW_USE_VC2005_COMPAT"] dnl 32-bit MinGW + ["-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"] + dnl 32-bit MinGW (misconfiguration) +)) + +# _AC_SYS_YEAR2038_PROBE([IF-NOT-DETECTED]) +# ----------------------------------------- +# Subroutine of AC_SYS_YEAR2038. Probe for time_t that can represent +# time points more than 2**31 - 1 seconds after the epoch (dates after +# 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts +# to one of the values in the _AC_SYS_YEAR2038_OPTIONS list, or to +# "support not detected" if none of them worked. Then, set compilation +# options and #defines as necessary to enable large time_t support. +# +# Note that we do not test whether mktime, localtime, etc. handle +# large values of time_t correctly, as that would require use of +# AC_TRY_RUN. Note also that some systems only support large time_t +# together with large off_t. +# +# If support is not detected, the behavior depends on which of the +# top-level AC_SYS_YEAR2038 macros was used (see below). +# +# If you change this macro you may also need to change +# _AC_SYS_YEAR2038_OPTIONS. +AC_DEFUN([_AC_SYS_YEAR2038_PROBE], +[AC_CACHE_CHECK([for $CC option to enable timestamps after Jan 2038], + [ac_cv_sys_year2038_opts], + [ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in _AC_SYS_YEAR2038_OPTIONS; do + AS_IF([test x"$ac_opt" != x"none needed"], + [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_YEAR2038_TEST_CODE])], + [ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes]) + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected"]) + +ac_have_year2038=yes +AS_CASE([$ac_cv_sys_year2038_opts], + ["none needed"], [], + ["support not detected"], + [ac_have_year2038=no + AS_CASE([$enable_year2038], + [yes], + [# If we're not cross compiling and 'touch' works with a large + # timestamp, then we can presume the system supports wider time_t + # *somehow* and we just weren't able to detect it. One common + # case that we deliberately *don't* probe for is a system that + # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers + # wide time_t. (It would be inappropriate for us to override an + # intentional use of -m32.) Error out, demanding use of + # --disable-year2038 if this is intentional. + AS_IF([test $cross_compiling = no], + [AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null], + [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`], + [*'Feb 7 2106'* | *'Feb 7 17:10'*], + [AC_MSG_FAILURE(m4_text_wrap( + [this system appears to support timestamps after January 2038, + but no mechanism for enabling wide 'time_t' was detected. + Did you mean to build a 64-bit binary? (e.g. 'CC="${CC} -m64"'.) + To proceed with 32-bit time_t, configure with '--disable-year2038'.], + [], [], [55]))])])])])], + + ["-D_TIME_BITS=64"], + [AC_DEFINE([_TIME_BITS], [64], + [Number of bits in time_t, on hosts where this is settable.])], + + ["-D__MINGW_USE_VC2005_COMPAT=1"], + [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1], + [Define to 1 on platforms where this makes time_t a 64-bit type.])], + + ["-U_USE_32_BIT_TIME_T"*], + [AC_MSG_FAILURE(m4_text_wrap( + [the 'time_t' type is currently forced to be 32-bit. + It will stop working after January 2038. + Remove _USE_32BIT_TIME_T from the compiler flags.], + [], [], [55]))], + + [AC_MSG_ERROR( + [internal error: bad value for \$ac_cv_sys_year2038_opts])]) +]) + +# _AC_SYS_YEAR2038_ENABLE +# ----------------------- +# Subroutine of AC_SYS_YEAR2038 and _AC_SYS_YEAR2038_OPT_IN. +# Depending on which of the YEAR2038 macros was used, add either an +# --enable-year2038, or a --disable-year2038, or no option at all to +# the configure script. Note that this is expanded very late and +# therefore there cannot be any code in the AC_ARG_ENABLE. The +# default value for enable_year2038 is emitted unconditionally +# because the generated code always looks at this variable. +m4_define([_AC_SYS_YEAR2038_ENABLE], +[m4_divert_text([DEFAULTS], + m4_provide_if([AC_SYS_YEAR2038], + [enable_year2038=yes], + [enable_year2038=no]))]dnl +[AC_ARG_ENABLE([year2038], + m4_provide_if([AC_SYS_YEAR2038], + [AS_HELP_STRING([--disable-year2038], + [do not support timestamps after 2038])], + [AS_HELP_STRING([--enable-year2038], + [support timestamps after 2038])]))]) + +# _AC_SYS_YEAR2038_OPT_IN +# ----------------------- +# If the --enable-year2038 option is given to configure, attempt to +# detect and activate support for large time_t on 32-bit systems. +# This macro is automatically invoked by AC_SYS_LARGEFILE when large +# *file* support is detected. It does not AC_REQUIRE AC_SYS_LARGEFILE +# to avoid a dependency loop, and is therefore unsafe to expose as a +# documented macro. +AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN], +[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl + AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE]) + AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE]) +])]) + +# AC_SYS_YEAR2038 +# --------------- +# Attempt to detect and activate support for large time_t. +# On systems where time_t is not always 64 bits, this probe can be +# skipped by passing the --disable-year2038 option to configure. +AC_DEFUN([AC_SYS_YEAR2038], +[AC_REQUIRE([AC_SYS_LARGEFILE])]dnl +[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl + AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE]) + AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE]) +])]) + +# _AC_SYS_LARGEFILE_TEST_CODE +# --------------------------- +# C code used to probe for large file support. +m4_define([_AC_SYS_LARGEFILE_TEST_CODE], +[@%:@include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]];[]dnl +]) + +# _AC_SYS_LARGEFILE_OPTIONS +# ------------------------- +# List of known ways to enable support for large files. If you change +# this list you probably also need to change the AS_CASE at the end of +# _AC_SYS_LARGEFILE_PROBE. +m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize( + ["none needed"] dnl Most current systems + ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec + ["-D_LARGE_FILES=1"] dnl AIX (which versions?) + ["-n32"] dnl Irix 6.2 w/ SGI compiler +)) + +# _AC_SYS_LARGEFILE_PROBE +# ----------------------- +# Subroutine of AC_SYS_LARGEFILE. Probe for large file support and set +# the cache variable ac_cv_sys_largefile_opts to one of the values in +# the _AC_SYS_LARGEFILE_OPTIONS list, or to "support not detected" if +# none of the options in that list worked. Then, set compilation +# options and #defines as necessary to enable large file support. +# +# If large file support is not detected, the behavior depends on which of +# the top-level AC_SYS_LARGEFILE macros was used (see below). +# +# If you change this macro you may also need to change +# _AC_SYS_LARGEFILE_OPTIONS. +AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], +[AC_CACHE_CHECK([for $CC option to enable large file support], + [ac_cv_sys_largefile_opts], + [ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do + AS_IF([test x"$ac_opt" != x"none needed"], + [CC="$ac_save_CC $ac_opt"]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])], + [ac_cv_sys_largefile_opts="$ac_opt" + ac_opt_found=yes]) + test $ac_opt_found = no || break + done + CC="$ac_save_CC" + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"]) + +ac_have_largefile=yes +AS_CASE([$ac_cv_sys_largefile_opts], + ["none needed"], [], + ["support not detected"], + [ac_have_largefile=no], + + ["-D_FILE_OFFSET_BITS=64"], + [AC_DEFINE([_FILE_OFFSET_BITS], [64], + [Number of bits in a file offset, on hosts where this is settable.])], + + ["-D_LARGE_FILES=1"], + [AC_DEFINE([_LARGE_FILES], [1], + [Define to 1 on platforms where this makes off_t a 64-bit type.])], + + ["-n32"], + [CC="$CC -n32"], + + [AC_MSG_ERROR( + [internal error: bad value for \$ac_cv_sys_largefile_opts])]) + +_AC_SYS_YEAR2038_OPT_IN +]) +# _AC_SYS_LARGEFILE_ENABLE +# ------------------------ +# Subroutine of AC_SYS_LARGEFILE. Note that this +# is expanded very late and therefore there cannot be any code in the +# AC_ARG_ENABLE. The default value for enable_largefile is emitted +# unconditionally because the generated shell code always looks at +# this variable. +m4_define([_AC_SYS_LARGEFILE_ENABLE], +[m4_divert_text([DEFAULTS], + enable_largefile=yes)]dnl +[AC_ARG_ENABLE([largefile], + [AS_HELP_STRING([--disable-largefile], [omit support for large files])])]) # AC_SYS_LARGEFILE # ---------------- @@ -84,44 +306,13 @@ m4_define # Additionally, on Linux file systems with 64-bit inodes a file that happens # to have a 64-bit inode number cannot be accessed by 32-bit applications on # Linux x86/x86_64. This can occur with file systems such as XFS and NFS. +# This macro allows configuration to continue if the system doesn't support +# large files. AC_DEFUN([AC_SYS_LARGEFILE], -[AC_ARG_ENABLE(largefile, - [ --disable-largefile omit support for large files]) -AS_IF([test "$enable_largefile" != no], - [AC_CACHE_CHECK([for special C compiler options needed for large files], - ac_cv_sys_largefile_CC, - [ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) - AC_COMPILE_IFELSE([], [break]) - CC="$CC -n32" - AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi]) - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.], - [_AC_SYS_LARGEFILE_TEST_INCLUDES]) - AS_CASE([$ac_cv_sys_file_offset_bits], - [unknown], - [_AC_SYS_LARGEFILE_MACRO_VALUE([_LARGE_FILES], [1], - [ac_cv_sys_large_files], - [Define for large files, on AIX-style hosts.], - [_AC_SYS_LARGEFILE_TEST_INCLUDES])], - [64], - [gl_YEAR2038_BODY([])])]) -])# AC_SYS_LARGEFILE +[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl + AS_IF([test "$enable_largefile" != no], [_AC_SYS_LARGEFILE_PROBE]) + AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE]) +])]) ])# m4_ifndef AC_SYS_YEAR2038 # Enable large files on systems where this is implemented by Gnulib, not by the diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4 index 3ac8a305bde..55bee2ab7a2 100644 --- a/m4/mempcpy.m4 +++ b/m4/mempcpy.m4 @@ -1,6 +1,6 @@ # mempcpy.m4 serial 12 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/memrchr.m4 b/m4/memrchr.m4 index ed750b7bdf1..7611ac7e3ac 100644 --- a/m4/memrchr.m4 +++ b/m4/memrchr.m4 @@ -1,6 +1,6 @@ # memrchr.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/memset_explicit.m4 b/m4/memset_explicit.m4 index 3d4dcb30955..9dcd89a758a 100644 --- a/m4/memset_explicit.m4 +++ b/m4/memset_explicit.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2022 Free Software Foundation, Inc. +dnl Copyright 2022-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 604dd766f5d..e9d31f35a46 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,6 +1,6 @@ # serial 37 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4 index 45b89f752a5..04c0b63fbd0 100644 --- a/m4/nstrftime.m4 +++ b/m4/nstrftime.m4 @@ -1,7 +1,6 @@ # serial 37 -# Copyright (C) 1996-1997, 1999-2007, 2009-2023 Free Software -# Foundation, Inc. +# Copyright (C) 1996-1997, 1999-2007, 2009-2023 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 index 5b7fa4242bc..6d47d2c026e 100644 --- a/m4/pathmax.m4 +++ b/m4/pathmax.m4 @@ -1,6 +1,6 @@ # pathmax.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/sig2str.m4 b/m4/sig2str.m4 index 7aad94a9616..aee18efeefd 100644 --- a/m4/sig2str.m4 +++ b/m4/sig2str.m4 @@ -1,6 +1,5 @@ # serial 7 -dnl Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 index 1b45e9557cc..1c12c33ea09 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,6 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/stat-time.m4 b/m4/stat-time.m4 index 5b6b8101098..40993d5731c 100644 --- a/m4/stat-time.m4 +++ b/m4/stat-time.m4 @@ -1,7 +1,7 @@ # Checks for stat-related time functions. -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free -# Software Foundation, Inc. +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free Software +# Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 94271e11e78..07569961f8b 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 59 +# stdio_h.m4 serial 61 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -82,6 +82,16 @@ AC_DEFUN_ONCE if test $ac_cv_have_decl_fcloseall = no; then HAVE_DECL_FCLOSEALL=0 fi + + AC_CHECK_DECLS_ONCE([getw]) + if test $ac_cv_have_decl_getw = no; then + HAVE_DECL_GETW=0 + fi + + AC_CHECK_DECLS_ONCE([putw]) + if test $ac_cv_have_decl_putw = no; then + HAVE_DECL_PUTW=0 + fi ]) # gl_STDIO_MODULE_INDICATOR([modulename]) @@ -178,7 +188,9 @@ AC_DEFUN HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) + HAVE_DECL_GETW=1; AC_SUBST([HAVE_DECL_GETW]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) + HAVE_DECL_PUTW=1; AC_SUBST([HAVE_DECL_PUTW]) HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) diff --git a/m4/strnlen.m4 b/m4/strnlen.m4 index 60e8d81bf3b..d2cac59b6f2 100644 --- a/m4/strnlen.m4 +++ b/m4/strnlen.m4 @@ -1,6 +1,6 @@ # strnlen.m4 serial 14 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 index 1c6ddd386a5..db5cfb7aa9d 100644 --- a/m4/strtoimax.m4 +++ b/m4/strtoimax.m4 @@ -1,6 +1,5 @@ # strtoimax.m4 serial 16 -dnl Copyright (C) 2002-2004, 2006, 2009-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002-2004, 2006, 2009-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index 1e042175b18..ede630c6061 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,6 +1,5 @@ # strtoll.m4 serial 9 -dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/time_h.m4 b/m4/time_h.m4 index fd4a469d192..f6bf3a4f30e 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -1,7 +1,6 @@ # Configure a more-standard replacement for . -# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software -# Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. # serial 20 diff --git a/m4/timespec.m4 b/m4/timespec.m4 index 354530319fe..95f475f2cc5 100644 --- a/m4/timespec.m4 +++ b/m4/timespec.m4 @@ -1,7 +1,6 @@ #serial 15 -# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software -# Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, commit 9d410f8de64e91d16999a9bb5dd884d6d06d22bd (refs/remotes/origin/emacs-29) Author: Dmitry Gutov Date: Sat Jan 7 03:28:38 2023 +0200 (treesit-simple-indent-presets): Ensure 'and' works for anchors too * lisp/treesit.el (treesit-simple-indent-presets): Rewrite to return the last successful evaluation, not just t. diff --git a/lisp/treesit.el b/lisp/treesit.el index 374c17c0894..11a78bddcd8 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1179,10 +1179,12 @@ treesit-simple-indent-presets ;; TODO: Document. (cons 'and (lambda (&rest fns) (lambda (node parent bol &rest _) - (not - (seq-find - (lambda (fn) (not (funcall fn node parent bol))) - fns))))) + (let (res) + (catch 'break + (dolist (fn fns) + (setq res (funcall fn node parent bol)) + (unless res (throw 'break t)))) + res)))) (cons 'or (lambda (&rest fns) (lambda (node parent bol &rest _) (seq-find commit ff66a5d324b6cc88db27f48f351f2cb5baa08fa2 Author: Dmitry Gutov Date: Sat Jan 7 02:44:07 2023 +0200 (treesit--indent-rules-optimize): Optimize 'and' and 'or' matcher forms * lisp/treesit.el (treesit--indent-rules-optimize): Optimize 'and' and 'or' matcher forms. When 'and' has a 'query' matcher inside (as is the case in ruby-ts--indent-rules, many times over), this yields a significant performance boost. diff --git a/lisp/treesit.el b/lisp/treesit.el index a85eb699ee1..374c17c0894 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1546,6 +1546,10 @@ treesit--indent-rules-optimize (pcase func (`(query ,qry) (list 'query (treesit-query-compile lang qry))) + (`(and . ,fns) + (cons 'and (mapcar #'optimize-func fns))) + (`(or . ,fns) + (cons 'or (mapcar #'optimize-func fns))) (_ func))) ;; Optimize a rule (MATCHER ANCHOR OFFSET). (optimize-rule (rule) commit f2ebe43362cab1b8d88674dad60b1ed3c822bb54 Author: Dmitry Gutov Date: Sat Jan 7 02:02:25 2023 +0200 (treesit-simple-indent-presets): Short-circuit 'and' and 'or' * lisp/treesit.el (treesit-simple-indent-presets): Short-circuit the 'and' and 'or' matchers. To avoid calling all fns after one returned nil or truthy value, respectively. diff --git a/lisp/treesit.el b/lisp/treesit.el index 987942c507a..a85eb699ee1 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1179,16 +1179,15 @@ treesit-simple-indent-presets ;; TODO: Document. (cons 'and (lambda (&rest fns) (lambda (node parent bol &rest _) - (cl-reduce (lambda (a b) (and a b)) - (mapcar (lambda (fn) - (funcall fn node parent bol)) - fns))))) + (not + (seq-find + (lambda (fn) (not (funcall fn node parent bol))) + fns))))) (cons 'or (lambda (&rest fns) (lambda (node parent bol &rest _) - (cl-reduce (lambda (a b) (or a b)) - (mapcar (lambda (fn) - (funcall fn node parent bol)) - fns))))) + (seq-find + (lambda (fn) (funcall fn node parent bol)) + fns)))) (cons 'not (lambda (fn) (lambda (node parent bol &rest _) (not (funcall fn node parent bol))))) commit 2f05f48918ecf6e59b330709b09a36f81f7b6c48 Author: Paul Eggert Date: Fri Jan 6 10:48:29 2023 -0800 Add new SI prefixes R, Q in other places * lisp/dired-x.el (dired-x--string-to-number, dired-mark-sexp): * lisp/dired.el (dired-re-inode-size): * lisp/files.el (directory-listing-before-filename-regexp): * src/xdisp.c (power_letter): * src/xdisp.c: Include stdint.h. Check that the prefixes suffice for ptrdiff_t. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 560eefae024..5780f1353ad 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -816,7 +816,7 @@ dired-do-run-mail (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 @@ dired-x--string-to-number (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 @@ dired-mark-sexp ;; 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) diff --git a/lisp/dired.el b/lisp/dired.el index 42d15f27a54..1f7dca802fd 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -530,7 +530,7 @@ dired-actual-switches (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 diff --git a/lisp/files.el b/lisp/files.el index 446c7610648..e1b7a990b15 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7645,7 +7645,7 @@ directory-listing-before-filename-regexp ;; 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 @@ directory-listing-before-filename-regexp ;; 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 "\\)" "\\) +"))) diff --git a/src/xdisp.c b/src/xdisp.c index 2e962b011a6..72d3bfa6398 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27621,7 +27621,9 @@ pint2str (register char *buf, register int width, register ptrdiff_t d) 'P', /* peta */ 'E', /* exa */ 'Z', /* zetta */ - 'Y' /* yotta */ + 'Y', /* yotta */ + 'R', /* ronna */ + 'Q' /* quetta */ }; static void commit 2ea6ee5cbfac5c5e9a1e27ddda2d88cdedc6a6eb Author: Dmitry Gutov Date: Fri Jan 6 19:56:20 2023 +0200 (font-lock-regexp-face): New face * lisp/font-lock.el (font-lock-regexp-face): New face. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): * lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): * lisp/progmodes/js.el (js--treesit-font-lock-settings): Use it for regexps. * etc/NEWS: Mention the addition. diff --git a/etc/NEWS b/etc/NEWS index 059278b08a1..5901b2718e9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -798,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'. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 74881a14ccf..99df8fb9e06 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2073,6 +2073,12 @@ font-lock-preprocessor-face "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." diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 90b9068fd5d..fe483f220da 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3498,7 +3498,7 @@ js--treesit-font-lock-settings :language 'javascript :feature 'string - '((regex pattern: (regex_pattern)) @font-lock-string-face + '((regex pattern: (regex_pattern)) @font-lock-regexp-face (string) @font-lock-string-face) :language 'javascript diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index bf09726b34f..5f5de500435 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -227,10 +227,8 @@ ruby-ts--font-lock-settings ;; Also before 'operator because % and / are operators :language language :feature 'regexp - ;; TODO: We probably need a separate face for regexps everywhere. - ;; Maybe another one for regexp delimiters as well. - '((regex "/" @font-lock-string-face) - (regex _ (string_content) @font-lock-string-face)) + '((regex "/" @font-lock-regexp-face) + (regex _ (string_content) @font-lock-regexp-face)) :language language :feature 'operator diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 4042e2b1013..5a9a7eea959 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -151,7 +151,7 @@ typescript-ts-mode--font-lock-settings :language language :override t :feature 'string - `((regex pattern: (regex_pattern)) @font-lock-string-face + `((regex pattern: (regex_pattern)) @font-lock-regexp-face (string) @font-lock-string-face (template_string) @js--fontify-template-string (template_substitution ["${" "}"] @font-lock-misc-punctuation-face)) commit 5ab03bcc433acbd0ce7126e40746efe092e0805a Author: Dmitry Gutov Date: Fri Jan 6 16:17:50 2023 +0200 Unify the string interpolation delimiters face across ts modes * lisp/progmodes/js.el (js--treesit-font-lock-settings): * lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Use font-lock-misc-punctuation-face for string interpolation delimiters. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 050472002bb..90b9068fd5d 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3505,7 +3505,7 @@ js--treesit-font-lock-settings :feature 'string-interpolation :override t '((template_string) @js--fontify-template-string - (template_substitution ["${" "}"] @font-lock-delimiter-face)) + (template_substitution ["${" "}"] @font-lock-misc-punctuation-face)) :language 'javascript :feature 'definition diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index 87fd4ae535f..bf09726b34f 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -259,8 +259,8 @@ ruby-ts--font-lock-settings :language language :feature 'interpolation - '((interpolation "#{" @font-lock-delimiter-face) - (interpolation "}" @font-lock-delimiter-face)) + '((interpolation "#{" @font-lock-misc-punctuation-face) + (interpolation "}" @font-lock-misc-punctuation-face)) :language language :feature 'type diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index e0583f4b05c..4042e2b1013 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -154,7 +154,7 @@ typescript-ts-mode--font-lock-settings `((regex pattern: (regex_pattern)) @font-lock-string-face (string) @font-lock-string-face (template_string) @js--fontify-template-string - (template_substitution ["${" "}"] @font-lock-builtin-face)) + (template_substitution ["${" "}"] @font-lock-misc-punctuation-face)) :language language :override t commit 92e8c0c091cdb67b27fa271814614ba4cab478d6 Author: Dmitry Gutov Date: Fri Jan 6 15:38:00 2023 +0200 ruby-ts-mode: Highlight more kinds of parameters * lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): Highlight destructured parameters, lambda parameters, identifiers in pattern matching clauses (array/hash) and exception variables. Move the 'symbol' matchers lower to make 'hash_key_symbol' lower priority than hash keys in match patterns. diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index 349318e7579..87fd4ae535f 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -215,13 +215,6 @@ ruby-ts--font-lock-settings (false) @font-lock-doc-markup-face (nil) @font-lock-doc-markup-face) - :language language - :feature 'symbol - '((bare_symbol) @font-lock-constant-face - (delimited_symbol (string_content) @font-lock-constant-face) - (hash_key_symbol) @font-lock-constant-face - (simple_symbol) @font-lock-constant-face) - ;; Before 'operator so (unary) works. :language language :feature 'literal @@ -303,7 +296,19 @@ ruby-ts--font-lock-settings (hash_splat_parameter name: (identifier) @font-lock-variable-name-face) (block_parameter - name: (identifier) @font-lock-variable-name-face)) + name: (identifier) @font-lock-variable-name-face) + (destructured_parameter + (identifier) @font-lock-variable-name-face) + (lambda_parameters + (identifier) @font-lock-variable-name-face) + (exception_variable + (identifier) @font-lock-variable-name-face) + (array_pattern + (identifier) @font-lock-variable-name-face) + (keyword_pattern + key: (hash_key_symbol) @font-lock-variable-name-face) + (in_clause + pattern: (identifier) @font-lock-variable-name-face)) ;; Yuan recommends also putting method definitions into the ;; 'function' category (thus keeping it in both). I've opted to @@ -322,6 +327,13 @@ ruby-ts--font-lock-settings (operator_assignment left: (identifier) @font-lock-variable-name-face)) + :language language + :feature 'symbol + '((bare_symbol) @font-lock-constant-face + (delimited_symbol (string_content) @font-lock-constant-face) + (hash_key_symbol) @font-lock-constant-face + (simple_symbol) @font-lock-constant-face) + :language language :feature 'error '((ERROR) @font-lock-warning-face) commit 6602ec3abc0804ce87d36908bca885e0b27758e5 Author: Michael Albinus Date: Fri Jan 6 13:34:33 2023 +0100 Remove Emacs 26 compatibility from Tramp * doc/misc/tramp.texi (Remote processes): Don't mention Emacs version. (Frequently Asked Questions): Adapt supported Emacs versions. * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.7.0-pre". * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p) (tramp-compat-file-name-quote, tramp-compat-file-name-unquote) (tramp-compat-tramp-syntax, tramp-compat-exec-path) (tramp-compat-time-equal-p, tramp-compat-flatten-tree) (tramp-compat-progress-reporter-update) (tramp-compat-ignore-error, tramp-compat-rx--transform-item) (tramp-compat-rx--transform, tramp-compat-rx): Remove. * lisp/net/tramp-adb.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-cache.el: * lisp/net/tramp-cmds.el: * lisp/net/tramp-crypt.el: * lisp/net/tramp-fuse.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-integration.el: * lisp/net/tramp-rclone.el: * lisp/net/tramp-sh.el: * lisp/net/tramp-smb.el: * lisp/net/tramp-sshfs.el: * lisp/net/tramp-sudoedit.el: * lisp/net/tramp.el: * lisp/net/trampver.el: Replace the removed `tramp-compat-*' items by their real definition. Don't use `tramp-compat-funcall' when not needed. Remove `with-no-warnings' and `ignore-errors' where appropriate. * lisp/net/tramp.el (tramp-file-name-for-operation): Rearrange list. (tramp-handle-file-newer-than-file-p): Simplify. (tramp-get-process-attributes): Don't check for existence of `connection-local-criteria-for-default-directory'. (tramp-handle-shell-command): Don't check for existence of `shell-command-save-pos-or-erase', `async-shell-command-width' and `shell-command-set-point-after-cmd'. (tramp-handle-start-file-process): Call `make-process' directly. (tramp-defined-time): New defsubst. (tramp-get-local-gid): Don't check for existence of `group-name'. * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times): Use `tramp-defined-time'. (tramp-adb-get-signal-strings): Don't bind `shell-file-name' and `shell-command-switch'. * lisp/net/tramp-archive.el (top, tramp-archive-file-name-handler): Don't bind `max-specpdl-size' any longer. (tramp-archive-autoload-file-name-regexp): Remove Emacs 26 specific code. (top): Don't call `tramp-register-archive-autoload-file-name-handler'. * lisp/net/tramp-gvfs.el (top): Don't bind `max-specpdl-size' any longer. (tramp-gvfs-handle-set-file-times): Use `tramp-defined-time'. * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times): Use `tramp-defined-time'. * test/lisp/net/tramp-archive-tests.el (tramp-archive--test-emacs27-p): Remove. (all): * test/lisp/net/tramp-tests.el (all): Don't skip for Emacs 26. Replace the removed `tramp-compat-*' items by their real definition. Don't use `tramp-compat-funcall' when not needed. Remove `with-no-warnings' and `ignore-errors' where appropriate. (with-connection-local-variables) (shell-command-dont-erase-buffer): Don't declare. (tramp-test10-write-region): Don't check for `make-empty-file'. (tramp-test32-shell-command): Simplify. (tramp-test34-explicit-shell-file-name): Don't protect `explicit-shell-file-name' any longer. (tramp--test-emacs27-p): Remove. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 56436d32970..a2c292dd5ad 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -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 @@ -3928,12 +3928,12 @@ Remote processes @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 +4824,8 @@ Frequently Asked Questions @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 diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index dce02933f2b..2f505c6acea 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -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 diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index bfa84007ac5..619d29bb4d6 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -71,14 +71,14 @@ tramp-adb-prompt "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 @@ tramp-adb-handle-directory-files-and-attributes (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 @@ tramp-adb-sh-fix-ls-output (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 @@ tramp-adb-sh-fix-ls-output (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 @@ tramp-adb-handle-file-local-copy ;; "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 @@ tramp-adb-handle-write-region "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 @@ tramp-adb-handle-set-file-modes (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 @@ tramp-adb-handle-copy-file (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 @@ tramp-adb-get-signal-strings "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 @@ tramp-adb-handle-process-file ;; 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 @@ tramp-adb-handle-make-process (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 @@ tramp-adb-execute-adb-command (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 @@ tramp-adb-send-command ;; 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 @@ tramp-adb-maybe-open-connection ;; 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)) diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 66447f0cb58..daf44a293a3 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -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 @@ tramp-archive-compression-suffixes ;; 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,25 +192,17 @@ tramp-archive-compression-suffixes (? "." (| ,@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 (defconst tramp-archive-file-name-regexp - (eval-when-compile (ignore-errors (tramp-archive-autoload-file-name-regexp))) + (eval-when-compile (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.") @@ -360,13 +336,9 @@ tramp-archive-file-name-handler (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 @@ tramp-archive-file-name-handler (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 @@ tramp-archive-file-name-handler (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 @@ tramp-archive-file-name-p "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 @@ tramp-archive-dissect-file-name ;; 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)))) diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 09e43a99039..c5864e7fa5e 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -267,8 +267,7 @@ tramp-flush-file-properties (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 @@ tramp-cache-read-persistent-data (provide 'tramp-cache) +;;; TODO: +;; +;; * Use multisession.el, starting with Emacs 29.1. + ;;; tramp-cache.el ends here diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index bf7d45d2a5a..dc967dccf68 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -359,7 +359,7 @@ 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 "Enter new Tramp connection: " dir default 'confirm init #'file-directory-p))))) @@ -470,7 +470,7 @@ tramp-rename-these-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 @@ tramp-reporter-dump-variable (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 \ diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index f176476a73a..6a2654ee474 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -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 @@ tramp-compat-make-temp-file 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 @@ 'tramp-compat-replace-regexp-in-region ;; ;; * 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 diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 0e033451af5..61d1c529619 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -146,7 +146,7 @@ tramp-crypt-file-name-p 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 @@ tramp-crypt-add-directory (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 @@ tramp-crypt-get-remote-dir (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 @@ tramp-crypt-handle-directory-files (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 @@ tramp-crypt-handle-file-ownership-preserved-p (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 @@ tramp-crypt-handle-insert-directory (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." diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index b73ec22f0c4..c8754e2b03d 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -69,15 +69,15 @@ tramp-fuse-handle-directory-files (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 @@ tramp-fuse-mounted-p (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 @@ tramp-fuse-unmount (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 @@ tramp-fuse-local-file-name (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) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 1a5303b4d5d..bb81b3eb66c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -414,7 +414,7 @@ tramp-goa-interface-account ;; (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 @@ tramp-gvfs-gio-mapping "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 @@ tramp-gvfs-file-system-attributes "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 @@ tramp-gvfs-nextcloud-default-prefix "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 @@ tramp-gvfs-handle-expand-file-name (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 @@ tramp-gvfs-handle-expand-file-name ;; 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 @@ tramp-gvfs-get-directory-attributes (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 @@ tramp-gvfs-get-directory-attributes (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 @@ tramp-gvfs-get-file-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 @@ tramp-gvfs-monitor-process-filter (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 @@ tramp-gvfs-monitor-process-filter (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 @@ tramp-gvfs-handle-set-file-times (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 @@ tramp-gvfs-activation-uri (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 @@ tramp-gvfs-file-name "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 @@ tramp-gvfs-connection-mounted-p (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 @@ tramp-gvfs-mount-spec (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 @@ tramp-gvfs-mount-spec (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 @@ tramp-gvfs-parse-device-names 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 for valid service types. @@ -2550,7 +2535,7 @@ tramp-gvfs-parse-device-names "mtp" (mapcar (lambda (method) `(tramp-parse-media-names ,(format "_%s._tcp" method))) - tramp-media-methods))))) + tramp-media-methods)))) (add-hook 'tramp-unload-hook (lambda () diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index cff0877555e..c7877c9824d 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -133,8 +133,7 @@ tramp-eshell-directory-change ;; 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 diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 2360abfb1dd..4018fa3aa29 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -337,7 +337,7 @@ tramp-rclone-handle-rename-file (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, diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f215cbc19ef..fbdd40dd1d2 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -411,7 +411,7 @@ tramp-use-scp-direct-remote-copying (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) @@ -1149,8 +1149,7 @@ tramp-sh-handle-make-symbolic-link ;; 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 @@ -1200,10 +1199,9 @@ tramp-sh-handle-file-truename (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" @@ -1243,7 +1241,7 @@ tramp-sh-handle-file-truename ;; 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))))))) @@ -1438,7 +1436,7 @@ tramp-sh-handle-set-visited-file-modtime (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 @@ -1478,9 +1476,7 @@ tramp-sh-handle-verify-visited-file-modtime (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 @@ -1497,7 +1493,7 @@ tramp-sh-handle-verify-visited-file-modtime 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." @@ -1519,21 +1515,17 @@ tramp-sh-handle-set-file-times "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. @@ -1631,7 +1623,7 @@ tramp-sh-handle-file-selinux-context (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))) ":" @@ -2389,10 +2381,10 @@ tramp-do-copy-or-rename-file-out-of-band #'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) @@ -2436,7 +2428,7 @@ tramp-do-copy-or-rename-file-out-of-band ;; `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)) @@ -2821,8 +2813,7 @@ tramp-sh-handle-expand-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)) @@ -2841,9 +2832,7 @@ tramp-sh-handle-expand-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) @@ -3235,7 +3224,7 @@ tramp-sh-handle-process-file ;; 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)) @@ -3916,7 +3905,7 @@ tramp-sh-gio-monitor-process-filter (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))) @@ -4019,66 +4008,55 @@ tramp-expand-script 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)) @@ -4339,8 +4317,7 @@ tramp-open-shell "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 @@ -4381,8 +4358,7 @@ tramp-find-shell (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 @@ -4421,7 +4397,7 @@ tramp-barf-if-no-shell-prompt (condition-case nil (tramp-wait-for-regexp proc timeout - (tramp-compat-rx + (rx (| (regexp shell-prompt-pattern) (regexp tramp-shell-prompt-pattern)) eos)) (error @@ -4808,7 +4784,7 @@ tramp-find-inline-encoding (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. @@ -4894,7 +4870,7 @@ tramp-find-inline-compress 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 @@ -4905,7 +4881,7 @@ tramp-find-inline-compress (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))) @@ -5250,7 +5226,7 @@ tramp-maybe-open-connection (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 @@ -5394,7 +5370,7 @@ tramp-wait-for-output ;; 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)) @@ -5402,7 +5378,7 @@ tramp-wait-for-output ;; 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)) @@ -5442,8 +5418,7 @@ tramp-send-command-and-check (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))) @@ -5613,7 +5588,7 @@ tramp-get-remote-path (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'") @@ -5663,8 +5638,7 @@ tramp-get-remote-locale (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))))) @@ -5742,7 +5716,7 @@ tramp-get-test-nt-command 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 diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 0c457565057..f31865d498d 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -53,7 +53,7 @@ tramp-smb-method ;;;###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 @@ tramp-smb-version "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 @@ tramp-smb-handle-expand-file-name (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 @@ tramp-smb-handle-insert-directory ;; 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. @@ -1198,8 +1196,7 @@ tramp-smb-handle-make-symbolic-link ;; 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) @@ -1244,7 +1241,7 @@ tramp-smb-handle-process-file ;; 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)) @@ -1552,7 +1549,7 @@ tramp-smb-handle-substitute-in-file-name \"//\" 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 "//". @@ -1603,8 +1600,7 @@ tramp-smb-get-share "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) @@ -1615,8 +1611,7 @@ tramp-smb-get-localname (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 @@ -1624,8 +1619,7 @@ tramp-smb-get-localname (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) ""))) @@ -1753,8 +1747,7 @@ tramp-smb-read-file-entry (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)) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index 2d3c436632f..27b2854e451 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -228,8 +228,7 @@ tramp-sshfs-handle-exec-path (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 @@ tramp-sshfs-handle-process-file ;; 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)) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 63946c2da30..c4e1d32f525 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -49,7 +49,7 @@ tramp-sudoedit-method (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 @@ tramp-sudoedit-handle-add-name-to-file (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 @@ tramp-sudoedit-handle-delete-directory (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 @@ tramp-sudoedit-handle-delete-file (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 @@ tramp-sudoedit-handle-expand-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 @@ tramp-sudoedit-handle-file-acl (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 @@ tramp-sudoedit-handle-file-attributes (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 @@ tramp-sudoedit-handle-file-executable-p (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 @@ tramp-sudoedit-handle-file-exists-p (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 @@ tramp-sudoedit-handle-file-name-all-completions (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 @@ tramp-sudoedit-handle-file-readable-p (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 @@ tramp-sudoedit-handle-set-file-modes (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 @@ tramp-sudoedit-handle-file-selinux-context (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 @@ tramp-sudoedit-handle-file-system-info (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 @@ tramp-sudoedit-handle-file-system-info (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 @@ tramp-sudoedit-handle-file-truename (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 @@ tramp-sudoedit-handle-file-truename ;; 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 @@ tramp-sudoedit-handle-file-writable-p ;; 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 @@ tramp-sudoedit-handle-make-directory (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 @@ tramp-sudoedit-handle-make-symbolic-link ;; 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 @@ tramp-sudoedit-handle-make-symbolic-link (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 @@ tramp-sudoedit-handle-set-file-acl (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 @@ tramp-sudoedit-handle-set-file-selinux-context (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 @@ tramp-sudoedit-send-command 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". diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 67a269ce50a..4bf0fdefc0b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -523,7 +523,7 @@ tramp-save-ad-hoc-proxies (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))) @@ -537,7 +537,7 @@ tramp-restricted-shell-hosts-alist ;;;###tramp-autoload (defcustom tramp-local-host-regexp - (tramp-compat-rx + (rx bos (| (literal tramp-system-name) (| "localhost" "localhost4" "localhost6" "127.0.0.1" "::1")) @@ -638,7 +638,7 @@ tramp-shell-prompt-pattern :type 'regexp) (defcustom tramp-password-prompt-regexp - (tramp-compat-rx + (rx bol (* nonl) (group (regexp (regexp-opt password-word-equivalents))) (* nonl) ":" (? "\^@") (* blank)) @@ -897,18 +897,17 @@ tramp-prefix-format (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 () @@ -936,7 +935,7 @@ tramp-postfix-method-format (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. @@ -948,8 +947,7 @@ tramp-user-regexp (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'.") @@ -957,7 +955,7 @@ tramp-domain-regexp "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))) @@ -967,8 +965,7 @@ tramp-postfix-user-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'.") @@ -991,7 +988,7 @@ tramp-prefix-ipv6-format (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. @@ -1019,7 +1016,7 @@ tramp-postfix-ipv6-format (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. @@ -1028,8 +1025,7 @@ tramp-postfix-ipv6-regexp (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'.") @@ -1037,7 +1033,7 @@ tramp-port-regexp "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))) @@ -1046,8 +1042,7 @@ tramp-host-with-port-regexp (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'.") @@ -1067,7 +1062,7 @@ tramp-postfix-host-format (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. @@ -1094,7 +1089,7 @@ tramp-root-id-integer (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. @@ -1116,7 +1111,7 @@ tramp-build-file-name-structure 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)))) @@ -1176,11 +1171,9 @@ tramp-volume-letter-regexp ;; `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 () @@ -1196,8 +1189,8 @@ tramp-build-completion-file-name-regexp "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 @@ -1509,8 +1502,7 @@ tramp-file-name-unify (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)) @@ -1543,7 +1535,7 @@ tramp-get-method-parameter ;; 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) @@ -1581,7 +1573,7 @@ tramp-file-local-name ;; 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. @@ -1743,7 +1735,7 @@ tramp-dissect-hop-name (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. @@ -1839,8 +1831,7 @@ tramp-make-tramp-hop-name (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))))) @@ -1970,7 +1961,7 @@ tramp-debug-font-lock-keywords ;; 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'.") @@ -2384,7 +2375,7 @@ tramp-progress-reporter-update (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. @@ -2422,13 +2413,12 @@ tramp-drop-volume-letter 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: @@ -2536,7 +2526,7 @@ tramp-find-file-name-coding-system-alist ;; 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. @@ -2586,15 +2576,13 @@ tramp-file-name-for-operation 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. @@ -2637,10 +2625,8 @@ tramp-file-name-for-operation (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) @@ -2821,7 +2807,7 @@ tramp-use-absolute-autoload-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) @@ -2858,7 +2844,7 @@ tramp-register-file-name-handlers (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 @@ -2967,7 +2953,7 @@ tramp-completion-handle-file-name-all-completions ;; 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)))) @@ -3060,14 +3046,14 @@ tramp-completion-dissect-file-name (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) @@ -3076,7 +3062,7 @@ tramp-completion-dissect-file-name ;; "/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) @@ -3085,7 +3071,7 @@ tramp-completion-dissect-file-name ;; "/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) @@ -3095,7 +3081,7 @@ tramp-completion-dissect-file-name ;; "/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) @@ -3106,7 +3092,7 @@ tramp-completion-dissect-file-name ;; "/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) @@ -3239,7 +3225,7 @@ tramp-parse-rhosts-group 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) @@ -3255,8 +3241,7 @@ tramp-parse-shosts (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. @@ -3267,7 +3252,7 @@ tramp-parse-sconfig-group "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)))) @@ -3292,15 +3277,14 @@ tramp-parse-shostkeys 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) @@ -3312,8 +3296,7 @@ tramp-parse-hosts-group "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) @@ -3332,7 +3315,7 @@ tramp-parse-passwd-group "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) @@ -3383,14 +3366,13 @@ tramp-parse-putty (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) @@ -3812,8 +3794,7 @@ tramp-handle-expand-file-name ;; 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) @@ -3974,9 +3955,7 @@ tramp-handle-file-name-completion (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. @@ -4007,18 +3986,11 @@ tramp-handle-file-newer-than-file-p ((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." @@ -4081,9 +4053,8 @@ tramp-handle-file-truename (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 @@ -4107,7 +4078,7 @@ tramp-handle-file-truename 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 @@ -4417,53 +4388,49 @@ tramp-get-process-attributes 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." @@ -4624,9 +4591,9 @@ tramp-add-hops 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. @@ -4699,14 +4666,14 @@ tramp-compute-multi-hops (or ;; The host name is used for the remote shell command. (member - "%h" (tramp-compat-flatten-tree + "%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)) @@ -4720,7 +4687,7 @@ tramp-expand-args (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)) @@ -4857,9 +4824,8 @@ tramp-handle-make-process (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 @@ -5061,19 +5027,11 @@ tramp-handle-shell-command (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) @@ -5124,11 +5082,7 @@ tramp-handle-shell-command (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))))))) @@ -5136,10 +5090,7 @@ tramp-handle-shell-command (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)) @@ -5152,7 +5103,7 @@ tramp-handle-substitute-in-file-name "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)) @@ -5183,6 +5134,12 @@ tramp-time-dont-know (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) @@ -5194,7 +5151,7 @@ tramp-handle-set-visited-file-modtime (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) @@ -5220,14 +5177,13 @@ tramp-handle-verify-visited-file-modtime (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) @@ -5424,7 +5380,7 @@ tramp-action-show-and-confirm-message ;; 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) @@ -5756,8 +5712,7 @@ tramp-process-sentinel (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) @@ -5942,9 +5897,7 @@ tramp-get-local-gid (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) @@ -5961,7 +5914,7 @@ tramp-get-local-locale (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) @@ -6292,7 +6245,7 @@ tramp-handle-make-auto-save-file-name ("|" . "__") ("[" . "_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'. @@ -6321,7 +6274,7 @@ tramp-subst-strs-in-string (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)) @@ -6556,7 +6509,7 @@ tramp-unquote-shell-quote-argument 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 @@ -6589,7 +6542,7 @@ tramp-shell-quote-argument (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 diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 7532c64f853..9b271a7cfbd 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,8 +7,8 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.6.0-pre -;; Package-Requires: ((emacs "26.1")) +;; Version: 2.7.0-pre +;; Package-Requires: ((emacs "27.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.6.0-pre" +(defconst tramp-version "2.7.0-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -55,11 +55,9 @@ tramp-repository-branch (dir (or (locate-dominating-file (locate-library "tramp") ".git") source-directory)) debug-on-error) - ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. - (with-no-warnings - (and (stringp dir) (file-directory-p dir) - (executable-find "git") - (emacs-repository-get-branch dir))))) + (and (stringp dir) (file-directory-p dir) + (executable-find "git") + (emacs-repository-get-branch dir)))) "The repository branch of the Tramp sources.") (defconst tramp-repository-version @@ -76,9 +74,9 @@ tramp-repository-version "The repository revision of the Tramp sources.") ;; Check for Emacs version. -(let ((x (if (not (string-version-lessp emacs-version "26.1")) +(let ((x (if (not (string-version-lessp emacs-version "27.1")) "ok" - (format "Tramp 2.6.0-pre is not fit for %s" + (format "Tramp 2.7.0-pre is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) @@ -104,7 +102,8 @@ tramp-inside-emacs ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2") ("2.3.5.26.3" . "26.3") ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2") - ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2"))) + ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2") + ("2.6.0.29.1" . "29.1"))) (add-hook 'tramp-unload-hook (lambda () diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 96c1e78e37a..85766f95cda 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -121,12 +121,6 @@ tramp-archive--test-delete (directory-files tmpfile 'full directory-files-no-dot-files-regexp)) (delete-directory tmpfile))) -(defun tramp-archive--test-emacs27-p () - "Check for Emacs version >= 27.1. -Some semantics has been changed for there, without new functions or -variables, so we check the Emacs version directly." - (>= emacs-major-version 27)) - (ert-deftest tramp-archive-test00-availability () "Test availability of archive file name functions." :expected-result (if tramp-archive-enabled :passed :failed) @@ -615,16 +609,13 @@ tramp-archive-test17-insert-directory (with-temp-buffer (insert-directory tramp-archive-test-archive nil) (goto-char (point-min)) - (should - (looking-at-p - (tramp-compat-rx (literal tramp-archive-test-archive))))) + (should (looking-at-p (rx (literal tramp-archive-test-archive))))) (with-temp-buffer (insert-directory tramp-archive-test-archive "-al") (goto-char (point-min)) (should (looking-at-p - (tramp-compat-rx - bol (+ nonl) blank (literal tramp-archive-test-archive) eol)))) + (rx bol (+ nonl) blank (literal tramp-archive-test-archive) eol)))) (with-temp-buffer (insert-directory (file-name-as-directory tramp-archive-test-archive) @@ -877,12 +868,8 @@ tramp-archive-test40-make-nearby-temp-file (ert-deftest tramp-archive-test43-file-system-info () "Check that `file-system-info' returns proper values." (skip-unless tramp-archive-enabled) - ;; Since Emacs 27.1. - (skip-unless (fboundp 'file-system-info)) - ;; `file-system-info' exists since Emacs 27. We don't want to see - ;; compiler warnings for older Emacsen. - (let ((fsi (with-no-warnings (file-system-info tramp-archive-test-archive)))) + (let ((fsi (file-system-info tramp-archive-test-archive))) (skip-unless fsi) (should (and (consp fsi) (= (length fsi) 3) @@ -895,8 +882,6 @@ tramp-archive-test47-auto-load "Check that `tramp-archive' autoloads properly." :tags '(:expensive-test) (skip-unless tramp-archive-enabled) - ;; Autoloading tramp-archive works since Emacs 27.1. - (skip-unless (tramp-archive--test-emacs27-p)) ;; tramp-archive is neither loaded at Emacs startup, nor when ;; loading a file like "/mock::foo" (which loads Tramp). @@ -919,7 +904,7 @@ tramp-archive-test47-auto-load (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo"))) (should (string-match - (tramp-compat-rx + (rx "tramp-archive loaded: " (literal (symbol-name (tramp-archive-file-name-p default-directory))) @@ -942,8 +927,6 @@ tramp-archive-test47-delay-load "Check that `tramp-archive' is loaded lazily, only when needed." :tags '(:expensive-test) (skip-unless tramp-archive-enabled) - ;; Autoloading tramp-archive works since Emacs 27.1. - (skip-unless (tramp-archive--test-emacs27-p)) ;; tramp-archive is neither loaded at Emacs startup, nor when ;; loading a file like "/foo.tar". It is loaded only when @@ -964,7 +947,7 @@ tramp-archive-test47-delay-load (dolist (tae '(t nil)) (should (string-match - (tramp-compat-rx + (rx "tramp-archive loaded: nil" (+ ascii) "tramp-archive loaded: nil" (+ ascii) "tramp-archive loaded: " (literal (symbol-name tae))) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 6fb9fa1fae9..90f6fcd6b15 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -74,14 +74,10 @@ tramp-persistency-file-name (defvar tramp-remote-path) (defvar tramp-remote-process-environment) -;; Needed for Emacs 26. -(declare-function with-connection-local-variables "files-x") ;; Needed for Emacs 27. (defvar lock-file-name-transforms) (defvar process-file-return-signal-string) (defvar remote-file-name-inhibit-locks) -(defvar shell-command-dont-erase-buffer) -;; Needed for Emacs 28. (defvar dired-copy-dereference) ;; `ert-resource-file' was introduced in Emacs 28.1. @@ -224,7 +220,7 @@ tramp--test-make-temp-name If QUOTED is non-nil, the local part of the file name is quoted. The temporary file is not created." (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (expand-file-name (make-temp-name "tramp-test") (if local temporary-file-directory ert-remote-temporary-file-directory)))) @@ -2296,10 +2292,9 @@ tramp-test07-abbreviate-file-name ;; Check `directory-abbrev-alist' abbreviation. (let ((directory-abbrev-alist - `((,(tramp-compat-rx bos (literal home-dir) "/foo") - . ,(concat home-dir "/f")) - (,(tramp-compat-rx bos (literal remote-host) "/nowhere") - . ,(concat remote-host "/nw"))))) + `((,(rx bos (literal home-dir) "/foo") . ,(concat home-dir "/f")) + (,(rx bos (literal remote-host) "/nowhere") + . ,(concat remote-host "/nw"))))) (should (equal (abbreviate-file-name (concat home-dir "/foo/bar")) (concat remote-host-nohop "~/f/bar"))) (should (equal (abbreviate-file-name @@ -2479,17 +2474,14 @@ tramp-test10-write-region (should (string-equal (buffer-string) "foo"))) ;; Write empty string. Used for creation of temporary files. - ;; Since Emacs 27.1. - (when (fboundp 'make-empty-file) - (with-no-warnings - (should-error - (make-empty-file tmp-name) - :type 'file-already-exists) - (delete-file tmp-name) - (make-empty-file tmp-name) - (with-temp-buffer - (insert-file-contents tmp-name) - (should (string-equal (buffer-string) ""))))) + (should-error + (make-empty-file tmp-name) + :type 'file-already-exists) + (delete-file tmp-name) + (make-empty-file tmp-name) + (with-temp-buffer + (insert-file-contents tmp-name) + (should (string-equal (buffer-string) ""))) ;; Write partly. (with-temp-buffer @@ -2511,8 +2503,7 @@ tramp-test10-write-region (string-match-p (if (and (null noninteractive) (or (eq visit t) (null visit) (stringp visit))) - (tramp-compat-rx - bol "Wrote " (literal tmp-name) "\n" eos) + (rx bol "Wrote " (literal tmp-name) "\n" eos) (rx bos)) tramp--test-messages)))))) @@ -2542,8 +2533,6 @@ tramp-test10-write-region-file-precious-flag "Check that `file-precious-flag' is respected with Tramp in use." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) - ;; The bug is fixed in Emacs 27.1. - (skip-unless (tramp--test-emacs27-p)) (let* ((tmp-name (tramp--test-make-temp-name)) (inhibit-message t) @@ -2626,10 +2615,7 @@ tramp-test11-copy-file "Check `copy-file'." (skip-unless (tramp--test-enabled)) - ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. - (dolist (quoted - (if (and (tramp--test-expensive-test-p) (tramp--test-emacs27-p)) - '(nil t) '(nil))) + (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) (tmp-name3 (tramp--test-make-temp-name 'local quoted))) @@ -2738,10 +2724,7 @@ tramp-test12-rename-file "Check `rename-file'." (skip-unless (tramp--test-enabled)) - ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. - (dolist (quoted - (if (and (tramp--test-expensive-test-p) (tramp--test-emacs27-p)) - '(nil t) '(nil))) + (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) (tmp-name3 (tramp--test-make-temp-name 'local quoted))) @@ -2925,13 +2908,11 @@ tramp-test14-delete-directory (delete-directory tmp-name1 'recursive) (should-not (file-directory-p tmp-name1)) - ;; Trashing directories works only since Emacs 27.1. It doesn't - ;; work when `system-move-file-to-trash' is defined (on MS - ;; Windows and macOS), for encrypted remote directories and for - ;; ange-ftp. + ;; Trashing directories doesn't work when + ;; `system-move-file-to-trash' is defined (on MS Windows and + ;; macOS), for encrypted remote directories and for ange-ftp. (when (and (not (fboundp 'system-move-file-to-trash)) - (not (tramp--test-crypt-p)) (not (tramp--test-ftp-p)) - (tramp--test-emacs27-p)) + (not (tramp--test-crypt-p)) (not (tramp--test-ftp-p))) (let ((trash-directory (tramp--test-make-temp-name 'local quoted)) (delete-by-moving-to-trash t)) (make-directory trash-directory) @@ -3200,9 +3181,6 @@ tramp-test17-insert-directory ;; (this is performed by `dired'). If FULL is nil, it shows just ;; one file. So we refrain from testing. (skip-unless (not (tramp--test-ange-ftp-p))) - ;; `insert-directory' of encrypted remote directories works only - ;; since Emacs 27.1. - (skip-unless (or (not (tramp--test-crypt-p)) (tramp--test-emacs27-p))) (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let* ((tmp-name1 @@ -3220,26 +3198,23 @@ tramp-test17-insert-directory (with-temp-buffer (insert-directory tmp-name1 nil) (goto-char (point-min)) - (should (looking-at-p (tramp-compat-rx (literal tmp-name1))))) + (should (looking-at-p (rx (literal tmp-name1))))) (with-temp-buffer (insert-directory (file-name-as-directory tmp-name1) nil) (goto-char (point-min)) (should - (looking-at-p - (tramp-compat-rx (literal (file-name-as-directory tmp-name1)))))) + (looking-at-p (rx (literal (file-name-as-directory tmp-name1)))))) (with-temp-buffer (insert-directory tmp-name1 "-al") (goto-char (point-min)) (should - (looking-at-p - (tramp-compat-rx bol (+ nonl) blank (literal tmp-name1) eol)))) + (looking-at-p (rx bol (+ nonl) blank (literal tmp-name1) eol)))) (with-temp-buffer (insert-directory (file-name-as-directory tmp-name1) "-al") (goto-char (point-min)) (should (looking-at-p - (tramp-compat-rx - bol (+ nonl) blank (literal tmp-name1) "/" eol)))) + (rx bol (+ nonl) blank (literal tmp-name1) "/" eol)))) (with-temp-buffer (insert-directory (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) @@ -3300,7 +3275,7 @@ tramp-test17-dired-with-wildcards (tmp-name4 (expand-file-name "bar" tmp-name2)) (ert-remote-temporary-file-directory (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) ert-remote-temporary-file-directory)) buffer) (unwind-protect @@ -3323,14 +3298,14 @@ tramp-test17-dired-with-wildcards (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx (literal (file-relative-name tmp-name1 ert-remote-temporary-file-directory))))) (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx (literal (file-relative-name tmp-name2 ert-remote-temporary-file-directory)))))) @@ -3345,14 +3320,14 @@ tramp-test17-dired-with-wildcards (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx (literal (file-relative-name tmp-name3 ert-remote-temporary-file-directory))))) (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx (literal (file-relative-name tmp-name4 @@ -3375,14 +3350,14 @@ tramp-test17-dired-with-wildcards (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx (literal (file-relative-name tmp-name3 ert-remote-temporary-file-directory))))) (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx (literal (file-relative-name tmp-name4 @@ -3552,7 +3527,7 @@ tramp-test18-file-attributes (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (file-attribute-type attr)) (file-remote-p (file-truename tmp-name1) 'localname))) (delete-file tmp-name2)) @@ -3616,9 +3591,6 @@ tramp--test-deftest-with-stat (cons '(nil "perl" nil) tramp-connection-properties))) (progn - ;; `ert-test-result-duration' exists since Emacs 27. It - ;; doesn't hurt to call it unconditionally, because - ;; `skip-unless' hides the error. (skip-unless (< (ert-test-result-duration result) 300)) (funcall (ert-test-body ert-test))) (ert-skip (format "Test `%s' must run before" ',test))))) @@ -3647,9 +3619,6 @@ tramp--test-deftest-with-perl (nil "id" nil)) tramp-connection-properties))) (progn - ;; `ert-test-result-duration' exists since Emacs 27. It - ;; doesn't hurt to call it unconditionally, because - ;; `skip-unless' hides the error. (skip-unless (< (ert-test-result-duration result) 300)) (funcall (ert-test-body ert-test))) (ert-skip (format "Test `%s' must run before" ',test))))) @@ -3676,9 +3645,6 @@ tramp--test-deftest-with-ls (nil "readlink" nil)) tramp-connection-properties))) (progn - ;; `ert-test-result-duration' exists since Emacs 27. It - ;; doesn't hurt to call it unconditionally, because - ;; `skip-unless' hides the error. (skip-unless (< (ert-test-result-duration result) 300)) (funcall (ert-test-body ert-test))) (ert-skip (format "Test `%s' must run before" ',test))))) @@ -3714,9 +3680,9 @@ tramp--test-file-attributes-equal-p ;; few seconds). We use a test start time minus 10 seconds, in ;; order to compensate a possible timestamp resolution higher than ;; a second on the remote machine. - (when (or (tramp-compat-time-equal-p + (when (or (time-equal-p (file-attribute-modification-time attr1) tramp-time-dont-know) - (tramp-compat-time-equal-p + (time-equal-p (file-attribute-modification-time attr2) tramp-time-dont-know)) (setcar (nthcdr 5 attr1) tramp-time-dont-know) (setcar (nthcdr 5 attr2) tramp-time-dont-know)) @@ -3727,9 +3693,9 @@ tramp--test-file-attributes-equal-p (float-time (file-attribute-modification-time attr2))) (setcar (nthcdr 5 attr2) tramp-time-dont-know)) ;; Status change time. Ditto. - (when (or (tramp-compat-time-equal-p + (when (or (time-equal-p (file-attribute-status-change-time attr1) tramp-time-dont-know) - (tramp-compat-time-equal-p + (time-equal-p (file-attribute-status-change-time attr2) tramp-time-dont-know)) (setcar (nthcdr 6 attr1) tramp-time-dont-know) (setcar (nthcdr 6 attr2) tramp-time-dont-know)) @@ -3868,7 +3834,7 @@ tramp-test20-file-modes (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) + (if quoted #'file-name-unquote #'identity) (file-remote-p tmp-name1 'localname)) (file-symlink-p tmp-name2))) ;; Both report the modes of `tmp-name1'. @@ -3938,7 +3904,7 @@ tramp-test21-file-links (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) + (if quoted #'file-name-unquote #'identity) (file-remote-p tmp-name1 'localname)) (file-symlink-p tmp-name2))) (when (tramp--test-expensive-test-p) @@ -3956,14 +3922,14 @@ tramp-test21-file-links (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) + (if quoted #'file-name-unquote #'identity) (file-remote-p tmp-name1 'localname)) (file-symlink-p tmp-name2)))) (make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists) (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) + (if quoted #'file-name-unquote #'identity) (file-remote-p tmp-name1 'localname)) (file-symlink-p tmp-name2))) ;; If we use the local part of `tmp-name1', it shall still work. @@ -3973,7 +3939,7 @@ tramp-test21-file-links (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) + (if quoted #'file-name-unquote #'identity) (file-remote-p tmp-name1 'localname)) (file-symlink-p tmp-name2))) ;; `tmp-name3' is a local file name. Therefore, the link @@ -3993,7 +3959,7 @@ tramp-test21-file-links (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) + (if quoted #'file-name-unquote #'identity) (file-remote-p tmp-name1 'localname)) (file-symlink-p tmp-name5))) ;; Check, that files in symlinked directories still work. @@ -4082,15 +4048,13 @@ tramp-test21-file-links "/[penguin/motd]" "/penguin:motd:"))) (delete-file tmp-name2) (make-symbolic-link - (funcall - (if quoted #'tramp-compat-file-name-unquote #'identity) penguin) + (funcall (if quoted #'file-name-unquote #'identity) penguin) tmp-name2) (should (file-symlink-p tmp-name2)) (should (string-equal (file-truename tmp-name2) - (tramp-compat-file-name-quote - (concat (file-remote-p tmp-name2) penguin))))) + (file-name-quote (concat (file-remote-p tmp-name2) penguin))))) ;; `tmp-name3' is a local file name. ;; `make-symbolic-link' might not be permitted on w32 systems. (unless (tramp--test-windows-nt-p) @@ -4102,7 +4066,7 @@ tramp-test21-file-links (should (string-equal (file-truename tmp-name1) - (tramp-compat-file-name-unquote (file-truename tmp-name3)))))) + (file-name-unquote (file-truename tmp-name3)))))) ;; Cleanup. (ignore-errors @@ -4175,7 +4139,7 @@ tramp-test21-file-links (let* ((dir1 (directory-file-name (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) ert-remote-temporary-file-directory))) (dir2 (file-name-as-directory dir1))) (should (string-equal (file-truename dir1) (expand-file-name dir1))) @@ -4204,12 +4168,12 @@ tramp-test22-file-times (skip-unless (set-file-times tmp-name1 (seconds-to-time 60))) ;; Dumb remote shells without perl(1) or stat(1) are not ;; able to return the date correctly. They say "don't know". - (unless (tramp-compat-time-equal-p + (unless (time-equal-p (file-attribute-modification-time (file-attributes tmp-name1)) tramp-time-dont-know) (should - (tramp-compat-time-equal-p + (time-equal-p (file-attribute-modification-time (file-attributes tmp-name1)) (seconds-to-time 60))) ;; Setting the time for not existing files shall fail. @@ -4228,7 +4192,7 @@ tramp-test22-file-times (with-no-warnings (set-file-times tmp-name1 (seconds-to-time 60) 'nofollow) (should - (tramp-compat-time-equal-p + (time-equal-p (file-attribute-modification-time (file-attributes tmp-name1)) (seconds-to-time 60))))))) @@ -4274,10 +4238,7 @@ tramp-test24-file-acl (skip-unless (file-acl ert-remote-temporary-file-directory)) (skip-unless (not (tramp--test-crypt-p))) - ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. - (dolist (quoted - (if (and (tramp--test-expensive-test-p) (tramp--test-emacs27-p)) - '(nil t) '(nil))) + (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) (tmp-name3 (tramp--test-make-temp-name 'local quoted))) @@ -4354,10 +4315,7 @@ tramp-test25-file-selinux '(nil nil nil nil)))) (skip-unless (not (tramp--test-crypt-p))) - ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. - (dolist (quoted - (if (and (tramp--test-expensive-test-p) (tramp--test-emacs27-p)) - '(nil t) '(nil))) + (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) (tmp-name3 (tramp--test-make-temp-name 'local quoted))) @@ -4862,9 +4820,10 @@ tramp-test29-start-file-process (unless (tramp--test-sshfs-p) (unwind-protect (with-temp-buffer - (setq command '("cat") - proc - (apply #'start-file-process "test4" (current-buffer) command)) + (setq command '("cat") + proc + (apply + #'start-file-process "test4" (current-buffer) command)) (should (processp proc)) (should (equal (process-status proc) 'run)) (should (equal (process-get proc 'remote-command) command)) @@ -4884,12 +4843,7 @@ tramp-test29-start-file-process ;; Process connection type. (when (and (tramp--test-sh-p) (not (tramp-direct-async-process-p)) - ;; `executable-find' has changed the number of - ;; parameters in Emacs 27.1, so we use `apply' for - ;; older Emacsen. - (ignore-errors - (with-no-warnings - (apply #'executable-find '("hexdump" remote))))) + (executable-find "hexdump" 'remote)) (dolist (process-connection-type '(nil pipe t pty)) (unwind-protect (with-temp-buffer @@ -4946,33 +4900,29 @@ tramp--test-deftest-direct-async-process "Define ert test `TEST-direct-async' for direct async processes. If UNSTABLE is non-nil, the test is tagged as `:unstable'." (declare (indent 1)) - ;; `make-process' supports file name handlers since Emacs 27. We - ;; cannot use `tramp--test-always' during compilation of the macro. - (when (let ((file-name-handler-alist '(("" . (lambda (&rest _) t))))) - (ignore-errors (make-process :file-handler t))) - `(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) () - ;; This is the docstring. However, it must be expanded to a - ;; string inside the macro. No idea. - ;; (concat (ert-test-documentation (get ',test 'ert--test)) - ;; "\nUse direct async process.") - :tags (append '(:expensive-test :tramp-asynchronous-processes) - (and ,unstable '(:unstable))) - (skip-unless (tramp--test-enabled)) - (let ((default-directory ert-remote-temporary-file-directory) - (ert-test (ert-get-test ',test)) - (tramp-connection-properties - (cons '(nil "direct-async-process" t) - tramp-connection-properties))) - (skip-unless (tramp-direct-async-process-p)) - ;; We do expect an established connection already, - ;; `file-truename' does it by side-effect. Suppress - ;; `tramp--test-enabled', in order to keep the connection. - ;; Suppress "Process ... finished" messages. - (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always) - ((symbol-function #'internal-default-process-sentinel) - #'ignore)) - (file-truename ert-remote-temporary-file-directory) - (funcall (ert-test-body ert-test))))))) + `(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) () + ;; This is the docstring. However, it must be expanded to a + ;; string inside the macro. No idea. + ;; (concat (ert-test-documentation (get ',test 'ert--test)) + ;; "\nUse direct async process.") + :tags (append '(:expensive-test :tramp-asynchronous-processes) + (and ,unstable '(:unstable))) + (skip-unless (tramp--test-enabled)) + (let ((default-directory ert-remote-temporary-file-directory) + (ert-test (ert-get-test ',test)) + (tramp-connection-properties + (cons '(nil "direct-async-process" t) + tramp-connection-properties))) + (skip-unless (tramp-direct-async-process-p)) + ;; We do expect an established connection already, + ;; `file-truename' does it by side-effect. Suppress + ;; `tramp--test-enabled', in order to keep the connection. + ;; Suppress "Process ... finished" messages. + (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always) + ((symbol-function #'internal-default-process-sentinel) + #'ignore)) + (file-truename ert-remote-temporary-file-directory) + (funcall (ert-test-body ert-test)))))) (tramp--test-deftest-direct-async-process tramp-test29-start-file-process) @@ -4983,24 +4933,21 @@ tramp-test30-make-process '(:unstable))) (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-supports-processes-p)) - ;; `make-process' supports file name handlers since Emacs 27. - (skip-unless (tramp--test-emacs27-p)) (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((default-directory ert-remote-temporary-file-directory) (tmp-name (tramp--test-make-temp-name nil quoted)) kill-buffer-query-functions command proc) - (with-no-warnings (should-not (make-process))) + (should-not (make-process)) ;; Simple process. (unwind-protect (with-temp-buffer (setq command '("cat") proc - (with-no-warnings - (make-process - :name "test1" :buffer (current-buffer) :command command - :file-handler t))) + (make-process + :name "test1" :buffer (current-buffer) :command command + :file-handler t)) (should (processp proc)) (should (equal (process-status proc) 'run)) (should (equal (process-get proc 'remote-command) command)) @@ -5022,10 +4969,9 @@ tramp-test30-make-process (should (file-exists-p tmp-name)) (setq command `("cat" ,(file-name-nondirectory tmp-name)) proc - (with-no-warnings - (make-process - :name "test2" :buffer (current-buffer) :command command - :file-handler t))) + (make-process + :name "test2" :buffer (current-buffer) :command command + :file-handler t)) (should (processp proc)) (should (equal (process-get proc 'remote-command) command)) ;; Read output. @@ -5044,13 +4990,12 @@ tramp-test30-make-process (with-temp-buffer (setq command '("cat") proc - (with-no-warnings - (make-process - :name "test3" :buffer (current-buffer) :command command - :filter - (lambda (p s) - (with-current-buffer (process-buffer p) (insert s))) - :file-handler t))) + (make-process + :name "test3" :buffer (current-buffer) :command command + :filter + (lambda (p s) + (with-current-buffer (process-buffer p) (insert s))) + :file-handler t)) (should (processp proc)) (should (equal (process-status proc) 'run)) (should (equal (process-get proc 'remote-command) command)) @@ -5071,11 +5016,9 @@ tramp-test30-make-process (with-temp-buffer (setq command '("cat") proc - (with-no-warnings - (make-process - :name "test4" :buffer (current-buffer) :command command - :filter t - :file-handler t))) + (make-process + :name "test4" :buffer (current-buffer) :command command + :filter t :file-handler t)) (should (processp proc)) (should (equal (process-status proc) 'run)) (should (equal (process-get proc 'remote-command) command)) @@ -5096,13 +5039,12 @@ tramp-test30-make-process (with-temp-buffer (setq command '("cat") proc - (with-no-warnings - (make-process - :name "test5" :buffer (current-buffer) :command command - :sentinel - (lambda (p s) - (with-current-buffer (process-buffer p) (insert s))) - :file-handler t))) + (make-process + :name "test5" :buffer (current-buffer) :command command + :sentinel + (lambda (p s) + (with-current-buffer (process-buffer p) (insert s))) + :file-handler t)) (should (processp proc)) (should (equal (process-status proc) 'run)) (should (equal (process-get proc 'remote-command) command)) @@ -5128,11 +5070,9 @@ tramp-test30-make-process (with-temp-buffer (setq command '("cat" "/does-not-exist") proc - (with-no-warnings - (make-process - :name "test6" :buffer (current-buffer) :command command - :stderr stderr - :file-handler t))) + (make-process + :name "test6" :buffer (current-buffer) :command command + :stderr stderr :file-handler t)) (should (processp proc)) (should (equal (process-get proc 'remote-command) command)) ;; Read output. @@ -5161,11 +5101,9 @@ tramp-test30-make-process (with-temp-buffer (setq command '("cat" "/does-not-exist") proc - (with-no-warnings - (make-process - :name "test7" :buffer (current-buffer) :command command - :stderr tmp-name - :file-handler t))) + (make-process + :name "test7" :buffer (current-buffer) :command command + :stderr tmp-name :file-handler t)) (should (processp proc)) (should (equal (process-get proc 'remote-command) command)) ;; Read stderr. @@ -5186,12 +5124,7 @@ tramp-test30-make-process ;; Process connection type. (when (and (tramp--test-sh-p) (not (tramp-direct-async-process-p)) - ;; `executable-find' has changed the number of - ;; parameters in Emacs 27.1, so we use `apply' for - ;; older Emacsen. - (ignore-errors - (with-no-warnings - (apply #'executable-find '("hexdump" remote))))) + (executable-find "hexdump" 'remote)) (dolist (connection-type '(nil pipe t pty)) ;; `process-connection-type' is taken when ;; `:connection-type' is nil. @@ -5201,15 +5134,14 @@ tramp-test30-make-process (with-temp-buffer (setq command '("hexdump" "-v" "-e" "/1 \"%02X\n\"") proc - (with-no-warnings - (make-process - :name - (format "test8-%s-%s" - connection-type process-connection-type) - :buffer (current-buffer) - :connection-type connection-type - :command command - :file-handler t))) + (make-process + :name + (format "test8-%s-%s" + connection-type process-connection-type) + :buffer (current-buffer) + :connection-type connection-type + :command command + :file-handler t)) (should (processp proc)) (should (equal (process-status proc) 'run)) (should (equal (process-get proc 'remote-command) command)) @@ -5245,8 +5177,6 @@ tramp-test31-interrupt-process (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-windows-nt-p))) (skip-unless (not (tramp--test-crypt-p))) - ;; Since Emacs 27.1. - (skip-unless (macrop 'with-connection-local-variables)) ;; We must use `file-truename' for the temporary directory, in ;; order to establish the connection prior running an asynchronous @@ -5288,8 +5218,6 @@ tramp-test31-signal-process (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-windows-nt-p))) (skip-unless (not (tramp--test-crypt-p))) - ;; Since Emacs 27.1. - (skip-unless (macrop 'with-connection-local-variables)) ;; Since Emacs 29.1. (skip-unless (boundp 'signal-process-functions)) @@ -5416,11 +5344,9 @@ tramp--test-async-shell-command INPUT, if non-nil, is a string sent to the process." (let ((proc (async-shell-command command output-buffer error-buffer)) (delete-exited-processes t)) - ;; Since Emacs 27.1. - (when (macrop 'with-connection-local-variables) - (should (equal (process-get proc 'remote-command) - (with-connection-local-variables - `(,shell-file-name ,shell-command-switch ,command))))) + (should (equal (process-get proc 'remote-command) + (with-connection-local-variables + `(,shell-file-name ,shell-command-switch ,command)))) (cl-letf (((symbol-function #'shell-command-sentinel) #'ignore)) (when (stringp input) (process-send-string proc input)) @@ -5441,10 +5367,6 @@ tramp-test32-shell-command :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-supports-processes-p)) - ;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for - ;; remote processes in Emacs. That doesn't work for tramp-adb.el. - (when (tramp--test-adb-p) - (skip-unless (tramp--test-emacs27-p))) (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((tmp-name (tramp--test-make-temp-name nil quoted)) @@ -5512,7 +5434,7 @@ tramp-test32-shell-command (should (string-match-p ;; Some shells echo, for example the "adb" or "docker" methods. - (tramp-compat-rx + (rx bos (** 1 2 (literal (file-name-nondirectory tmp-name)) "\n") eos) (buffer-string)))) @@ -5520,10 +5442,8 @@ tramp-test32-shell-command ;; Cleanup. (ignore-errors (delete-file tmp-name)))))) - ;; Test `async-shell-command-width'. It exists since Emacs 26.1, - ;; but seems to work since Emacs 27.1 only. - (when (and (tramp--test-asynchronous-processes-p) - (tramp--test-sh-p) (tramp--test-emacs27-p)) + ;; Test `async-shell-command-width'. + (when (and (tramp--test-asynchronous-processes-p) (tramp--test-sh-p)) (let* ((async-shell-command-width 1024) (default-directory ert-remote-temporary-file-directory) (cols (ignore-errors @@ -5543,8 +5463,6 @@ tramp-test32-shell-command-dont-erase-buffer (skip-unless (tramp--test-enabled)) (skip-unless nil) (skip-unless (tramp--test-supports-processes-p)) - ;; Prior Emacs 27, `shell-command-dont-erase-buffer' wasn't working properly. - (skip-unless (tramp--test-emacs27-p)) ;; (message " s-c-d-e-b current-buffer buffer-string point") ;; (message "===============================================") @@ -5719,8 +5637,7 @@ tramp-test33-environment-variables ;; Variable is set. (should (string-match-p - (tramp-compat-rx (literal envvar)) - (funcall this-shell-command-to-string "set")))) + (rx (literal envvar)) (funcall this-shell-command-to-string "set")))) (unless (tramp-direct-async-process-p) ;; We force a reconnect, in order to have a clean environment. @@ -5746,7 +5663,7 @@ tramp-test33-environment-variables ;; Variable is unset. (should-not (string-match-p - (tramp-compat-rx (literal envvar)) + (rx (literal envvar)) ;; We must remove PS1, the output is truncated otherwise. ;; We must suppress "_=VAR...". (funcall @@ -5791,13 +5708,10 @@ tramp-test33-environment-variables-and-port-numbers (dolist (dir '("/mock:localhost#11111:" "/mock:localhost#22222:")) (tramp-cleanup-connection (tramp-dissect-file-name dir))))) -;; Connection-local variables are enabled per default since Emacs 27.1. (ert-deftest tramp-test34-connection-local-variables () "Check that connection-local variables are enabled." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) - ;; Since Emacs 27.1. - (skip-unless (macrop 'with-connection-local-variables)) (let* ((default-directory ert-remote-temporary-file-directory) (tmp-name1 (tramp--test-make-temp-name)) @@ -5861,19 +5775,12 @@ tramp-test34-explicit-shell-file-name :tags '(:expensive-test :tramp-asynchronous-processes) (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-supports-processes-p)) - ;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for - ;; remote processes in Emacs. That doesn't work for tramp-adb.el. - (when (tramp--test-adb-p) - (skip-unless (tramp--test-emacs27-p))) (let ((default-directory ert-remote-temporary-file-directory) explicit-shell-file-name kill-buffer-query-functions connection-local-profile-alist connection-local-criteria-alist) (unwind-protect (progn - ;; `shell-mode' would ruin our test, because it deletes all - ;; buffer local variables. Not needed in Emacs 27.1. - (put 'explicit-shell-file-name 'permanent-local t) (connection-local-set-profile-variables 'remote-sh `((explicit-shell-file-name . ,(tramp--test-shell-file-name)) @@ -5904,29 +5811,24 @@ tramp-test34-explicit-shell-file-name (put 'explicit-shell-file-name 'permanent-local nil) (kill-buffer "*shell*")))) -;; `exec-path' was introduced in Emacs 27.1. `executable-find' has -;; changed the number of parameters, so we use `apply' for older -;; Emacsen. (ert-deftest tramp-test35-exec-path () "Check `exec-path' and `executable-find'." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-supports-processes-p)) (skip-unless (tramp--test-supports-set-file-modes-p)) - ;; Since Emacs 27.1. - (skip-unless (fboundp 'exec-path)) (let ((tmp-name (tramp--test-make-temp-name)) (default-directory ert-remote-temporary-file-directory)) (unwind-protect (progn - (should (consp (with-no-warnings (exec-path)))) + (should (consp (exec-path))) ;; Last element is the `exec-directory'. (should (string-equal - (car (last (with-no-warnings (exec-path)))) + (car (last (exec-path))) (file-remote-p default-directory 'localname))) ;; The shell "sh" shall always exist. - (should (apply #'executable-find '("sh" remote))) + (should (executable-find "sh" 'remote)) ;; Since the last element in `exec-path' is the current ;; directory, an executable file in that directory will be ;; found. @@ -5937,32 +5839,25 @@ tramp-test35-exec-path (should (file-executable-p tmp-name)) (should (string-equal - (apply - #'executable-find `(,(file-name-nondirectory tmp-name) remote)) + (executable-find (file-name-nondirectory tmp-name) 'remote) (file-remote-p tmp-name 'localname))) (should-not - (apply - #'executable-find - `(,(concat (file-name-nondirectory tmp-name) "foo") remote)))) + (executable-find + (concat (file-name-nondirectory tmp-name) "foo") 'remote))) ;; Cleanup. (ignore-errors (delete-file tmp-name))))) ;; This test is inspired by Bug#33781. -;; `exec-path' was introduced in Emacs 27.1. `executable-find' has -;; changed the number of parameters, so we use `apply' for older -;; Emacsen. (ert-deftest tramp-test35-remote-path () "Check loooong `tramp-remote-path'." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-crypt-p))) - ;; Since Emacs 27.1. - (skip-unless (fboundp 'exec-path)) (let* ((tmp-name (tramp--test-make-temp-name)) (default-directory ert-remote-temporary-file-directory) - (orig-exec-path (with-no-warnings (exec-path))) + (orig-exec-path (exec-path)) (tramp-remote-path tramp-remote-path) (orig-tramp-remote-path tramp-remote-path) path) @@ -5972,14 +5867,13 @@ tramp-test35-remote-path (setq tramp-remote-path (cons (file-remote-p tmp-name 'localname) tramp-remote-path)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (should (equal (with-no-warnings (exec-path)) orig-exec-path)) + (should (equal (exec-path) orig-exec-path)) (setq tramp-remote-path orig-tramp-remote-path) ;; Double entries are removed. (setq tramp-remote-path (append '("/" "/") tramp-remote-path)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (should - (equal (with-no-warnings (exec-path)) (cons "/" orig-exec-path))) + (should (equal (exec-path) (cons "/" orig-exec-path))) (setq tramp-remote-path orig-tramp-remote-path) ;; We make a super long `tramp-remote-path'. @@ -5997,7 +5891,7 @@ tramp-test35-remote-path `(,(file-remote-p dir 'localname)) (last orig-exec-path))))) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (should (equal (with-no-warnings (exec-path)) orig-exec-path)) + (should (equal (exec-path) orig-exec-path)) ;; Ignore trailing newline. (setq path (substring (shell-command-to-string "echo $PATH") nil -1)) ;; The shell doesn't handle such long strings. @@ -6009,7 +5903,7 @@ tramp-test35-remote-path (string-equal path (mapconcat #'identity (butlast orig-exec-path) ":")))) ;; The shell "sh" shall always exist. - (should (apply #'executable-find '("sh" remote)))) + (should (executable-find "sh" 'remote))) ;; Cleanup. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) @@ -6129,7 +6023,7 @@ tramp-test37-make-auto-save-file-name (string-equal (make-auto-save-file-name) (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (expand-file-name (format "#%s#" (file-name-nondirectory tmp-name1)) ert-remote-temporary-file-directory)))))) @@ -6154,7 +6048,7 @@ tramp-test37-make-auto-save-file-name ("|" . "__") ("[" . "_l") ("]" . "_r")) - (tramp-compat-file-name-unquote tmp-name1))) + (file-name-unquote tmp-name1))) tmp-name2))) (should (file-directory-p tmp-name2))))) @@ -6178,7 +6072,7 @@ tramp-test37-make-auto-save-file-name ("|" . "__") ("[" . "_l") ("]" . "_r")) - (tramp-compat-file-name-unquote tmp-name1))) + (file-name-unquote tmp-name1))) tmp-name2))) (should (file-directory-p tmp-name2))))) @@ -6234,7 +6128,7 @@ tramp-test38-find-backup-file-name (find-backup-file-name tmp-name1) (list (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (expand-file-name (format "%s~" (file-name-nondirectory tmp-name1)) ert-remote-temporary-file-directory))))))) @@ -6248,7 +6142,7 @@ tramp-test38-find-backup-file-name (find-backup-file-name tmp-name1) (list (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (expand-file-name (format "%s~" @@ -6277,7 +6171,7 @@ tramp-test38-find-backup-file-name (find-backup-file-name tmp-name1) (list (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (expand-file-name (format "%s~" @@ -6308,7 +6202,7 @@ tramp-test38-find-backup-file-name (find-backup-file-name tmp-name1) (list (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (expand-file-name (format "%s~" @@ -6566,7 +6460,6 @@ tramp-test39-detect-external-change (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password))))))) -;; The functions were introduced in Emacs 26.1. (ert-deftest tramp-test40-make-nearby-temp-file () "Check `make-nearby-temp-file' and `temporary-file-directory'." (skip-unless (tramp--test-enabled)) @@ -6598,12 +6491,6 @@ tramp-test40-make-nearby-temp-file (delete-directory tmp-file) (should-not (file-exists-p tmp-file)))) -(defun tramp--test-emacs27-p () - "Check for Emacs version >= 27.1. -Some semantics has been changed for there, without new functions -or variables, so we check the Emacs version directly." - (>= emacs-major-version 27)) - (defun tramp--test-emacs28-p () "Check for Emacs version >= 28.1. Some semantics has been changed for there, without new functions @@ -6638,7 +6525,7 @@ tramp--test-asynchronous-processes-p :body nil :tags '(:tramp-asynchronous-processes)))) ;; tramp-adb.el cannot apply multi-byte commands. (not (and (tramp--test-adb-p) - (string-match-p (tramp-compat-rx multibyte) default-directory))))) + (string-match-p (rx multibyte) default-directory))))) (defun tramp--test-crypt-p () "Check, whether the remote directory is encrypted." @@ -6802,10 +6689,7 @@ tramp--test-supports-set-file-modes-p (defun tramp--test-check-files (&rest files) "Run a simple but comprehensive test over every file in FILES." - ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. - (dolist (quoted - (if (and (tramp--test-expensive-test-p) (tramp--test-emacs27-p)) - '(nil t) '(nil))) + (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) ;; We must use `file-truename' for the temporary directory, ;; because it could be located on a symlinked directory. This ;; would let the test fail. @@ -6855,7 +6739,7 @@ tramp--test-check-files (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (file-attribute-type (file-attributes file3))) (file-remote-p (file-truename file1) 'localname))) ;; Check file contents. @@ -6946,14 +6830,14 @@ tramp--test-check-files (should (string-equal (caar (directory-files-and-attributes - file1 nil (tramp-compat-rx (literal elt1)))) + file1 nil (rx (literal elt1)))) elt1)) (should (string-equal (funcall - (if quoted #'tramp-compat-file-name-quote #'identity) + (if quoted #'file-name-quote #'identity) (cadr (car (directory-files-and-attributes - file1 nil (tramp-compat-rx (literal elt1)))))) + file1 nil (rx (literal elt1)))))) (file-remote-p (file-truename file2) 'localname))) (delete-file file3) (should-not (file-exists-p file3)))) @@ -6962,15 +6846,7 @@ tramp--test-check-files ;; `default-directory' with special characters. See ;; Bug#53846. (when (and (tramp--test-expensive-test-p) - (tramp--test-supports-processes-p) - ;; Prior Emacs 27, `shell-file-name' was - ;; hard coded as "/bin/sh" for remote - ;; processes in Emacs. That doesn't work - ;; for tramp-adb.el. tramp-sshfs.el times - ;; out for older Emacsen, reason unknown. - (or (and (not (tramp--test-adb-p)) - (not (tramp--test-sshfs-p))) - (tramp--test-emacs27-p))) + (tramp--test-supports-processes-p)) (let ((default-directory file1)) (dolist (this-shell-command (append @@ -7008,7 +6884,7 @@ tramp--test-check-files (goto-char (point-min)) (should (re-search-forward - (tramp-compat-rx + (rx bol (literal envvar) "=" (literal (getenv envvar)) eol)))))))) @@ -7154,13 +7030,8 @@ tramp-test42-utf8 (ert-deftest tramp-test43-file-system-info () "Check that `file-system-info' returns proper values." (skip-unless (tramp--test-enabled)) - ;; Since Emacs 27.1. - (skip-unless (fboundp 'file-system-info)) - ;; `file-system-info' exists since Emacs 27.1. We don't want to see - ;; compiler warnings for older Emacsen. - (when-let ((fsi (with-no-warnings - (file-system-info ert-remote-temporary-file-directory)))) + (when-let ((fsi (file-system-info ert-remote-temporary-file-directory))) (should (consp fsi)) (should (= (length fsi) 3)) (dotimes (i (length fsi)) @@ -7216,10 +7087,6 @@ tramp-test44-asynchronous-requests '(:unstable))) (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-supports-processes-p)) - ;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for - ;; remote processes in Emacs. That doesn't work for tramp-adb.el. - (when (tramp--test-adb-p) - (skip-unless (tramp--test-emacs27-p))) (skip-unless (not (tramp--test-docker-p))) (skip-unless (not (tramp--test-telnet-p))) (skip-unless (not (tramp--test-sshfs-p))) @@ -7552,7 +7419,7 @@ tramp-test47-delay-load (dolist (tm '(t nil)) (should (string-match-p - (tramp-compat-rx + (rx "Tramp loaded: nil" (+ (any "\n\r")) "Tramp loaded: nil" (+ (any "\n\r")) "Tramp loaded: " (literal (symbol-name tm)) (+ (any "\n\r"))) @@ -7600,7 +7467,7 @@ tramp-test47-remote-load-path (tramp-cleanup-all-connections))")) (should (string-match-p - (tramp-compat-rx + (rx "Loading " (literal (expand-file-name commit 7420b6dcc379617ca9691049c16bfb2d158f9496 Author: Robert Pluim Date: Fri Jan 6 09:00:00 2023 +0100 Fix `pr-interface' `pr-interface' specifies `inline' for its menu items, which is not necessary, but it causes `widget-choice-value-create' to bug out. (Bug#60501) * lisp/wid-edit.el (widget-choice-value-create): Allow the value to be a non-list. * test/lisp/wid-edit-tests.el (widget-test-handle-spurious-inline): Add test to ensure that unnecessary :inline is allowed. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 798db9f9dd2..60bd2baa6fb 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2220,7 +2220,9 @@ widget-choice-value-create (if (widget-get current :inline) (setq val value fun :match-inline) - (setq val (car value) + (setq val (if (consp value) + (car value) + value) fun :match)) (setq val value fun :match)) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 3f5fcea0c33..b379c7c91a8 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -267,6 +267,22 @@ widget-test-list-can-handle-inlinable-choice (should child) (should (equal (widget-value widget) '(1 "One")))))) +;; Bug#60501 +(ert-deftest widget-test-handle-spurious-inline () + "Test the we can create a menu widget with an unnecessary :inline" + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'menu-choice + :inline t + :value "*scratch*" + '(choice-item "*scratch*"))) + (child (car (widget-get widget :children)))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (string-equal (widget-value widget) "*scratch*"))))) + (ert-deftest widget-test-option-can-handle-choice () "Test that we can create a option widget with a choice correctly." (with-temp-buffer commit 699711786ac7aa6d6524467076a45568e283e061 Author: Jostein Kjønigsen Date: Sun Jan 1 20:46:02 2023 +0100 Further generic-related improvements in csharp-ts-mode (bug#60376) This is an additional patch for bug#60376. * lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings): New rules. diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 473e8f49fd3..79afd7f91dc 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -773,9 +773,12 @@ csharp-ts-mode--font-lock-settings (array_type (identifier) @font-lock-type-face) (cast_expression (identifier) @font-lock-type-face) + (cast_expression (generic_name (identifier) @font-lock-type-face)) ["operator"] @font-lock-type-face (type_parameter_constraints_clause target: (identifier) @font-lock-type-face) + (type_constraint type: (identifier) @font-lock-type-face) + (type_constraint type: (generic_name (identifier) @font-lock-type-face)) (type_of_expression (identifier) @font-lock-type-face) (object_creation_expression type: (identifier) @font-lock-type-face)