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: Colin Walters
Subject: [Emacs-diffs] Changes to emacs/lisp/info.el
Date: Tue, 21 May 2002 18:22:11 -0400

Index: emacs/lisp/info.el
diff -c emacs/lisp/info.el:1.298 emacs/lisp/info.el:1.299
*** emacs/lisp/info.el:1.298    Wed May  8 10:38:30 2002
--- emacs/lisp/info.el  Tue May 21 18:22:10 2002
***************
*** 55,65 ****
  The Lisp code is executed when the node is selected.")
  (put 'Info-enable-active-nodes 'risky-local-variable t)
  
- (defcustom Info-fontify t
-   "*Non-nil enables highlighting and fonts in Info nodes."
-   :type 'boolean
-   :group 'info)
- 
  (defface info-node
    '((((class color) (background light)) (:foreground "brown" :weight bold 
:slant italic))
      (((class color) (background dark)) (:foreground "white" :weight bold 
:slant italic))
--- 55,60 ----
***************
*** 150,155 ****
--- 145,155 ----
    :type 'boolean
    :group 'info)
  
+ (defcustom Info-mode-hook '(font-lock-mode)
+   "Hooks run when `info-mode' is called."
+   :type 'hook
+   :group 'info)
+ 
  (defvar Info-current-file nil
    "Info file that Info is now looking at, or nil.
  This is the name that was specified in Info, not the actual file name.
***************
*** 997,1003 ****
                                            (read (current-buffer))))))
                            (point-max)))
        (if Info-enable-active-nodes (eval active-expression))
!       (if Info-fontify (Info-fontify-node))
        (if Info-use-header-line
            (Info-setup-header-line)
          (setq Info-header-line nil)
--- 997,1003 ----
                                            (read (current-buffer))))))
                            (point-max)))
        (if Info-enable-active-nodes (eval active-expression))
!       (Info-fontify-node)
        (if Info-use-header-line
            (Info-setup-header-line)
          (setq Info-header-line nil)
***************
*** 2340,2345 ****
--- 2340,2355 ----
    (setq Info-tag-table-marker (make-marker))
    (make-local-variable 'Info-tag-table-buffer)
    (setq Info-tag-table-buffer nil)
+   (set (make-local-variable 'font-lock-category-alist)
+        '((info-menu-header . info-menu-header)
+        (info-header-node . info-header-node)
+        (info-header-xref . info-header-xref)
+        (Info-title-1-face . Info-title-1-face)
+        (Info-title-2-face . Info-title-2-face)
+        (Info-title-3-face . Info-title-3-face)
+        (Info-title-4-face . Info-title-4-face)
+        (info-menu-5 . info-menu-5)
+        (info-xref . info-xref)))
    (make-local-variable 'Info-history)
    (make-local-variable 'Info-index-alternatives)
    (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
***************
*** 2587,2596 ****
      (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 ()
    ;; Only fontify the node if it hasn't already been done.  [We pass in
--- 2597,2606 ----
      (goto-char (point-min))
      (when (re-search-forward "\\* Menu:" nil t)
        (put-text-property (match-beginning 0) (match-end 0)
!                        'category 'info-menu-header)
        (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t)
        (put-text-property (match-beginning 1) (match-end 1)
!                          'category 'info-menu-header)))))
  
  (defun Info-fontify-node ()
    ;; Only fontify the node if it hasn't already been done.  [We pass in
***************
*** 2618,2625 ****
                   (tbeg (match-beginning 1))
                   (tag (buffer-substring tbeg (match-end 1))))
              (if (string-equal tag "Node")
!                 (put-text-property nbeg nend 'face 'info-header-node)
!               (put-text-property nbeg nend 'face 'info-header-xref)
                (put-text-property tbeg nend 'mouse-face 'highlight)
                (put-text-property tbeg nend
                                   'help-echo
--- 2628,2635 ----
                   (tbeg (match-beginning 1))
                   (tag (buffer-substring tbeg (match-end 1))))
              (if (string-equal tag "Node")
!                 (put-text-property nbeg nend 'category 'info-header-node)
!               (put-text-property nbeg nend 'category 'info-header-xref)
                (put-text-property tbeg nend 'mouse-face 'highlight)
                (put-text-property tbeg nend
                                   'help-echo
***************
*** 2646,2659 ****
        (goto-char (point-min))
        (while (re-search-forward "\n\\([^ 
\t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$"
                                  nil t)
!         (let ((c (preceding-char))
!               face)
!           (cond ((= c ?*) (setq face 'Info-title-1-face))
!                 ((= c ?=) (setq face 'Info-title-2-face))
!                 ((= c ?-) (setq face 'Info-title-3-face))
!                 (t        (setq face 'Info-title-4-face)))
            (put-text-property (match-beginning 1) (match-end 1)
!                              'face face))
          ;; This is a serious problem for trying to handle multiple
          ;; frame types at once.  We want this text to be invisible
          ;; on frames that can display the font above.
--- 2656,2669 ----
        (goto-char (point-min))
        (while (re-search-forward "\n\\([^ 
\t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$"
                                  nil t)
!         (let* ((c (preceding-char))
!                (category
!                 (cond ((= c ?*) 'Info-title-1-face)
!                       ((= c ?=) 'Info-title-2-face)
!                       ((= c ?-) 'Info-title-3-face)
!                       (t        'Info-title-4-face))))
            (put-text-property (match-beginning 1) (match-end 1)
!                              'category category))
          ;; This is a serious problem for trying to handle multiple
          ;; frame types at once.  We want this text to be invisible
          ;; on frames that can display the font above.
***************
*** 2665,2671 ****
          (if (= (char-after (1- (match-beginning 0))) ?\") ; hack
              nil
            (add-text-properties (match-beginning 1) (match-end 1)
!                                '(face info-xref
                                   mouse-face highlight
                                   help-echo "mouse-2: go to this node"))))
        (goto-char (point-min))
--- 2675,2681 ----
          (if (= (char-after (1- (match-beginning 0))) ?\") ; hack
              nil
            (add-text-properties (match-beginning 1) (match-end 1)
!                                '(category info-xref
                                   mouse-face highlight
                                   help-echo "mouse-2: go to this node"))))
        (goto-char (point-min))
***************
*** 2679,2687 ****
                (if (zerop (% n 3)) ; visual aids to help with 1-9 keys
                    (put-text-property (match-beginning 0)
                                       (1+ (match-beginning 0))
!                                      'face 'info-menu-5))
                (add-text-properties (match-beginning 1) (match-end 1)
!                                    '(face info-xref
                                       mouse-face highlight
                                       help-echo "mouse-2: go to this node")))))
        (Info-fontify-menu-headers)
--- 2689,2697 ----
                (if (zerop (% n 3)) ; visual aids to help with 1-9 keys
                    (put-text-property (match-beginning 0)
                                       (1+ (match-beginning 0))
!                                      'category 'info-menu-5))
                (add-text-properties (match-beginning 1) (match-end 1)
!                                    '(category info-xref
                                       mouse-face highlight
                                       help-echo "mouse-2: go to this node")))))
        (Info-fontify-menu-headers)



reply via email to

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