]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-mode): Revert previous change.
authorLute Kamstra <lute@gnu.org>
Mon, 6 Oct 2003 07:14:53 +0000 (07:14 +0000)
committerLute Kamstra <lute@gnu.org>
Mon, 6 Oct 2003 07:14:53 +0000 (07:14 +0000)
(Info-escape-percent): New function.
(Info-fontify-node): Use it.

lisp/ChangeLog
lisp/info.el

index b737420f12a42c8c0379ab930d97e565a9e39dc9..7c37cbc7c1b48576c5119e0d58afd16f32905b8f 100644 (file)
        * makefile.w32-in (DONTCOMPILE, bootstrap-clean-CMD)
        (bootstrap-clean-SH): Rename loaddefs-boot.el to ldefs-boot.el
 
+2003-10-03  Lute Kamstra  <Lute.Kamstra@cwi.nl>
+
+       * info.el (Info-mode): Revert previous change.
+       (Info-escape-percent): New function.
+       (Info-fontify-node): Use it.
+
 2003-10-02  Andreas Schwab  <schwab@suse.de>
 
        * loaddefs-boot.el: Regenerated.
index e11fdbf16ad38c1f3d20a1a128f876b00fd8832d..47af5bb8154ed095b2ff15d4b666be7e53d53434 100644 (file)
@@ -2527,10 +2527,7 @@ Advanced commands:
   (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)))
+           '(: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,6 +2772,27 @@ the variable `Info-file-list-for-emacs'."
   "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,7 +2886,7 @@ the variable `Info-file-list-for-emacs'."
                  (setq header (buffer-substring (point) header-end))))
 
              (put-text-property (point-min) (1+ (point-min))
-                                'header-line header)
+                                '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)