Mercurial > emacs
annotate lisp/informat.el @ 24652:f14a11549a64
(main, both versions): Use quote_file_name on cwd.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 29 Apr 1999 20:26:46 +0000 |
parents | 4f2282284e2a |
children | dde5fcbfa2af |
rev | line source |
---|---|
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
1 ;;; informat.el --- info support functions package for Emacs |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
2 |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
811
diff
changeset
|
3 ;; Copyright (C) 1986 Free Software Foundation, Inc. |
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
811
diff
changeset
|
4 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
5 ;; Maintainer: FSF |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
6 ;; Keywords: help |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
7 |
257 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
257 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
14169 | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
257 | 24 |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
25 ;;; Commentary: |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
26 |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
27 ;; Nowadays, the Texinfo formatting commands always tagify a buffer |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
28 ;; (as does `makeinfo') since @anchor commands need tag tables. |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
29 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
30 ;;; Code: |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
660
diff
changeset
|
31 |
257 | 32 (require 'info) |
33 | |
34 ;;;###autoload | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
35 (defun Info-tagify (&optional input-buffer-name) |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
36 "Create or update Info file tag table in current buffer or in a region." |
257 | 37 (interactive) |
38 ;; Save and restore point and restrictions. | |
39 ;; save-restrictions would not work | |
40 ;; because it records the old max relative to the end. | |
41 ;; We record it relative to the beginning. | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
42 (if input-buffer-name |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
43 (message "Tagifying region in %s ..." input-buffer-name) |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
44 (message |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
45 "Tagifying %s ..." (file-name-nondirectory (buffer-file-name)))) |
257 | 46 (let ((omin (point-min)) |
47 (omax (point-max)) | |
48 (nomax (= (point-max) (1+ (buffer-size)))) | |
49 (opoint (point))) | |
50 (unwind-protect | |
22660
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
51 (progn |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
52 (goto-char (point-min)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
53 (if (search-forward "\^_\nIndirect:\n" nil t) |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
54 (message |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
55 "Cannot tagify split info file. Run this before splitting.") |
22660
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
56 (let (tag-list |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
57 refillp |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
58 (case-fold-search t) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
59 (regexp |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
60 (concat |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
61 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
62 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
63 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
64 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
65 "@anchor" ; match-string 2 matches @anchor |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
66 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
67 "\\(-no\\|-yes\\)" ; match-string 3 matches -no or -yes |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
68 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
69 "-refill" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
70 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
71 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
72 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
73 "{" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
74 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
75 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
76 "[^}]+" ; match-string 6 matches arg to anchor |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
77 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
78 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
79 "}" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
80 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
81 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
82 "\\|" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
83 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
84 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
85 "\n\^_" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
86 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
87 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
88 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
89 "\nFile:[ \t]*\\([^,\n\t]*\\)[,\t\n]+[ \t\n]*" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
90 "Node:[ \t]*" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
91 "\\(" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
92 "[^,\n\t]*" ; match-string 11 matches arg to node name |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
93 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
94 "[,\t\n]" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
95 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
96 |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
97 "\\)" |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
98 ))) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
99 (while (re-search-forward regexp nil t) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
100 (if (string-equal "@anchor" (match-string 2)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
101 (progn |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
102 ;; kludge lest lose match-data |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
103 (if (string-equal "-yes" (match-string 3)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
104 (setq refillp t)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
105 (setq tag-list |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
106 (cons (list |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
107 (concat "Ref: " (match-string 6)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
108 (match-beginning 0)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
109 tag-list)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
110 (if (eq refillp t) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
111 ;; set start and end so texinfo-format-refill works |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
112 (let ((texinfo-command-start (match-beginning 0)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
113 (texinfo-command-end (match-end 0))) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
114 (texinfo-format-refill)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
115 (delete-region (match-beginning 0) (match-end 0)))) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
116 ;; else this is a Node |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
117 (setq tag-list |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
118 (cons (list |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
119 (concat "Node: " (match-string 11)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
120 (match-beginning 0)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
121 tag-list)))) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
122 |
257 | 123 (goto-char (point-max)) |
124 (forward-line -8) | |
125 (let ((buffer-read-only nil)) | |
126 (if (search-forward "\^_\nEnd tag table\n" nil t) | |
127 (let ((end (point))) | |
128 (search-backward "\nTag table:\n") | |
129 (beginning-of-line) | |
130 (delete-region (point) end))) | |
131 (goto-char (point-max)) | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
132 (insert "\n\^_\f\nTag table:\n") |
18137
985e47a14cab
(Info-tagify): Don't set Info-tag-table-marker if not in Info mode.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
133 (if (eq major-mode 'info-mode) |
985e47a14cab
(Info-tagify): Don't set Info-tag-table-marker if not in Info mode.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
134 (move-marker Info-tag-table-marker (point))) |
22660
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
135 (setq tag-list (nreverse tag-list)) |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
136 (while tag-list |
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
137 (insert (car (car tag-list)) ?\177) |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
138 (princ (car (cdr (car tag-list))) (current-buffer)) |
257 | 139 (insert ?\n) |
22660
1614e05bf2b5
(Info-tagify): Handle tags for @anchor.
Richard M. Stallman <rms@gnu.org>
parents:
22644
diff
changeset
|
140 (setq tag-list (cdr tag-list))) |
257 | 141 (insert "\^_\nEnd tag table\n"))))) |
142 (goto-char opoint) | |
143 (narrow-to-region omin (if nomax (1+ (buffer-size)) | |
144 (min omax (point-max)))))) | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
145 (if input-buffer-name |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
146 (message "Tagifying region in %s ..." input-buffer-name) |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
147 (message |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
148 "Tagifying %s ..." (file-name-nondirectory (buffer-file-name))))) |
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
149 |
257 | 150 |
151 ;;;###autoload | |
152 (defun Info-split () | |
153 "Split an info file into an indirect file plus bounded-size subfiles. | |
154 Each subfile will be up to 50,000 characters plus one node. | |
155 | |
156 To use this command, first visit a large Info file that has a tag | |
157 table. The buffer is modified into a (small) indirect info file which | |
158 should be saved in place of the original visited file. | |
159 | |
160 The subfiles are written in the same directory the original file is | |
161 in, with names generated by appending `-' and a number to the original | |
162 file name. The indirect file still functions as an Info file, but it | |
163 contains just the tag table and a directory of subfiles." | |
164 | |
165 (interactive) | |
166 (if (< (buffer-size) 70000) | |
167 (error "This is too small to be worth splitting")) | |
168 (goto-char (point-min)) | |
169 (search-forward "\^_") | |
170 (forward-char -1) | |
171 (let ((start (point)) | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
172 (chars-deleted 0) |
257 | 173 subfiles |
174 (subfile-number 1) | |
175 (case-fold-search t) | |
176 (filename (file-name-sans-versions buffer-file-name))) | |
177 (goto-char (point-max)) | |
178 (forward-line -8) | |
179 (setq buffer-read-only nil) | |
180 (or (search-forward "\^_\nEnd tag table\n" nil t) | |
181 (error "Tag table required; use M-x Info-tagify")) | |
182 (search-backward "\nTag table:\n") | |
183 (if (looking-at "\nTag table:\n\^_") | |
184 (error "Tag table is just a skeleton; use M-x Info-tagify")) | |
185 (beginning-of-line) | |
186 (forward-char 1) | |
187 (save-restriction | |
188 (narrow-to-region (point-min) (point)) | |
189 (goto-char (point-min)) | |
190 (while (< (1+ (point)) (point-max)) | |
191 (goto-char (min (+ (point) 50000) (point-max))) | |
192 (search-forward "\^_" nil 'move) | |
193 (setq subfiles | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
194 (cons (list (+ start chars-deleted) |
257 | 195 (concat (file-name-nondirectory filename) |
196 (format "-%d" subfile-number))) | |
197 subfiles)) | |
198 ;; Put a newline at end of split file, to make Unix happier. | |
199 (insert "\n") | |
200 (write-region (point-min) (point) | |
201 (concat filename (format "-%d" subfile-number))) | |
202 (delete-region (1- (point)) (point)) | |
203 ;; Back up over the final ^_. | |
204 (forward-char -1) | |
22693
4f2282284e2a
(Info-tagify): Finish previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22660
diff
changeset
|
205 (setq chars-deleted (+ chars-deleted (- (point) start))) |
257 | 206 (delete-region start (point)) |
207 (setq subfile-number (1+ subfile-number)))) | |
208 (while subfiles | |
209 (goto-char start) | |
210 (insert (nth 1 (car subfiles)) | |
10156
baf3b68f7e56
(Info-split): Fix 1-off error in subfile position.
Richard M. Stallman <rms@gnu.org>
parents:
10154
diff
changeset
|
211 (format ": %d" (1- (car (car subfiles)))) |
257 | 212 "\n") |
213 (setq subfiles (cdr subfiles))) | |
214 (goto-char start) | |
215 (insert "\^_\nIndirect:\n") | |
216 (search-forward "\nTag Table:\n") | |
217 (insert "(Indirect)\n"))) | |
218 | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
219 (defvar Info-validate-allnodes) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
220 (defvar Info-validate-thisnode) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
221 (defvar Info-validate-lossages) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
222 |
257 | 223 ;;;###autoload |
224 (defun Info-validate () | |
225 "Check current buffer for validity as an Info file. | |
226 Check that every node pointer points to an existing node." | |
227 (interactive) | |
228 (save-excursion | |
229 (save-restriction | |
230 (widen) | |
231 (goto-char (point-min)) | |
232 (if (search-forward "\nTag table:\n(Indirect)\n" nil t) | |
233 (error "Don't yet know how to validate indirect info files: \"%s\"" | |
234 (buffer-name (current-buffer)))) | |
235 (goto-char (point-min)) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
236 (let ((Info-validate-allnodes '(("*"))) |
257 | 237 (regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]") |
238 (case-fold-search t) | |
239 (tags-losing nil) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
240 (Info-validate-lossages ())) |
257 | 241 (while (search-forward "\n\^_" nil t) |
242 (forward-line 1) | |
243 (let ((beg (point))) | |
244 (forward-line 1) | |
245 (if (re-search-backward regexp beg t) | |
246 (let ((name (downcase | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
247 (buffer-substring-no-properties |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
248 (match-beginning 1) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
249 (progn |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
250 (goto-char (match-end 1)) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
251 (skip-chars-backward " \t") |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
252 (point)))))) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
253 (if (assoc name Info-validate-allnodes) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
254 (setq Info-validate-lossages |
257 | 255 (cons (list name "Duplicate node-name" nil) |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
256 Info-validate-lossages)) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
257 (setq Info-validate-allnodes |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
258 (cons (list name |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
259 (progn |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
260 (end-of-line) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
261 (and (re-search-backward |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
262 "prev[ious]*:" beg t) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
263 (progn |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
264 (goto-char (match-end 0)) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
265 (downcase |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
266 (Info-following-node-name))))) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
267 beg) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
268 Info-validate-allnodes))))))) |
257 | 269 (goto-char (point-min)) |
270 (while (search-forward "\n\^_" nil t) | |
271 (forward-line 1) | |
272 (let ((beg (point)) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
273 Info-validate-thisnode next) |
257 | 274 (forward-line 1) |
275 (if (re-search-backward regexp beg t) | |
276 (save-restriction | |
277 (search-forward "\n\^_" nil 'move) | |
278 (narrow-to-region beg (point)) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
279 (setq Info-validate-thisnode (downcase |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
280 (buffer-substring-no-properties |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
281 (match-beginning 1) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
282 (progn |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
283 (goto-char (match-end 1)) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
284 (skip-chars-backward " \t") |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
285 (point))))) |
257 | 286 (end-of-line) |
287 (and (search-backward "next:" nil t) | |
288 (setq next (Info-validate-node-name "invalid Next")) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
289 (assoc next Info-validate-allnodes) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
290 (if (equal (car (cdr (assoc next Info-validate-allnodes))) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
291 Info-validate-thisnode) |
257 | 292 ;; allow multiple `next' pointers to one node |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
293 (let ((tem Info-validate-lossages)) |
257 | 294 (while tem |
295 (if (and (equal (car (cdr (car tem))) | |
296 "should have Previous") | |
297 (equal (car (car tem)) | |
298 next)) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
299 (setq Info-validate-lossages |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
300 (delq (car tem) Info-validate-lossages))) |
257 | 301 (setq tem (cdr tem)))) |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
302 (setq Info-validate-lossages |
257 | 303 (cons (list next |
304 "should have Previous" | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
305 Info-validate-thisnode) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
306 Info-validate-lossages)))) |
257 | 307 (end-of-line) |
308 (if (re-search-backward "prev[ious]*:" nil t) | |
309 (Info-validate-node-name "invalid Previous")) | |
310 (end-of-line) | |
311 (if (search-backward "up:" nil t) | |
312 (Info-validate-node-name "invalid Up")) | |
313 (if (re-search-forward "\n* Menu:" nil t) | |
314 (while (re-search-forward "\n\\* " nil t) | |
315 (Info-validate-node-name | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
316 (concat "invalid menu item " |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
317 (buffer-substring (point) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
318 (save-excursion |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
319 (skip-chars-forward "^:") |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
320 (point)))) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
321 (Info-extract-menu-node-name)))) |
257 | 322 (goto-char (point-min)) |
323 (while (re-search-forward "\\*note[ \n]*[^:\t]*:" nil t) | |
324 (goto-char (+ (match-beginning 0) 5)) | |
325 (skip-chars-forward " \n") | |
326 (Info-validate-node-name | |
327 (concat "invalid reference " | |
328 (buffer-substring (point) | |
329 (save-excursion | |
330 (skip-chars-forward "^:") | |
331 (point)))) | |
332 (Info-extract-menu-node-name "Bad format cross-reference"))))))) | |
333 (setq tags-losing (not (Info-validate-tags-table))) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
334 (if (or Info-validate-lossages tags-losing) |
257 | 335 (with-output-to-temp-buffer " *problems in info file*" |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
336 (while Info-validate-lossages |
257 | 337 (princ "In node \"") |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
338 (princ (car (car Info-validate-lossages))) |
257 | 339 (princ "\", ") |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
340 (let ((tem (nth 1 (car Info-validate-lossages)))) |
257 | 341 (cond ((string-match "\n" tem) |
342 (princ (substring tem 0 (match-beginning 0))) | |
343 (princ "...")) | |
344 (t | |
345 (princ tem)))) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
346 (if (nth 2 (car Info-validate-lossages)) |
257 | 347 (progn |
348 (princ ": ") | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
349 (let ((tem (nth 2 (car Info-validate-lossages)))) |
257 | 350 (cond ((string-match "\n" tem) |
351 (princ (substring tem 0 (match-beginning 0))) | |
352 (princ "...")) | |
353 (t | |
354 (princ tem)))))) | |
355 (terpri) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
356 (setq Info-validate-lossages (cdr Info-validate-lossages))) |
257 | 357 (if tags-losing (princ "\nTags table must be recomputed\n"))) |
358 ;; Here if info file is valid. | |
359 ;; If we already made a list of problems, clear it out. | |
360 (save-excursion | |
361 (if (get-buffer " *problems in info file*") | |
362 (progn | |
363 (set-buffer " *problems in info file*") | |
364 (kill-buffer (current-buffer))))) | |
365 (message "File appears valid")))))) | |
366 | |
367 (defun Info-validate-node-name (kind &optional name) | |
368 (if name | |
369 nil | |
370 (goto-char (match-end 0)) | |
371 (skip-chars-forward " \t") | |
372 (if (= (following-char) ?\() | |
373 nil | |
374 (setq name | |
13291
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
375 (buffer-substring-no-properties |
257 | 376 (point) |
377 (progn | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
378 (skip-chars-forward "^,\t\n") |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
379 (skip-chars-backward " ") |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
380 (point)))))) |
257 | 381 (if (null name) |
382 nil | |
383 (setq name (downcase name)) | |
384 (or (and (> (length name) 0) (= (aref name 0) ?\()) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
385 (assoc name Info-validate-allnodes) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
386 (setq Info-validate-lossages |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
387 (cons (list Info-validate-thisnode kind name) |
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
388 Info-validate-lossages)))) |
257 | 389 name) |
390 | |
391 (defun Info-validate-tags-table () | |
392 (goto-char (point-min)) | |
393 (if (not (search-forward "\^_\nEnd tag table\n" nil t)) | |
394 t | |
395 (not (catch 'losing | |
396 (let* ((end (match-beginning 0)) | |
397 (start (progn (search-backward "\nTag table:\n") | |
398 (1- (match-end 0)))) | |
399 tem) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
400 (setq tem Info-validate-allnodes) |
257 | 401 (while tem |
402 (goto-char start) | |
403 (or (equal (car (car tem)) "*") | |
404 (search-forward (concat "Node: " | |
405 (car (car tem)) | |
406 "\177") | |
407 end t) | |
408 (throw 'losing 'x)) | |
409 (setq tem (cdr tem))) | |
410 (goto-char (1+ start)) | |
411 (while (looking-at ".*Node: \\(.*\\)\177\\([0-9]+\\)$") | |
13291
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
412 (setq tem (downcase (buffer-substring-no-properties |
257 | 413 (match-beginning 1) |
414 (match-end 1)))) | |
18422
96deedadd2f0
(Info-validate-allnodes): Variable renamed, defvar added.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
415 (setq tem (assoc tem Info-validate-allnodes)) |
257 | 416 (if (or (not tem) |
417 (< 1000 (progn | |
418 (goto-char (match-beginning 2)) | |
419 (setq tem (- (car (cdr (cdr tem))) | |
420 (read (current-buffer)))) | |
421 (if (> tem 0) tem (- tem))))) | |
13291
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
422 (throw 'losing 'y)) |
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
423 (forward-line 1))) |
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
424 (if (looking-at "\^_\n") |
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
425 (forward-line 1)) |
257 | 426 (or (looking-at "End tag table\n") |
427 (throw 'losing 'z)) | |
428 nil)))) | |
429 | |
430 ;;;###autoload | |
431 (defun batch-info-validate () | |
432 "Runs `Info-validate' on the files remaining on the command line. | |
433 Must be used only with -batch, and kills Emacs on completion. | |
434 Each file will be processed even if an error occurred previously. | |
435 For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\"" | |
436 (if (not noninteractive) | |
437 (error "batch-info-validate may only be used -batch.")) | |
438 (let ((version-control t) | |
439 (auto-save-default nil) | |
440 (find-file-run-dired nil) | |
441 (kept-old-versions 259259) | |
442 (kept-new-versions 259259)) | |
443 (let ((error 0) | |
444 file | |
445 (files ())) | |
446 (while command-line-args-left | |
447 (setq file (expand-file-name (car command-line-args-left))) | |
448 (cond ((not (file-exists-p file)) | |
449 (message ">> %s does not exist!" file) | |
450 (setq error 1 | |
451 command-line-args-left (cdr command-line-args-left))) | |
452 ((file-directory-p file) | |
453 (setq command-line-args-left (nconc (directory-files file) | |
454 (cdr command-line-args-left)))) | |
455 (t | |
456 (setq files (cons file files) | |
457 command-line-args-left (cdr command-line-args-left))))) | |
458 (while files | |
459 (setq file (car files) | |
460 files (cdr files)) | |
461 (let ((lose nil)) | |
462 (condition-case err | |
463 (progn | |
464 (if buffer-file-name (kill-buffer (current-buffer))) | |
465 (find-file file) | |
466 (buffer-disable-undo (current-buffer)) | |
467 (set-buffer-modified-p nil) | |
468 (fundamental-mode) | |
469 (let ((case-fold-search nil)) | |
470 (goto-char (point-max)) | |
471 (cond ((search-backward "\n\^_\^L\nTag table:\n" nil t) | |
472 (message "%s already tagified" file)) | |
473 ((< (point-max) 30000) | |
474 (message "%s too small to bother tagifying" file)) | |
475 (t | |
923 | 476 (Info-tagify)))) |
257 | 477 (let ((loss-name " *problems in info file*")) |
478 (message "Checking validity of info file %s..." file) | |
479 (if (get-buffer loss-name) | |
480 (kill-buffer loss-name)) | |
481 (Info-validate) | |
482 (if (not (get-buffer loss-name)) | |
483 nil ;(message "Checking validity of info file %s... OK" file) | |
484 (message "----------------------------------------------------------------------") | |
485 (message ">> PROBLEMS IN INFO FILE %s" file) | |
486 (save-excursion | |
487 (set-buffer loss-name) | |
13291
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
488 (princ (buffer-substring-no-properties |
49de0d4ca42e
(Info-validate, Info-validate-node-name): Use buffer-substring-no-properties.
Richard M. Stallman <rms@gnu.org>
parents:
10156
diff
changeset
|
489 (point-min) (point-max)))) |
257 | 490 (message "----------------------------------------------------------------------") |
491 (setq error 1 lose t))) | |
492 (if (and (buffer-modified-p) | |
493 (not lose)) | |
494 (progn (message "Saving modified %s" file) | |
495 (save-buffer)))) | |
496 (error (message ">> Error: %s" (prin1-to-string err)))))) | |
497 (kill-emacs error)))) | |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
498 |
18383 | 499 (provide 'informat) |
500 | |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
501 ;;; informat.el ends here |