diff options
| author | Thien-Thi Nguyen | 2004-10-18 07:31:43 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2004-10-18 07:31:43 +0000 |
| commit | e14105f6fa9ce465dd171f753abec2a7f5e4b61d (patch) | |
| tree | a19736eaf9686ff0587f4d789d388d1ca6cdfa6f | |
| parent | bcabe045db2f9c08c2b0078e153ab458715e2ca1 (diff) | |
| download | emacs-e14105f6fa9ce465dd171f753abec2a7f5e4b61d.tar.gz emacs-e14105f6fa9ce465dd171f753abec2a7f5e4b61d.zip | |
(Info-fontify-node): For multiline refs,
arrange to unfontify newline and surrounding whitespace.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/info.el | 78 |
2 files changed, 49 insertions, 34 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a0ba6ba22ec..a3fb778928c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-10-18 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 2 | |||
| 3 | * info.el (Info-fontify-node): For multiline refs, | ||
| 4 | arrange to unfontify newline and surrounding whitespace. | ||
| 5 | |||
| 1 | 2004-10-17 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2004-10-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * vc-arch.el (vc-arch-workfile-version): Don't burp if the patch-log | 8 | * vc-arch.el (vc-arch-workfile-version): Don't burp if the patch-log |
diff --git a/lisp/info.el b/lisp/info.el index 386f5b612ec..17905c6d738 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -3445,7 +3445,8 @@ Preserve text properties." | |||
| 3445 | (fontify-visited-p ; visited nodes need to be re-fontified | 3445 | (fontify-visited-p ; visited nodes need to be re-fontified |
| 3446 | (and Info-fontify-visited-nodes | 3446 | (and Info-fontify-visited-nodes |
| 3447 | ;; Don't take time to refontify visited nodes in huge nodes | 3447 | ;; Don't take time to refontify visited nodes in huge nodes |
| 3448 | (< (- (point-max) (point-min)) Info-fontify-maximum-menu-size)))) | 3448 | (< (- (point-max) (point-min)) Info-fontify-maximum-menu-size))) |
| 3449 | rbeg rend) | ||
| 3449 | 3450 | ||
| 3450 | ;; Fontify header line | 3451 | ;; Fontify header line |
| 3451 | (goto-char (point-min)) | 3452 | (goto-char (point-min)) |
| @@ -3570,39 +3571,48 @@ Preserve text properties." | |||
| 3570 | "mouse-2: go to this node") | 3571 | "mouse-2: go to this node") |
| 3571 | 'mouse-face 'highlight))) | 3572 | 'mouse-face 'highlight))) |
| 3572 | (when (or not-fontified-p fontify-visited-p) | 3573 | (when (or not-fontified-p fontify-visited-p) |
| 3573 | (add-text-properties | 3574 | (setq rbeg (match-beginning 2) |
| 3574 | (match-beginning 2) (match-end 2) | 3575 | rend (match-end 2)) |
| 3575 | (list | 3576 | (put-text-property |
| 3576 | 'font-lock-face | 3577 | rbeg rend |
| 3577 | ;; Display visited nodes in a different face | 3578 | 'font-lock-face |
| 3578 | (if (and Info-fontify-visited-nodes | 3579 | ;; Display visited nodes in a different face |
| 3579 | (save-match-data | 3580 | (if (and Info-fontify-visited-nodes |
| 3580 | (let* ((node (replace-regexp-in-string | 3581 | (save-match-data |
| 3581 | "^[ \t]+" "" | 3582 | (let* ((node (replace-regexp-in-string |
| 3582 | (replace-regexp-in-string | 3583 | "^[ \t]+" "" |
| 3583 | "[ \t\n]+" " " | 3584 | (replace-regexp-in-string |
| 3584 | (or (match-string 5) | 3585 | "[ \t\n]+" " " |
| 3585 | (and (not (equal (match-string 4) "")) | 3586 | (or (match-string 5) |
| 3586 | (match-string 4)) | 3587 | (and (not (equal (match-string 4) "")) |
| 3587 | (match-string 2))))) | 3588 | (match-string 4)) |
| 3588 | (file (file-name-nondirectory | 3589 | (match-string 2))))) |
| 3589 | Info-current-file)) | 3590 | (file (file-name-nondirectory |
| 3590 | (hl Info-history-list) | 3591 | Info-current-file)) |
| 3591 | res) | 3592 | (hl Info-history-list) |
| 3592 | (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) | 3593 | res) |
| 3593 | (setq file (file-name-nondirectory | 3594 | (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) |
| 3594 | (match-string 1 node)) | 3595 | (setq file (file-name-nondirectory |
| 3595 | node (if (equal (match-string 2 node) "") | 3596 | (match-string 1 node)) |
| 3596 | "Top" | 3597 | node (if (equal (match-string 2 node) "") |
| 3597 | (match-string 2 node)))) | 3598 | "Top" |
| 3598 | (while hl | 3599 | (match-string 2 node)))) |
| 3599 | (if (and (string-equal node (nth 1 (car hl))) | 3600 | (while hl |
| 3600 | (string-equal file | 3601 | (if (and (string-equal node (nth 1 (car hl))) |
| 3601 | (file-name-nondirectory | 3602 | (string-equal file |
| 3602 | (nth 0 (car hl))))) | 3603 | (file-name-nondirectory |
| 3603 | (setq res (car hl) hl nil) | 3604 | (nth 0 (car hl))))) |
| 3604 | (setq hl (cdr hl)))) | 3605 | (setq res (car hl) hl nil) |
| 3605 | res))) 'info-xref-visited 'info-xref)))) | 3606 | (setq hl (cdr hl)))) |
| 3607 | res))) 'info-xref-visited 'info-xref)) | ||
| 3608 | ;; For multiline ref, unfontify newline and surrounding whitespace | ||
| 3609 | (save-excursion | ||
| 3610 | (goto-char rbeg) | ||
| 3611 | (save-match-data | ||
| 3612 | (while (re-search-forward "\\s-*\n\\s-*" rend t nil) | ||
| 3613 | (remove-text-properties (match-beginning 0) | ||
| 3614 | (match-end 0) | ||
| 3615 | '(font-lock-face t)))))) | ||
| 3606 | (when not-fontified-p | 3616 | (when not-fontified-p |
| 3607 | (when (memq Info-hide-note-references '(t hide)) | 3617 | (when (memq Info-hide-note-references '(t hide)) |
| 3608 | (add-text-properties (match-beginning 3) (match-end 3) | 3618 | (add-text-properties (match-beginning 3) (match-end 3) |