Subject: Re: bug#9891: 24.0.90; Duplicated entry at the info directory

From: Eli Zaretskii <[email-masked]>
Date: Mon, 31 Oct 2011 20:57:46 +0200

> Date: Sat, 29 Oct 2011 22:41:51 +0200
> From: Dani Moncayo <[email-masked]>
> Cc: [email-masked]
> 
> > FWIW 2: With the official windows build
> > (http://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-24.0.90-bin-i386.zip)
> > I don't see the duplicated `Info' entry.
> 
> It may be a different problem, but even with that official build, I
> see something strange.
> 
> I've attached two screenshots:
> * "1.png" shows the info node "(dir)Top" versus the file "info/dir".
> * "2.png" shows the info node "(emacs)Top" versus the file "info/emacs-1".
> 
> In the second case, subtitles like "Indexes (each index contains a
> large menu)" or "Important General Concepts" that appear in the
> "info/emacs-1" file are also shown in the info buffer.
> 
> But in the first case, the subtitles ("Emacs", "GNU Emacs Lisp",
> "Emacs editing modes", ...) that appear in the "info/dir" file,
> doesn't appear in the corresponding info buffer.  Why?

This is not a different problem, it's a consequence of the same
function Info-dir-remove-duplicates.  It happens here:

	  ;; Look for other headings of the same category and merge them.
	  (save-excursion
	    (while (re-search-forward "^\\(\\w.*\\)\n\\*" limit t)
	      (when (if re (save-match-data (string-match re (match-string 1)))
		      (equal name (match-string 1)))
		(forward-line 0)
		;; Delete redundant heading.                 <<<<<<<<<<<
		(delete-region (match-beginning 0) (point))  <<<<<<<<<<<

In this case, `re' is "Emacs", because Info-dir-remove-duplicates saw
the heading "Emacs".  Because `re' is non-nil, every heading that
matches "Emacs" will be removed.  And guess what? they _all_ match!

So I think it's a bug either in Info-dir-remove-duplicates or in the
regexps in Info-streamline-headings: they should match the entire
line, not just any substring.