aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-10-16 14:12:03 +0000
committerStefan Monnier2005-10-16 14:12:03 +0000
commita73db543bf9c04d1f5438461fa6b4fb52f1af85a (patch)
tree7a3d5d3770e4ebb4915468a3439816c0f1220b86
parent9cee7d84e731f707dfdf9a6710ab3674eec68729 (diff)
downloademacs-a73db543bf9c04d1f5438461fa6b4fb52f1af85a.tar.gz
emacs-a73db543bf9c04d1f5438461fa6b4fb52f1af85a.zip
(Info-fontify-node): Use dolist.
(Info-fontify-node): Change add-text-properties to put-text-property.
-rw-r--r--lisp/info.el71
1 files changed, 34 insertions, 37 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 5d86d0cb46e..0e2f8219d5b 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3847,17 +3847,15 @@ the variable `Info-file-list-for-emacs'."
3847 (paragraph-separate ".*\\.[ \t]*\n[ \t]\\|[ \t]*[-*]\\|[ \t\f]*$") 3847 (paragraph-separate ".*\\.[ \t]*\n[ \t]\\|[ \t]*[-*]\\|[ \t\f]*$")
3848 (adaptive-fill-mode nil)) 3848 (adaptive-fill-mode nil))
3849 (goto-char (point-max)) 3849 (goto-char (point-max))
3850 (while paragraph-markers 3850 (dolist (m paragraph-markers)
3851 (let ((m (car paragraph-markers))) 3851 (when (< m (point))
3852 (setq paragraph-markers (cdr paragraph-markers)) 3852 (goto-char m)
3853 (when (< m (point)) 3853 (beginning-of-line)
3854 (goto-char m) 3854 (let ((beg (point)))
3855 (beginning-of-line) 3855 (when (zerop (forward-paragraph))
3856 (let ((beg (point))) 3856 (fill-individual-paragraphs beg (point) nil nil)
3857 (when (zerop (forward-paragraph)) 3857 (goto-char beg))))
3858 (fill-individual-paragraphs beg (point) nil nil) 3858 (set-marker m nil))))
3859 (goto-char beg))))
3860 (set-marker m nil)))))
3861 3859
3862 ;; Fontify menu items 3860 ;; Fontify menu items
3863 (goto-char (point-min)) 3861 (goto-char (point-min))
@@ -3889,33 +3887,32 @@ the variable `Info-file-list-for-emacs'."
3889 "mouse-2: go to this node") 3887 "mouse-2: go to this node")
3890 'mouse-face 'highlight))) 3888 'mouse-face 'highlight)))
3891 (when (or not-fontified-p fontify-visited-p) 3889 (when (or not-fontified-p fontify-visited-p)
3892 (add-text-properties 3890 (put-text-property
3893 (match-beginning 1) (match-end 1) 3891 (match-beginning 1) (match-end 1)
3894 (list 3892 'font-lock-face
3895 'font-lock-face 3893 ;; Display visited menu items in a different face
3896 ;; Display visited menu items in a different face 3894 (if (and Info-fontify-visited-nodes
3897 (if (and Info-fontify-visited-nodes 3895 (save-match-data
3898 (save-match-data 3896 (let ((node (if (equal (match-string 3) "")
3899 (let ((node (if (equal (match-string 3) "") 3897 (match-string 1)
3900 (match-string 1) 3898 (match-string 3)))
3901 (match-string 3))) 3899 (file (file-name-nondirectory Info-current-file))
3902 (file (file-name-nondirectory Info-current-file)) 3900 (hl Info-history-list)
3903 (hl Info-history-list) 3901 res)
3904 res) 3902 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node)
3905 (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) 3903 (setq file (file-name-nondirectory
3906 (setq file (file-name-nondirectory 3904 (match-string 1 node))
3907 (match-string 1 node)) 3905 node (if (equal (match-string 2 node) "")
3908 node (if (equal (match-string 2 node) "") 3906 "Top"
3909 "Top" 3907 (match-string 2 node))))
3910 (match-string 2 node)))) 3908 (while hl
3911 (while hl 3909 (if (and (string-equal node (nth 1 (car hl)))
3912 (if (and (string-equal node (nth 1 (car hl))) 3910 (string-equal file
3913 (string-equal file 3911 (file-name-nondirectory
3914 (file-name-nondirectory 3912 (nth 0 (car hl)))))
3915 (nth 0 (car hl))))) 3913 (setq res (car hl) hl nil)
3916 (setq res (car hl) hl nil) 3914 (setq hl (cdr hl))))
3917 (setq hl (cdr hl)))) 3915 res))) 'info-xref-visited 'info-xref)))
3918 res))) 'info-xref-visited 'info-xref))))
3919 (when (and not-fontified-p (memq Info-hide-note-references '(t hide))) 3916 (when (and not-fontified-p (memq Info-hide-note-references '(t hide)))
3920 (put-text-property (match-beginning 2) (1- (match-end 6)) 3917 (put-text-property (match-beginning 2) (1- (match-end 6))
3921 'invisible t) 3918 'invisible t)