]> git.eshelyaron.com Git - emacs.git/commitdiff
(info-menu-header): New face.
authorMiles Bader <miles@gnu.org>
Thu, 2 Nov 2000 02:14:07 +0000 (02:14 +0000)
committerMiles Bader <miles@gnu.org>
Thu, 2 Nov 2000 02:14:07 +0000 (02:14 +0000)
(Info-fontify-menu-headers): New function.
(Info-fontify-node, Info-insert-dir): Call `Info-fontify-menu-headers'.

lisp/ChangeLog
lisp/info.el

index 358bba3b87eb6c69372a1aaf81fbad0d4cadb4cf..8467c29b34e01850a6acbb735399df80feb4121f 100644 (file)
@@ -1,5 +1,9 @@
 2000-11-02  Miles Bader  <miles@lsi.nec.co.jp>
 
+       * info.el (info-menu-header): New face.
+       (Info-fontify-menu-headers): New function.
+       (Info-fontify-node, Info-insert-dir): Call `Info-fontify-menu-headers'.
+
        * info.el (Info-insert-dir): Don't include blank lines at
        beginning of additional dir files (one is added automatically).
 
index e54a579620f3389344b52238be6caa5c4cf469a7..db6b0447464045d527ef9d4e63ae5993a2e4276b 100644 (file)
@@ -837,6 +837,7 @@ a case-insensitive match is tried."
       (while buffers
        (kill-buffer (car buffers))
        (setq buffers (cdr buffers)))
+      (if Info-fontify (Info-fontify-menu-headers))
       (goto-char (point-min))
       (if problems
          (message "Composing main Info directory...problems encountered, see `*Messages*'")
@@ -2385,6 +2386,27 @@ the variable `Info-file-list-for-emacs'."
   "Face for Info titles at level 4."
   :group 'info)
 
+(defface info-menu-header
+  '((((type tty pc))
+     :underline t
+     :weight bold)
+    (t
+     :inherit variable-pitch
+     :weight bold))
+  "Face for headers in Info menus."
+  :group 'info)
+
+(defun Info-fontify-menu-headers ()
+  "Add the face `info-menu-header' to any header before a menu entry."
+  (save-excursion
+    (goto-char (point-min))
+    (when (re-search-forward "\\* Menu:" nil t)
+      (put-text-property (match-beginning 0) (match-end 0)
+                        'face 'info-menu-header)
+      (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t)
+       (put-text-property (match-beginning 1) (match-end 1)
+                          'face 'info-menu-header)))))
+
 (defun Info-fontify-node ()
   (save-excursion
     (let ((buffer-read-only nil)
@@ -2456,6 +2478,7 @@ the variable `Info-file-list-for-emacs'."
                                   '(face info-xref
                                     mouse-face highlight
                                     help-echo "mouse-2: go to this node")))))
+      (Info-fontify-menu-headers)
       (set-buffer-modified-p nil))))
 \f