comparison lisp/info.el @ 51731:6b3b6b76e307

Disable paragraph refilling. (Info-refill-paragraphs): New defcustom. (Info-fontify-node): Use it.
author Kim F. Storm <storm@cua.dk>
date Fri, 04 Jul 2003 21:40:22 +0000
parents 02d430615dd4
children 204ae43066d1
comparison
equal deleted inserted replaced
51730:c260f6b63ced 51731:6b3b6b76e307
158 If value is non-nil but not t, the reference section is still shown." 158 If value is non-nil but not t, the reference section is still shown."
159 :version "21.4" 159 :version "21.4"
160 :type '(choice (const :tag "No reformatting" nil) 160 :type '(choice (const :tag "No reformatting" nil)
161 (const :tag "Replace tag and hide reference" t) 161 (const :tag "Replace tag and hide reference" t)
162 (other :tag "Replace only tag" tag)) 162 (other :tag "Replace only tag" tag))
163 :group 'info)
164
165 (defcustom Info-refill-paragraphs nil
166 "*If non-nil, attempt to refill paragraphs with hidden references.
167 This refilling may accidentally remove explicit line breaks in the info
168 file, so be prepared for a few surprises if you enable this feature."
169 :version "21.4"
170 :type 'boolean
163 :group 'info) 171 :group 'info)
164 172
165 (defcustom Info-mode-hook 173 (defcustom Info-mode-hook
166 ;; Try to obey obsolete Info-fontify settings. 174 ;; Try to obey obsolete Info-fontify settings.
167 (unless (and (boundp 'Info-fontify) (null Info-fontify)) 175 (unless (and (boundp 'Info-fontify) (null Info-fontify))
2903 '(invisible t front-sticky nil rear-nonsticky t))) 2911 '(invisible t front-sticky nil rear-nonsticky t)))
2904 (when other-tag 2912 (when other-tag
2905 (save-excursion 2913 (save-excursion
2906 (goto-char (match-beginning 1)) 2914 (goto-char (match-beginning 1))
2907 (insert other-tag))) 2915 (insert other-tag)))
2908 (when (or hide-tag (eq Info-hide-note-references t)) 2916 (when (and Info-refill-paragraphs
2917 (or hide-tag (eq Info-hide-note-references t)))
2909 (push (set-marker (make-marker) start) 2918 (push (set-marker (make-marker) start)
2910 paragraph-markers))))) 2919 paragraph-markers)))))
2911 2920
2912 (let ((fill-nobreak-invisible t) 2921 (when (and Info-refill-paragraphs
2913 (fill-individual-varying-indent nil) 2922 paragraph-markers)
2914 (paragraph-start "\f\\|[ \t]*[-*]\\|[ \t]*$") 2923 (let ((fill-nobreak-invisible t)
2915 (paragraph-separate ".*\\.[ \t]*\n[ \t]\\|[ \t]*[-*]\\|[ \t\f]*$") 2924 (fill-individual-varying-indent nil)
2916 (adaptive-fill-mode nil)) 2925 (paragraph-start "\f\\|[ \t]*[-*]\\|[ \t]*$")
2917 (goto-char (point-max)) 2926 (paragraph-separate ".*\\.[ \t]*\n[ \t]\\|[ \t]*[-*]\\|[ \t\f]*$")
2918 (while paragraph-markers 2927 (adaptive-fill-mode nil))
2919 (let ((m (car paragraph-markers))) 2928 (goto-char (point-max))
2920 (setq paragraph-markers (cdr paragraph-markers)) 2929 (while paragraph-markers
2921 (when (< m (point)) 2930 (let ((m (car paragraph-markers)))
2922 (goto-char m) 2931 (setq paragraph-markers (cdr paragraph-markers))
2923 (beginning-of-line) 2932 (when (< m (point))
2924 (let ((beg (point))) 2933 (goto-char m)
2925 (when (zerop (forward-paragraph)) 2934 (beginning-of-line)
2926 (fill-individual-paragraphs beg (point) nil nil) 2935 (let ((beg (point)))
2927 (goto-char beg)))) 2936 (when (zerop (forward-paragraph))
2928 (set-marker m nil)))) 2937 (fill-individual-paragraphs beg (point) nil nil)
2938 (goto-char beg))))
2939 (set-marker m nil)))))
2929 2940
2930 (goto-char (point-min)) 2941 (goto-char (point-min))
2931 (when (and (search-forward "\n* Menu:" nil t) 2942 (when (and (search-forward "\n* Menu:" nil t)
2932 (not (string-match "\\<Index\\>" Info-current-node)) 2943 (not (string-match "\\<Index\\>" Info-current-node))
2933 ;; Don't take time to annotate huge menus 2944 ;; Don't take time to annotate huge menus