2527 |
(make-local-variable 'Info-index-alternatives) |
(make-local-variable 'Info-index-alternatives) |
2528 |
(setq header-line-format |
(setq header-line-format |
2529 |
(if Info-use-header-line |
(if Info-use-header-line |
2530 |
'(:eval |
'(:eval (get-text-property (point-min) 'header-line)) |
|
(replace-regexp-in-string |
|
|
"%" "%%" |
|
|
(get-text-property (point-min) 'header-line))) |
|
2531 |
nil)) ; so the header line isn't displayed |
nil)) ; so the header line isn't displayed |
2532 |
(set (make-local-variable 'tool-bar-map) info-tool-bar-map) |
(set (make-local-variable 'tool-bar-map) info-tool-bar-map) |
2533 |
;; This is for the sake of the invisible text we use handling titles. |
;; This is for the sake of the invisible text we use handling titles. |
2772 |
"Face for headers in Info menus." |
"Face for headers in Info menus." |
2773 |
:group 'info) |
:group 'info) |
2774 |
|
|
2775 |
|
(defun Info-escape-percent (string) |
2776 |
|
"Double all occurrences of `%' in STRING. |
2777 |
|
|
2778 |
|
Return a new string with all `%' characters replaced by `%%'. |
2779 |
|
Preserve text properties." |
2780 |
|
(let ((start 0) |
2781 |
|
(end (length string)) |
2782 |
|
mb me m matches) |
2783 |
|
(save-match-data |
2784 |
|
(while (and (< start end) (string-match "%" string start)) |
2785 |
|
(setq mb (match-beginning 0) |
2786 |
|
me (1+ mb) |
2787 |
|
m (substring string mb me) |
2788 |
|
matches (cons m |
2789 |
|
(cons m |
2790 |
|
(cons (substring string start mb) |
2791 |
|
matches))) |
2792 |
|
start me)) |
2793 |
|
(push (substring string start end) matches) |
2794 |
|
(apply #'concat (nreverse matches))))) |
2795 |
|
|
2796 |
(defun Info-fontify-menu-headers () |
(defun Info-fontify-menu-headers () |
2797 |
"Add the face `info-menu-header' to any header before a menu entry." |
"Add the face `info-menu-header' to any header before a menu entry." |
2798 |
(save-excursion |
(save-excursion |
2886 |
(setq header (buffer-substring (point) header-end)))) |
(setq header (buffer-substring (point) header-end)))) |
2887 |
|
|
2888 |
(put-text-property (point-min) (1+ (point-min)) |
(put-text-property (point-min) (1+ (point-min)) |
2889 |
'header-line header) |
'header-line (Info-escape-percent header)) |
2890 |
;; Hide the part of the first line |
;; Hide the part of the first line |
2891 |
;; that is in the header, if it is just part. |
;; that is in the header, if it is just part. |
2892 |
(unless (bobp) |
(unless (bobp) |