summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-08-29 19:19:00 +0000
committerRichard M. Stallman <rms@gnu.org>1999-08-29 19:19:00 +0000
commit289f0da2ca8f283e1e3dbd56283f698fb4a5cec0 (patch)
tree209aac40af598918df0a323c839d4eb898877fce
parentc4d7c00a24ca2f2dbd93e488efe3cf21b07a0388 (diff)
downloademacs-289f0da2ca8f283e1e3dbd56283f698fb4a5cec0.tar.gz
(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 @@
(opoint (point)))
(unwind-protect
(progn
+ (widen)
(goto-char (point-min))
(if (search-forward "\^_\nIndirect:\n" nil t)
(message
@@ -82,14 +83,14 @@
"\\|"
"\\("
- "\n\^_"
+ "\n\^_\\(\^L\\)?"
"\\)"
"\\("
- "\nFile:[ \t]*\\([^,\n\t]*\\)[,\t\n]+[ \t\n]*"
+ "\n\\(File:[ \t]*\\([^,\n\t]*\\)[,\t\n]+[ \t\n]*\\)?"
"Node:[ \t]*"
"\\("
- "[^,\n\t]*" ; match-string 11 matches arg to node name
+ "[^,\n\t]*" ; match-string 13 matches arg to node name
"\\)"
"[,\t\n]"
"\\)"
@@ -116,8 +117,8 @@
;; else this is a Node
(setq tag-list
(cons (list
- (concat "Node: " (match-string 11))
- (match-beginning 0))
+ (concat "Node: " (match-string-no-properties 13))
+ (1+ (match-beginning 10)))
tag-list))))
(goto-char (point-max))
@@ -129,7 +130,9 @@
(beginning-of-line)
(delete-region (point) end)))
(goto-char (point-max))
- (insert "\n\^_\f\nTag table:\n")
+ (or (bolp)
+ (newline))
+ (insert "\^_\f\nTag table:\n")
(if (eq major-mode 'info-mode)
(move-marker Info-tag-table-marker (point)))
(setq tag-list (nreverse tag-list))
@@ -143,9 +146,9 @@
(narrow-to-region omin (if nomax (1+ (buffer-size))
(min omax (point-max))))))
(if input-buffer-name
- (message "Tagifying region in %s ..." input-buffer-name)
+ (message "Tagifying region in %s done" input-buffer-name)
(message
- "Tagifying %s ..." (file-name-nondirectory (buffer-file-name)))))
+ "Tagifying %s done" (file-name-nondirectory (buffer-file-name)))))
;;;###autoload
@@ -274,8 +277,10 @@ Check that every node pointer points to an existing node."
(forward-line 1)
(if (re-search-backward regexp beg t)
(save-restriction
- (search-forward "\n\^_" nil 'move)
- (narrow-to-region beg (point))
+ (let ((md (match-data)))
+ (search-forward "\n\^_" nil 'move)
+ (narrow-to-region beg (point))
+ (set-match-data md))
(setq Info-validate-thisnode (downcase
(buffer-substring-no-properties
(match-beginning 1)