emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/info.el


From: Lute Kamstra
Subject: [Emacs-diffs] Changes to emacs/lisp/info.el
Date: Mon, 06 Oct 2003 03:14:22 -0400

Index: emacs/lisp/info.el
diff -c emacs/lisp/info.el:1.373 emacs/lisp/info.el:1.374
*** emacs/lisp/info.el:1.373    Sun Oct  5 09:51:04 2003
--- emacs/lisp/info.el  Mon Oct  6 03:14:21 2003
***************
*** 2527,2536 ****
    (make-local-variable 'Info-index-alternatives)
    (setq header-line-format
        (if Info-use-header-line
!           '(:eval
!             (replace-regexp-in-string
!              "%" "%%"
!              (get-text-property (point-min) 'header-line)))
          nil)) ; so the header line isn't displayed
    (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
    ;; This is for the sake of the invisible text we use handling titles.
--- 2527,2533 ----
    (make-local-variable 'Info-index-alternatives)
    (setq header-line-format
        (if Info-use-header-line
!           '(:eval (get-text-property (point-min) 'header-line))
          nil)) ; so the header line isn't displayed
    (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
    ;; This is for the sake of the invisible text we use handling titles.
***************
*** 2775,2780 ****
--- 2772,2798 ----
    "Face for headers in Info menus."
    :group 'info)
  
+ (defun Info-escape-percent (string)
+   "Double all occurrences of `%' in STRING.
+ 
+ Return a new string with all `%' characters replaced by `%%'.
+ Preserve text properties."
+   (let ((start 0)
+       (end (length string))
+       mb me m matches)
+     (save-match-data
+       (while (and (< start end) (string-match "%" string start))
+       (setq mb (match-beginning 0)
+             me (1+ mb)
+             m (substring string mb me)
+             matches (cons m 
+                           (cons m 
+                                 (cons (substring string start mb) 
+                                       matches)))
+             start me))
+       (push (substring string start end) matches)
+       (apply #'concat (nreverse matches)))))
+ 
  (defun Info-fontify-menu-headers ()
    "Add the face `info-menu-header' to any header before a menu entry."
    (save-excursion
***************
*** 2868,2874 ****
                  (setq header (buffer-substring (point) header-end))))
  
              (put-text-property (point-min) (1+ (point-min))
!                                'header-line header)
              ;; Hide the part of the first line
              ;; that is in the header, if it is just part.
              (unless (bobp)
--- 2886,2892 ----
                  (setq header (buffer-substring (point) header-end))))
  
              (put-text-property (point-min) (1+ (point-min))
!                                'header-line (Info-escape-percent header))
              ;; Hide the part of the first line
              ;; that is in the header, if it is just part.
              (unless (bobp)




reply via email to

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