diff options
| author | Kim F. Storm | 2002-11-13 23:35:10 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-11-13 23:35:10 +0000 |
| commit | 6a545cc7fec499e70625b473fb1657ff99b40ad5 (patch) | |
| tree | f368dd3133521029bb353d01667d0d0c036b3a90 | |
| parent | 1b457e183fb99d01d69628d8aab88d4cd305970b (diff) | |
| download | emacs-6a545cc7fec499e70625b473fb1657ff99b40ad5.tar.gz emacs-6a545cc7fec499e70625b473fb1657ff99b40ad5.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2002-11-14 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * textmodes/fill.el (fill-nobreak-invisible): New var. | ||
| 4 | (fill-nobreak-p): Test it; return t if set and point invisible. | ||
| 5 | (fill-newline): Test it; remove invisible prop on newline if set. | ||
| 6 | |||
| 7 | * info.el (Info-fontify-node): New local list paragraph-markers. | ||
| 8 | Record markers for mangled *note references on that list. | ||
| 9 | When done, go back through those markers and fill each mangled | ||
| 10 | paragraph with `fill-nobreak-invisible' let-bound to t. | ||
| 11 | Don't use `display' property; insert "see" directly in buffer. | ||
| 12 | |||
| 1 | 2002-11-13 Andre Spiegel <spiegel@gnu.org> | 13 | 2002-11-13 Andre Spiegel <spiegel@gnu.org> |
| 2 | 14 | ||
| 3 | * vc-rcs.el (vc-rcs-registered): Improve comment. | 15 | * 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'." | |||
| 2658 | (unless (next-property-change (point-min)) | 2658 | (unless (next-property-change (point-min)) |
| 2659 | (save-excursion | 2659 | (save-excursion |
| 2660 | (let ((inhibit-read-only t) | 2660 | (let ((inhibit-read-only t) |
| 2661 | (case-fold-search t)) | 2661 | (case-fold-search t) |
| 2662 | paragraph-markers) | ||
| 2662 | (goto-char (point-min)) | 2663 | (goto-char (point-min)) |
| 2663 | (when (looking-at "^\\(File: [^,: \t]+,?[ \t]+\\)?") | 2664 | (when (looking-at "^\\(File: [^,: \t]+,?[ \t]+\\)?") |
| 2664 | (goto-char (match-end 0)) | 2665 | (goto-char (match-end 0)) |
| @@ -2732,12 +2733,13 @@ the variable `Info-file-list-for-emacs'." | |||
| 2732 | (goto-char (point-min)) | 2733 | (goto-char (point-min)) |
| 2733 | (while (re-search-forward "\\(\\*Note[ \n\t]*\\)\\([^:]*\\)\\(:[^.,:(]*\\(([^)]*)[^.,:]*\\)?[,:]?\n?\\)" nil t) | 2734 | (while (re-search-forward "\\(\\*Note[ \n\t]*\\)\\([^:]*\\)\\(:[^.,:(]*\\(([^)]*)[^.,:]*\\)?[,:]?\n?\\)" nil t) |
| 2734 | (unless (= (char-after (1- (match-beginning 0))) ?\") ; hack | 2735 | (unless (= (char-after (1- (match-beginning 0))) ?\") ; hack |
| 2735 | (let ((next (point)) | 2736 | (let ((start (match-beginning 0)) |
| 2737 | (next (point)) | ||
| 2736 | (hide-tag Info-hide-note-references) | 2738 | (hide-tag Info-hide-note-references) |
| 2737 | other-tag) | 2739 | other-tag) |
| 2738 | (when hide-tag | 2740 | (when hide-tag |
| 2739 | ;; *Note is often used where *note should have been | 2741 | ;; *Note is often used where *note should have been |
| 2740 | (goto-char (match-beginning 0)) | 2742 | (goto-char start) |
| 2741 | (skip-syntax-backward " ") | 2743 | (skip-syntax-backward " ") |
| 2742 | (setq other-tag | 2744 | (setq other-tag |
| 2743 | (cond | 2745 | (cond |
| @@ -2750,18 +2752,31 @@ the variable `Info-file-list-for-emacs'." | |||
| 2750 | (goto-char next)) | 2752 | (goto-char next)) |
| 2751 | (if hide-tag | 2753 | (if hide-tag |
| 2752 | (add-text-properties (match-beginning 1) (match-end 1) | 2754 | (add-text-properties (match-beginning 1) (match-end 1) |
| 2753 | (if other-tag | 2755 | '(invisible t))) |
| 2754 | (list 'display other-tag) | ||
| 2755 | '(invisible t)))) | ||
| 2756 | (add-text-properties (match-beginning 2) (match-end 2) | 2756 | (add-text-properties (match-beginning 2) (match-end 2) |
| 2757 | '(font-lock-face info-xref | 2757 | '(font-lock-face info-xref |
| 2758 | mouse-face highlight | 2758 | mouse-face highlight |
| 2759 | help-echo "mouse-2: go to this node")) | 2759 | help-echo "mouse-2: go to this node")) |
| 2760 | (when (eq Info-hide-note-references t) | 2760 | (when (eq Info-hide-note-references t) |
| 2761 | (add-text-properties (match-beginning 3) (match-end 3) | 2761 | (add-text-properties (match-beginning 3) (match-end 3) |
| 2762 | (if (string-match "\n" (match-string 0)) | 2762 | '(invisible t))) |
| 2763 | '(display "\n") | 2763 | (when other-tag |
| 2764 | '(invisible t))))))) | 2764 | (goto-char (match-beginning 1)) |
| 2765 | (insert other-tag)) | ||
| 2766 | (when (or hide-tag (eq Info-hide-note-references t)) | ||
| 2767 | (setq paragraph-markers (cons (set-marker (make-marker) start) | ||
| 2768 | paragraph-markers)))))) | ||
| 2769 | |||
| 2770 | (let ((fill-nobreak-invisible t)) | ||
| 2771 | (goto-char (point-max)) | ||
| 2772 | (while paragraph-markers | ||
| 2773 | (let ((m (car paragraph-markers))) | ||
| 2774 | (setq paragraph-markers (cdr paragraph-markers)) | ||
| 2775 | (when (< m (point)) | ||
| 2776 | (goto-char m) | ||
| 2777 | (fill-paragraph nil) | ||
| 2778 | (backward-paragraph 1)) | ||
| 2779 | (set-marker m nil)))) | ||
| 2765 | 2780 | ||
| 2766 | (goto-char (point-min)) | 2781 | (goto-char (point-min)) |
| 2767 | (if (and (search-forward "\n* Menu:" nil t) | 2782 | (if (and (search-forward "\n* Menu:" nil t) |