comparison lisp/info.el @ 67303:7bd56e8182b2

* info.el (Info-fontify-node): Match external links using non-directory part of filename.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 04 Dec 2005 04:31:59 +0000
parents bf8d1c67233d
children 91886d91f4c3
comparison
equal deleted inserted replaced
67302:ba871f6905f7 67303:7bd56e8182b2
3798 "[ \t\n]+" " " 3798 "[ \t\n]+" " "
3799 (or (match-string 5) 3799 (or (match-string 5)
3800 (and (not (equal (match-string 4) "")) 3800 (and (not (equal (match-string 4) ""))
3801 (match-string 4)) 3801 (match-string 4))
3802 (match-string 2))))) 3802 (match-string 2)))))
3803 (file Info-current-file) 3803 (external-link-p
3804 (string-match "(\\([^)]+\\))\\([^)]*\\)" node))
3805 (file (if external-link-p
3806 (file-name-nondirectory
3807 (match-string 1 node))
3808 Info-current-file))
3804 (hl Info-history-list) 3809 (hl Info-history-list)
3805 res) 3810 res)
3806 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) 3811 (if external-link-p
3807 (setq file (Info-find-file (match-string 1 node) t) 3812 (setq node (if (equal (match-string 2 node) "")
3808 node (if (equal (match-string 2 node) "")
3809 "Top" 3813 "Top"
3810 (match-string 2 node)))) 3814 (match-string 2 node))))
3811 (while hl 3815 (while hl
3812 (if (and (string-equal node (nth 1 (car hl))) 3816 (if (and (string-equal node (nth 1 (car hl)))
3813 (string-equal file (nth 0 (car hl)))) 3817 (string-equal
3818 file (if external-link-p
3819 (file-name-nondirectory
3820 (caar hl))
3821 (caar hl))))
3814 (setq res (car hl) hl nil) 3822 (setq res (car hl) hl nil)
3815 (setq hl (cdr hl)))) 3823 (setq hl (cdr hl))))
3816 res))) 'info-xref-visited 'info-xref)) 3824 res))) 'info-xref-visited 'info-xref))
3817 ;; For multiline ref, unfontify newline and surrounding whitespace 3825 ;; For multiline ref, unfontify newline and surrounding whitespace
3818 (save-excursion 3826 (save-excursion
3900 (match-beginning 1) (match-end 1) 3908 (match-beginning 1) (match-end 1)
3901 'font-lock-face 3909 'font-lock-face
3902 ;; Display visited menu items in a different face 3910 ;; Display visited menu items in a different face
3903 (if (and Info-fontify-visited-nodes 3911 (if (and Info-fontify-visited-nodes
3904 (save-match-data 3912 (save-match-data
3905 (let ((node (if (equal (match-string 3) "") 3913 (let* ((node (if (equal (match-string 3) "")
3906 (match-string 1) 3914 (match-string 1)
3907 (match-string 3))) 3915 (match-string 3)))
3908 (file Info-current-file) 3916 (external-link-p
3909 (hl Info-history-list) 3917 (string-match "(\\([^)]+\\))\\([^)]*\\)" node))
3910 res) 3918 (file (if external-link-p
3911 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) 3919 (file-name-nondirectory
3912 (setq file (Info-find-file (match-string 1 node) t) 3920 (match-string 1 node))
3913 node (if (equal (match-string 2 node) "") 3921 Info-current-file))
3922 (hl Info-history-list)
3923 res)
3924 (if external-link-p
3925 (setq node (if (equal (match-string 2 node) "")
3914 "Top" 3926 "Top"
3915 (match-string 2 node)))) 3927 (match-string 2 node))))
3916 (while hl 3928 (while hl
3917 (if (and (string-equal node (nth 1 (car hl))) 3929 (if (and (string-equal node (nth 1 (car hl)))
3918 (string-equal file (nth 0 (car hl)))) 3930 (string-equal
3931 file (if external-link-p
3932 (file-name-nondirectory (caar hl))
3933 (caar hl))))
3919 (setq res (car hl) hl nil) 3934 (setq res (car hl) hl nil)
3920 (setq hl (cdr hl)))) 3935 (setq hl (cdr hl))))
3921 res))) 'info-xref-visited 'info-xref))) 3936 res))) 'info-xref-visited 'info-xref)))
3922 (when (and not-fontified-p (memq Info-hide-note-references '(t hide))) 3937 (when (and not-fontified-p (memq Info-hide-note-references '(t hide)))
3923 (put-text-property (match-beginning 2) (1- (match-end 6)) 3938 (put-text-property (match-beginning 2) (1- (match-end 6))