]> code.delx.au - gnu-emacs/blobdiff - lisp/informat.el
*** empty log message ***
[gnu-emacs] / lisp / informat.el
index f96852685f7a1dfeec4db792db06cf2afcfe90d8..baec500ec785e418d49c5e3397f082a31e740e9a 100644 (file)
@@ -49,6 +49,7 @@
        (opoint (point)))
     (unwind-protect
     (progn
+      (widen)
       (goto-char (point-min))
       (if (search-forward "\^_\nIndirect:\n" nil t)
           (message
                 "\\|"
 
                 "\\("
-                "\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]"
                 "\\)"
               ;; 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))
                      (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))
       (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)))))
 
 \f
 ;;;###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)
@@ -434,7 +439,7 @@ Must be used only with -batch, and kills Emacs on completion.
 Each file will be processed even if an error occurred previously.
 For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
   (if (not noninteractive)
-      (error "batch-info-validate may only be used -batch."))
+      (error "batch-info-validate may only be used -batch"))
   (let ((version-control t)
        (auto-save-default nil)
        (find-file-run-dired nil)