• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching +defs:info +defs:xref +defs:check +defs:all

0 ;;; info-xref.el --- check external references in an Info document
28 ;; info files, by attempting to visit the nodes specified.
32 ;; name changes to go unnoticed. `Info-validate' doesn't check external
35 ;; `M-x info-xref-check' checks one file. When invoked from an Info-mode or
36 ;; texinfo-mode buffer, the current info file is the default at the prompt.
38 ;; `M-x info-xref-check-all' looks at everything in the normal info path.
39 ;; This might be a lot of files but it's a good way to check the consistency
47 ;; When a target info file doesn't exist there's clearly no way to validate
52 ;; Indirect info files are understood, just pass the top-level foo.info to
53 ;; `info-xref-check' and it traverses all sub-files. Compressed info files
56 ;; `info-xref-check-all' is rather permissive in what it considers an info
57 ;; file. It has to be since info files don't necessarily have a ".info"
63 ;; `M-x info-xref-check-all-custom' is a related command, it goes through
64 ;; all info document references in customizable variables, checking them
65 ;; like info file cross references.
69 (require 'info)
71 (defconst info-xref-results-buffer "*info-xref results*"
72 "Name of the buffer for info-xref results.")
75 (defun info-xref-check (filename)
76 "Check external references in FILENAME, an info document."
94 (info-xref-check-list (list filename)))
97 (defun info-xref-check-all ()
98 "Check external references in all info documents in the usual path.
101 (info-xref-check-list (info-xref-all-info-files)))
104 ;; simply return all files, and have info-xref-check-list not follow
107 ;; duplicate "not available" messages for all subfiles of a single document.
109 (defun info-xref-all-info-files ()
110 "Return a list of all available info files.
113 Since info files don't have to have a .info suffix, all files in the
117 (info-initialize) ;; establish Info-directory-list
123 (unless (or (file-directory-p name) (info-xref-subfile-p name))
128 (defun info-xref-subfile-p (filename)
129 "Return t if FILENAME is an info subfile.
141 ;; info-xref-filename-header - a heading message for the current top-level
144 (defvar info-xref-xfile-alist)
146 ;; info-xref-good - count of good cross references.
148 (defvar info-xref-good)
150 ;; info-xref-bad - count of bad cross references.
152 (defvar info-xref-bad)
154 ;; info-xref-xfile-alist - indexed by "(foo)" with value nil or t according
159 (defvar info-xref-filename-heading)
161 (defun info-xref-check-list (filename-list)
162 "Check external references in info documents in FILENAME-LIST."
163 (pop-to-buffer info-xref-results-buffer t)
165 (let ((info-xref-good 0)
166 (info-xref-bad 0))
167 (dolist (info-xref-filename filename-list)
168 (let ((info-xref-filename-heading
169 (format "In file %s:\n" info-xref-filename))
170 (info-xref-xfile-alist nil))
171 (with-temp-message (format "Looking at %s" info-xref-filename)
173 (info-insert-file-contents info-xref-filename)
176 (let ((dir (file-name-directory info-xref-filename)))
180 (info-insert-file-contents
182 (info-xref-check-buffer)))
184 (info-xref-check-buffer))))))
185 (insert (format "done, %d good, %d bad\n" info-xref-good info-xref-bad))))
187 (defun info-xref-check-buffer ()
188 "Check external references in the info file in the current buffer.
200 (info-xref-output "Empty filename part: %s\n" node)
202 (unless (assoc file info-xref-xfile-alist)
203 (let ((found (info-xref-goto-node-p file)))
204 (push (cons file found) info-xref-xfile-alist)
206 (info-xref-output "Not available to check: %s\n" file))))
208 (when (cdr (assoc file info-xref-xfile-alist))
209 (if (info-xref-goto-node-p node)
210 (setq info-xref-good (1+ info-xref-good))
211 (setq info-xref-bad (1+ info-xref-bad))
212 (info-xref-output "No such node: %s\n" node)))))))
214 (defun info-xref-output (str &rest args)
215 "Emit a `format'-ed message STR+ARGS to the info-xref output buffer."
216 (with-current-buffer info-xref-results-buffer
217 (insert info-xref-filename-heading
219 (setq info-xref-filename-heading "")
220 ;; all this info-xref can be pretty slow, display now so the user can
224 ;; When asking Info-goto-node to fork, *info* needs to be the current
226 ;; goto-node in plain *info*.
228 ;; We only fork if *info* already exists, if it doesn't then we can create
235 (defun info-xref-goto-node-p (node)
244 (when (get-buffer "*info*")
245 (set-buffer "*info*")
246 "xref - temporary"))
253 (defun info-xref-check-all-custom ()
254 "Check info references in all customize groups and variables.
255 `custom-manual' and `info-link' entries in the `custom-links' list are checked.
257 `custom-load' autoloads for all symbols are loaded in order to get all the
262 (pop-to-buffer info-xref-results-buffer t)
264 (let ((info-xref-filename-heading ""))
272 (info-xref-output "Loading custom-load autoloads ...\n")
282 (info-xref-output "Symbol `%s': cannot require '%s: %s\n"
290 (info-xref-output "Symbol `%s': cannot load \"%s\": %s\n"
293 ;; Don't bother to check whether the info file exists as opposed to just
297 (info-xref-output "\nChecking custom-links references ...\n")
303 (when (memq (car link) '(custom-manual info-link))
307 (if (info-xref-goto-node-p (cadr link))
312 (info-xref-output "Symbol `%s' (in %s): cannot goto node: %s\n"
314 (info-xref-output "%d good, %d bad\n" good bad))))
316 (provide 'info-xref)
319 ;;; info-xref.el ends here