[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: info-xref empty filenames
From: |
Kevin Ryde |
Subject: |
Re: info-xref empty filenames |
Date: |
Thu, 11 Mar 2004 10:09:02 +1000 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
This is what I ended up with for checking custom links, it goes on top
of the empty filenames change for info-xref.el I posted before.
* info-xref.el (info-xref-check-all-custom): New function.
*** info-xref.el.old Thu Mar 11 09:58:11 2004
--- info-xref.el Thu Mar 11 10:00:39 2004
***************
*** 264,269 ****
--- 264,327 ----
(unless (equal (current-buffer) oldbuf)
(kill-buffer (current-buffer))))))))
+ (defun info-xref-check-all-custom ()
+ "Check info references in all customize groups and variables.
+ `custom-manual' and `info-link' entries in the `custom-links' list are
checked.
+
+ `custom-load' autoloads for all symbols are loaded in order to get all the
+ link information. This will be a lot of lisp packages loaded, and can take
+ quite a while."
+
+ (interactive)
+ (pop-to-buffer info-xref-results-buffer t)
+ (erase-buffer)
+ (let ((info-xref-filename-heading ""))
+
+ ;; `custom-load-symbol' is not used, since it quietly ignores errors,
+ ;; but we want to show them (since they may mean incomplete checking).
+ ;;
+ ;; Just one pass through mapatoms is made. There shouldn't be any new
+ ;; custom-loads setup by packages loaded.
+ ;;
+ (info-xref-output "Loading custom-load autoloads ...\n")
+ (require 'cus-start)
+ (require 'cus-load)
+ (let ((viper-mode nil)) ;; tell viper.el not to ask about viperizing
+ (mapatoms
+ (lambda (symbol)
+ (dolist (load (get symbol 'custom-loads))
+ (cond ((symbolp load)
+ (condition-case cause (require load)
+ (error
+ (info-xref-output "Symbol `%s': cannot require '%s: %s\n"
+ symbol load cause))))
+ ;; skip if previously loaded
+ ((assoc load load-history))
+ ((assoc (locate-library load) load-history))
+ (t
+ (condition-case cause (load load)
+ (error
+ (info-xref-output "Symbol `%s': cannot load \"%s\": %s\n"
+ symbol load cause)))))))))
+
+ ;; Don't bother to check whether the info file exists as opposed to just
+ ;; a missing node. If you have the lisp then you should have the
+ ;; documentation, so missing node name will be the usual fault.
+ ;;
+ (info-xref-output "\nChecking custom-links references ...\n")
+ (let ((good 0)
+ (bad 0))
+ (mapatoms
+ (lambda (symbol)
+ (dolist (link (get symbol 'custom-links))
+ (when (memq (car link) '(custom-manual info-link))
+ (if (info-xref-goto-node-p (cadr link))
+ (setq good (1+ good))
+ (setq bad (1+ bad))
+ (info-xref-output "Symbol `%s' (in %s): cannot goto node: %s\n"
+ symbol (symbol-file symbol) (cadr link)))))))
+ (info-xref-output "%d good, %d bad\n" good bad))))
+
(provide 'info-xref)
;;; arch-tag: 69d4d528-69ed-4cc2-8eb4-c666a0c1d5ac
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: info-xref empty filenames,
Kevin Ryde <=