Subject: Re: bug#12187: 24.1.50; `Info-breadcrumbs-depth' should show `File:' without ".info" suffix

From: Juri Linkov <[email-masked]>
Date: Wed, 22 Aug 2012 01:28:51 +0300

> I agree with Stefan - please elide the suffix in Emacs, at least.
> That could be done during rendering, if you do not think that
> makeinfo should do it generally.

This can be implemented in Emacs with the following patch.
The change should have no bad effect in case when makeinfo
will be changed to produce file names without suffix in the header.

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-08-20 23:44:19 +0000
+++ lisp/info.el	2012-08-21 22:27:52 +0000
@@ -4537,7 +4537,17 @@ (defun Info-fontify-node ()
              ((not (bobp))
               ;; Hide the punctuation at the end, too.
               (skip-chars-backward " \t,")
-              (put-text-property (point) header-end 'invisible t))))))
+              (put-text-property (point) header-end 'invisible t)
+	      ;; Hide the suffix of the Info file name.
+	      (beginning-of-line)
+	      (if (re-search-forward
+		   (concat (format "File: %s\\([^,\n\t]*\\)"
+				   (if (stringp Info-current-file)
+				       (file-name-nondirectory Info-current-file)
+				     Info-current-file)))
+		   header-end t)
+		  (put-text-property (match-beginning 1) (match-end 1)
+				     'invisible t)))))))
 
       ;; Fontify titles
       (goto-char (point-min))