comparison lisp/info.el @ 51471:43a7f19808e0

(Info-fontify-node): Individually refill menus and paragraphs to preserve menu items and varying indentation. Only color first 9 menu items differently.
author Kim F. Storm <storm@cua.dk>
date Wed, 04 Jun 2003 23:14:34 +0000
parents 63b62b12e01c
children 0f2773d31797
comparison
equal deleted inserted replaced
51470:841075bd874a 51471:43a7f19808e0
2867 ;; *Note is often used where *note should have been 2867 ;; *Note is often used where *note should have been
2868 (goto-char start) 2868 (goto-char start)
2869 (skip-syntax-backward " ") 2869 (skip-syntax-backward " ")
2870 (setq other-tag 2870 (setq other-tag
2871 (cond 2871 (cond
2872 ((<= (point) (point-min))
2873 "See ")
2872 ((memq (char-before) '(nil ?\. ?! )) 2874 ((memq (char-before) '(nil ?\. ?! ))
2873 "See ") 2875 "See ")
2874 ((memq (char-before) '( ?\( ?\[ ?\{ ?\, ?\; ?\: )) 2876 ((memq (char-before) '( ?\( ?\[ ?\{ ?\, ?\; ?\: ))
2875 "see "))) 2877 "see ")))
2876 (goto-char next)) 2878 (goto-char next))
2894 (insert other-tag))) 2896 (insert other-tag)))
2895 (when (or hide-tag (eq Info-hide-note-references t)) 2897 (when (or hide-tag (eq Info-hide-note-references t))
2896 (push (set-marker (make-marker) start) 2898 (push (set-marker (make-marker) start)
2897 paragraph-markers))))) 2899 paragraph-markers)))))
2898 2900
2899 (let ((fill-nobreak-invisible t)) 2901 (let ((fill-nobreak-invisible t)
2902 (fill-individual-varying-indent nil)
2903 (paragraph-start "\f\\|[ \t]*[-*]\\|[ \t]*$")
2904 (paragraph-separate "[ \t]*[-*]\\|[ \t\f]*$")
2905 (adaptive-fill-mode nil))
2900 (goto-char (point-max)) 2906 (goto-char (point-max))
2901 (while paragraph-markers 2907 (while paragraph-markers
2902 (let ((m (car paragraph-markers))) 2908 (let ((m (car paragraph-markers)))
2903 (setq paragraph-markers (cdr paragraph-markers)) 2909 (setq paragraph-markers (cdr paragraph-markers))
2904 (when (< m (point)) 2910 (when (< m (point))
2905 (goto-char m) 2911 (goto-char m)
2906 (fill-paragraph nil) 2912 (move-to-left-margin)
2907 (backward-paragraph 1)) 2913 (when (zerop (forward-paragraph))
2914 (let ((end (point))
2915 (beg (progn (backward-paragraph) (point))))
2916 (fill-individual-paragraphs beg end nil nil)
2917 (goto-char beg))))
2908 (set-marker m nil)))) 2918 (set-marker m nil))))
2909 2919
2910 (goto-char (point-min)) 2920 (goto-char (point-min))
2911 (when (and (search-forward "\n* Menu:" nil t) 2921 (when (and (search-forward "\n* Menu:" nil t)
2912 (not (string-match "\\<Index\\>" Info-current-node)) 2922 (not (string-match "\\<Index\\>" Info-current-node))
2917 (while (re-search-forward (concat "^\\* +\\([^:\t\n]*\\)\\(:" 2927 (while (re-search-forward (concat "^\\* +\\([^:\t\n]*\\)\\(:"
2918 Info-node-spec-re 2928 Info-node-spec-re
2919 "\\([ \t]*\\)\\)") 2929 "\\([ \t]*\\)\\)")
2920 nil t) 2930 nil t)
2921 (setq n (1+ n)) 2931 (setq n (1+ n))
2922 (if (zerop (% n 3)) ; visual aids to help with 1-9 keys 2932 (if (and (<= n 9) (zerop (% n 3))) ; visual aids to help with 1-9 keys
2923 (put-text-property (match-beginning 0) 2933 (put-text-property (match-beginning 0)
2924 (1+ (match-beginning 0)) 2934 (1+ (match-beginning 0))
2925 'font-lock-face 'info-menu-5)) 2935 'font-lock-face 'info-menu-5))
2926 (add-text-properties 2936 (add-text-properties
2927 (match-beginning 1) (match-end 1) 2937 (match-beginning 1) (match-end 1)