# [PATCH] Documentation: Strip texinfo anchors to avoid duplicates

3 messages from 2013-04-03 to 2013-04-03. Participants: Martin von Gagern, Junio C Hamano.
Thread: https://gitlist.dev/t/33370

## Martin von Gagern, 2013-04-03 19:54

Subject: [PATCH] Documentation: Strip texinfo anchors to avoid duplicates
Message-ID: <1365018873-22503-1-git-send-email-Martin.vGagern@gmx.net>
URL: https://gitlist.dev/e/1365018873-22503-1-git-send-email-Martin.vGagern%40gmx.net

```
This keeps texinfo 5.x happy. See https://bugs.gentoo.org/464210.

Signed-off-by: Martin von Gagern <Martin.vGagern@gmx.net>
---
 Documentation/cat-texi.perl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
index dbc133c..b52660d 100755
--- a/Documentation/cat-texi.perl
+++ b/Documentation/cat-texi.perl
@@ -12,6 +12,7 @@ while (<STDIN>) {
 		push @menu, $1;
 	}
 	s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
+	s/\@anchor\{[^{}]*\}//g;
 	print TMP;
 }
 close TMP;
-- 
1.8.1.5

```

## Junio C Hamano, 2013-04-03 20:07

Subject: Re: [PATCH] Documentation: Strip texinfo anchors to avoid duplicates
Message-ID: <7vppyb4bu3.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vppyb4bu3.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1365018873-22503-1-git-send-email-Martin.vGagern@gmx.net>

```
Martin von Gagern <Martin.vGagern@gmx.net> writes:

> This keeps texinfo 5.x happy. See https://bugs.gentoo.org/464210.

I see why duplicates are bad, but does that mean not having any is
better?

>
> Signed-off-by: Martin von Gagern <Martin.vGagern@gmx.net>
> ---
>  Documentation/cat-texi.perl | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
> index dbc133c..b52660d 100755
> --- a/Documentation/cat-texi.perl
> +++ b/Documentation/cat-texi.perl
> @@ -12,6 +12,7 @@ while (<STDIN>) {
>  		push @menu, $1;
>  	}
>  	s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
> +	s/\@anchor\{[^{}]*\}//g;
>  	print TMP;
>  }
>  close TMP;

```

## Martin von Gagern, 2013-04-03 21:08

Subject: Re: [PATCH] Documentation: Strip texinfo anchors to avoid duplicates
Message-ID: <515C9A52.7020203@gmx.net>
URL: https://gitlist.dev/e/515C9A52.7020203%40gmx.net
In-Reply-To: <7vppyb4bu3.fsf@alter.siamese.dyndns.org>

```
On 03.04.2013 22:07, Junio C Hamano wrote:
> I see why duplicates are bad, but does that mean not having any is
> better?

I'd say yes: duplicate anchors cause current versions of texinfo to
reject the document outright, and older versions will likely cause a
broken interpretation of any anchor names.

What are possible scenarios where anchors could be useful?
a) Internal cross reference. I'm not sure whether texinfo checks for
   broken internal links. If it does, it did not report any.
b) Goto command issued by the user. I suppose most users would be happy
   with node-level navigation, and not use it for navigation to
   sub-node sections.
c) URLs in bookmarks or mails. I suppose people are more likely to use
   the html documents built by asciidoc, instead of a version
   constructed from the texinfo document. So not our issue.
Did I miss a relevant use case?

Automatically (or even manually?) generated unique names might be better
than none. But I'm not sure they are worth the trouble.

Martin von Gagern


```
