texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: No colour change for black links


From: Gavin D. Smith
Subject: branch master updated: No colour change for black links
Date: Tue, 27 Dec 2022 18:03:15 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 797b697a8c No colour change for black links
797b697a8c is described below

commit 797b697a8c2681faacf6925f526dbbd240688810
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Dec 27 23:03:08 2022 +0000

    No colour change for black links
    
    * doc/texinfo.tex (\setcolor) [pdfTeX]: Keep track of the current
    colour so that in the default case, when everything is black, there
    is no \mark output or pdf output, which is faster when the document
    contains many links.
---
 ChangeLog       |  9 +++++++++
 doc/texinfo.tex | 16 ++++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ab4ff015b..f4af42e558 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-12-27  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       No colour change for black links
+
+       * doc/texinfo.tex (\setcolor) [pdfTeX]: Keep track of the current
+       colour so that in the default case, when everything is black, there
+       is no \mark output or pdf output, which is faster when the document
+       contains many links.
+
 2022-12-27  Arsen Arsenović  <arsen@aarsen.me>
 
        Re-enable copyable anchors in HTML output
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index de6a7cb855..6f83f86db8 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2022-12-27.21}
+\def\texinfoversion{2022-12-27.23}
 %
 % Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc.
 %
@@ -1194,13 +1194,17 @@ output) for that.)}
   %
   % 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{}
@@ -1356,7 +1360,7 @@ output) for that.)}
   %
   % 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]