From 6a545cc7fec499e70625b473fb1657ff99b40ad5 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 13 Nov 2002 23:35:10 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 12 ++++++++++++ lisp/info.el | 33 ++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b6f9cb53a78..2f17d4486f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2002-11-14 Kim F. Storm + + * textmodes/fill.el (fill-nobreak-invisible): New var. + (fill-nobreak-p): Test it; return t if set and point invisible. + (fill-newline): Test it; remove invisible prop on newline if set. + + * info.el (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. + 2002-11-13 Andre Spiegel * vc-rcs.el (vc-rcs-registered): Improve comment. diff --git a/lisp/info.el b/lisp/info.el index 3a5df0f5a15..168cef81fa0 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2658,7 +2658,8 @@ the variable `Info-file-list-for-emacs'." (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 @@ the variable `Info-file-list-for-emacs'." (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 @@ the variable `Info-file-list-for-emacs'." (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) -- 2.39.2