# HG changeset patch # User Kim F. Storm # Date 1037230485 0 # Node ID 205cb7dc9d475eebc84571ebe5f7dd221e727be1 # Parent a820dd4741e188b31023168bd466e1a16d288cf6 (Info-fontify-node): New local list paragraph-markers. Record markers for mangled *note references on that list. When done, go back through those markers and fill each mangled paragraph with `fill-nobreak-invisible' let-bound to t. Don't use `display' property; insert "see" directly in buffer. diff -r a820dd4741e1 -r 205cb7dc9d47 lisp/info.el --- a/lisp/info.el Wed Nov 13 23:32:21 2002 +0000 +++ b/lisp/info.el Wed Nov 13 23:34:45 2002 +0000 @@ -2658,7 +2658,8 @@ (unless (next-property-change (point-min)) (save-excursion (let ((inhibit-read-only t) - (case-fold-search t)) + (case-fold-search t) + paragraph-markers) (goto-char (point-min)) (when (looking-at "^\\(File: [^,: \t]+,?[ \t]+\\)?") (goto-char (match-end 0)) @@ -2732,12 +2733,13 @@ (goto-char (point-min)) (while (re-search-forward "\\(\\*Note[ \n\t]*\\)\\([^:]*\\)\\(:[^.,:(]*\\(([^)]*)[^.,:]*\\)?[,:]?\n?\\)" nil t) (unless (= (char-after (1- (match-beginning 0))) ?\") ; hack - (let ((next (point)) + (let ((start (match-beginning 0)) + (next (point)) (hide-tag Info-hide-note-references) other-tag) (when hide-tag ;; *Note is often used where *note should have been - (goto-char (match-beginning 0)) + (goto-char start) (skip-syntax-backward " ") (setq other-tag (cond @@ -2750,18 +2752,31 @@ (goto-char next)) (if hide-tag (add-text-properties (match-beginning 1) (match-end 1) - (if other-tag - (list 'display other-tag) - '(invisible t)))) + '(invisible t))) (add-text-properties (match-beginning 2) (match-end 2) '(font-lock-face info-xref mouse-face highlight help-echo "mouse-2: go to this node")) (when (eq Info-hide-note-references t) (add-text-properties (match-beginning 3) (match-end 3) - (if (string-match "\n" (match-string 0)) - '(display "\n") - '(invisible t))))))) + '(invisible t))) + (when other-tag + (goto-char (match-beginning 1)) + (insert other-tag)) + (when (or hide-tag (eq Info-hide-note-references t)) + (setq paragraph-markers (cons (set-marker (make-marker) start) + paragraph-markers)))))) + + (let ((fill-nobreak-invisible t)) + (goto-char (point-max)) + (while paragraph-markers + (let ((m (car paragraph-markers))) + (setq paragraph-markers (cdr paragraph-markers)) + (when (< m (point)) + (goto-char m) + (fill-paragraph nil) + (backward-paragraph 1)) + (set-marker m nil)))) (goto-char (point-min)) (if (and (search-forward "\n* Menu:" nil t)