[latex3-commits] [git/LaTeX3-latex3-hyperref] cleanup-patches: remove dependency on `etexcmds` package (33e1f25)
Yukai Chou
muzimuzhi at gmail.com
Sun Feb 19 09:09:43 CET 2023
Repository : https://github.com/latex3/hyperref
On branch : cleanup-patches
Link : https://github.com/latex3/hyperref/commit/33e1f25ee6813ba26546fff03a53a960227bb92b
>---------------------------------------------------------------
commit 33e1f25ee6813ba26546fff03a53a960227bb92b
Author: Yukai Chou <muzimuzhi at gmail.com>
Date: Sun Feb 19 16:05:16 2023 +0800
remove dependency on `etexcmds` package
>---------------------------------------------------------------
33e1f25ee6813ba26546fff03a53a960227bb92b
ChangeLog.txt | 3 +++
hyperref.dtx | 70 +++++++++++++++--------------------------------------------
2 files changed, 21 insertions(+), 52 deletions(-)
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 84e4509..d79afa1 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2023-02-19 Yukai Chou
+ * remove dependency on etexcmds package
+
2023-02-05 Ulrike Fischer/David Carlisle
* if babel is loaded casing with \MakeUppercase and \MakeLowercase
respects the rules of the current locale/language in the bookmarks.
diff --git a/hyperref.dtx b/hyperref.dtx
index 33c8fa1..46e7ff5 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -3123,16 +3123,6 @@
%
% \subsubsection{Protecting spaces}
%
-% \begin{macrocode}
-\RequirePackage{etexcmds}[2007/09/09]
-\ifetex at unexpanded
- \expandafter\@secondoftwo
-\else
- \expandafter\@firstoftwo
-\fi
-{%
-% \end{macrocode}
-%
% \begin{macro}{\HyPsd at ProtectSpaces}
% \cs{HyPsd at ProtectSpaces} calls with the expanded
% string \cs{HyPsd@@ProtectSpacesFi}. The expanded string is
@@ -3141,27 +3131,30 @@
% at the beginning or end of the string and grouping characters
% are not removed by the call of \cs{HyPsd@@ProtectSpacesFi}.
% \begin{macrocode}
- \def\HyPsd at ProtectSpaces#1{%
+\let\HyPsd at fi\fi
+\def\HyPsd at ProtectSpaces#1{%
+ \xdef#1{%
\iftrue
\expandafter\HyPsd@@ProtectSpacesFi
- \expandafter|\expandafter\@empty#1| \HyPsd at End#1%
- \fi
+ \expandafter|\expandafter\@empty#1| %
+ \HyPsd at fi
}%
+ \expandafter\HyPsd at RemoveMask#1\HyPsd at End#1%
+}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\HyPsd@@ProtectSpacesFi}
% The string can contain command tokens, so it is better
% to use an \cs{def} instead of an \cs{edef}.
% \begin{macrocode}
- \def\HyPsd@@ProtectSpacesFi#1 #2\HyPsd at End#3\fi{%
- \fi
- \ifx\scrollmode#2\scrollmode
- \HyPsd at RemoveMask#1\HyPsd at End#3%
- \else
- \gdef#3{#1\HyPsd at UnexpandableSpace#2}%
- \expandafter\HyPsd@@ProtectSpacesFi#3\HyPsd at End#3%
- \fi
- }%
+\def\HyPsd@@ProtectSpacesFi#1 #2\HyPsd at fi{%
+ \fi
+ \unexpanded{#1}%
+ \ifx\scrollmode#2\scrollmode
+ \else
+ \HyPsd@@ProtectSpacesFi\HyPsd at UnexpandableSpace#2%
+ \HyPsd at fi
+}%
% \end{macrocode}
% \end{macro}
%
@@ -3171,39 +3164,12 @@
% It is used by \cs{HyPsd@@ProtectSpacesFi} and by the code in
% \cs{pdfstringdef} that removes the grouping chararcters.
% \begin{macrocode}
- \def\HyPsd at RemoveMask|#1|\HyPsd at End#2{%
- \toks@\expandafter{#1}%
- \xdef#2{\the\toks@}%
- }%
+\def\HyPsd at RemoveMask|#1|\HyPsd at End#2{%
+ \xdef#2{\unexpanded\expandafter{#1}}%
+}%
% \end{macrocode}
% \end{macro}
%
-% \begin{macrocode}
-}{%
- \let\HyPsd at fi\fi
- \def\HyPsd at ProtectSpaces#1{%
- \xdef#1{%
- \iftrue
- \expandafter\HyPsd@@ProtectSpacesFi
- \expandafter|\expandafter\@empty#1| %
- \HyPsd at fi
- }%
- \expandafter\HyPsd at RemoveMask#1\HyPsd at End#1%
- }%
- \def\HyPsd@@ProtectSpacesFi#1 #2\HyPsd at fi{%
- \fi
- \etex at unexpanded{#1}%
- \ifx\scrollmode#2\scrollmode
- \else
- \HyPsd@@ProtectSpacesFi\HyPsd at UnexpandableSpace#2%
- \HyPsd at fi
- }%
- \def\HyPsd at RemoveMask|#1|\HyPsd at End#2{%
- \xdef#2{\etex at unexpanded\expandafter{#1}}%
- }%
-}
-% \end{macrocode}
-%
% \subsubsection{Remove grouping braces}
% \begin{macro}{\HyPsd at RemoveBraces}
% |#1| contains the expanded string, the result will
More information about the latex3-commits
mailing list.