aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1999-08-29 19:19:00 +0000
committerRichard M. Stallman1999-08-29 19:19:00 +0000
commit289f0da2ca8f283e1e3dbd56283f698fb4a5cec0 (patch)
tree209aac40af598918df0a323c839d4eb898877fce
parentc4d7c00a24ca2f2dbd93e488efe3cf21b07a0388 (diff)
downloademacs-289f0da2ca8f283e1e3dbd56283f698fb4a5cec0.tar.gz
emacs-289f0da2ca8f283e1e3dbd56283f698fb4a5cec0.zip
(Info-tagify): Don't insert more than one newline before the tag table.
(Info-tagify): Start by widening. Match node headers that don't list the file name, and more kinds of page separations. Strip properties during tagification. Use start of node header line as tag's position. Fix the "done" message. (Info-validate): Save and restore match data around narrowing down.
-rw-r--r--lisp/informat.el25
1 files changed, 15 insertions, 10 deletions
diff --git a/lisp/informat.el b/lisp/informat.el
index f96852685f7..cb26c64fbaf 100644
--- a/lisp/informat.el
+++ b/lisp/informat.el
@@ -49,6 +49,7 @@
49 (opoint (point))) 49 (opoint (point)))
50 (unwind-protect 50 (unwind-protect
51 (progn 51 (progn
52 (widen)
52 (goto-char (point-min)) 53 (goto-char (point-min))
53 (if (search-forward "\^_\nIndirect:\n" nil t) 54 (if (search-forward "\^_\nIndirect:\n" nil t)
54 (message 55 (message
@@ -82,14 +83,14 @@
82 "\\|" 83 "\\|"
83 84
84 "\\(" 85 "\\("
85 "\n\^_" 86 "\n\^_\\(\^L\\)?"
86 "\\)" 87 "\\)"
87 88
88 "\\(" 89 "\\("
89 "\nFile:[ \t]*\\([^,\n\t]*\\)[,\t\n]+[ \t\n]*" 90 "\n\\(File:[ \t]*\\([^,\n\t]*\\)[,\t\n]+[ \t\n]*\\)?"
90 "Node:[ \t]*" 91 "Node:[ \t]*"
91 "\\(" 92 "\\("
92 "[^,\n\t]*" ; match-string 11 matches arg to node name 93 "[^,\n\t]*" ; match-string 13 matches arg to node name
93 "\\)" 94 "\\)"
94 "[,\t\n]" 95 "[,\t\n]"
95 "\\)" 96 "\\)"
@@ -116,8 +117,8 @@
116 ;; else this is a Node 117 ;; else this is a Node
117 (setq tag-list 118 (setq tag-list
118 (cons (list 119 (cons (list
119 (concat "Node: " (match-string 11)) 120 (concat "Node: " (match-string-no-properties 13))
120 (match-beginning 0)) 121 (1+ (match-beginning 10)))
121 tag-list)))) 122 tag-list))))
122 123
123 (goto-char (point-max)) 124 (goto-char (point-max))
@@ -129,7 +130,9 @@
129 (beginning-of-line) 130 (beginning-of-line)
130 (delete-region (point) end))) 131 (delete-region (point) end)))
131 (goto-char (point-max)) 132 (goto-char (point-max))
132 (insert "\n\^_\f\nTag table:\n") 133 (or (bolp)
134 (newline))
135 (insert "\^_\f\nTag table:\n")
133 (if (eq major-mode 'info-mode) 136 (if (eq major-mode 'info-mode)
134 (move-marker Info-tag-table-marker (point))) 137 (move-marker Info-tag-table-marker (point)))
135 (setq tag-list (nreverse tag-list)) 138 (setq tag-list (nreverse tag-list))
@@ -143,9 +146,9 @@
143 (narrow-to-region omin (if nomax (1+ (buffer-size)) 146 (narrow-to-region omin (if nomax (1+ (buffer-size))
144 (min omax (point-max)))))) 147 (min omax (point-max))))))
145 (if input-buffer-name 148 (if input-buffer-name
146 (message "Tagifying region in %s ..." input-buffer-name) 149 (message "Tagifying region in %s done" input-buffer-name)
147 (message 150 (message
148 "Tagifying %s ..." (file-name-nondirectory (buffer-file-name))))) 151 "Tagifying %s done" (file-name-nondirectory (buffer-file-name)))))
149 152
150 153
151;;;###autoload 154;;;###autoload
@@ -274,8 +277,10 @@ Check that every node pointer points to an existing node."
274 (forward-line 1) 277 (forward-line 1)
275 (if (re-search-backward regexp beg t) 278 (if (re-search-backward regexp beg t)
276 (save-restriction 279 (save-restriction
277 (search-forward "\n\^_" nil 'move) 280 (let ((md (match-data)))
278 (narrow-to-region beg (point)) 281 (search-forward "\n\^_" nil 'move)
282 (narrow-to-region beg (point))
283 (set-match-data md))
279 (setq Info-validate-thisnode (downcase 284 (setq Info-validate-thisnode (downcase
280 (buffer-substring-no-properties 285 (buffer-substring-no-properties
281 (match-beginning 1) 286 (match-beginning 1)