From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.devel Subject: Re: info-xref empty filenames Date: Wed, 25 Feb 2004 08:36:08 +1000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87llmshzqf.fsf@zip.com.au> References: <87k75k13if.fsf@zip.com.au> <87wu6nx3a5.fsf@zip.com.au> <8765dxclax.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077662893 26180 80.91.224.253 (24 Feb 2004 22:48:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2004 22:48:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Feb 24 23:48:00 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvlLM-0006CW-00 for ; Tue, 24 Feb 2004 23:48:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvlLL-0004wK-00 for ; Tue, 24 Feb 2004 23:48:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvlFQ-0002qx-Ua for emacs-devel@quimby.gnus.org; Tue, 24 Feb 2004 17:41:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AvlC2-0000zd-OP for emacs-devel@gnu.org; Tue, 24 Feb 2004 17:38:22 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AvlBS-0000fc-9M for emacs-devel@gnu.org; Tue, 24 Feb 2004 17:38:18 -0500 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvlAX-00005c-PC for emacs-devel@gnu.org; Tue, 24 Feb 2004 17:36:50 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1OMagLE024202 for ; Wed, 25 Feb 2004 09:36:42 +1100 Original-Received: from localhost (ppp114.dyn11.pacific.net.au [61.8.11.114]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1OMae0H029139 for ; Wed, 25 Feb 2004 09:36:41 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1Avl9v-0000LC-00; Wed, 25 Feb 2004 08:36:11 +1000 Original-To: emacs-devel@gnu.org In-Reply-To: <8765dxclax.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 24 Feb 2004 03:34:30 +0200") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20163 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20163 Juri Linkov writes: > > Since your papers are apparently OK, I want to suggest you to > implement a new checking rule in info-xref.el. Customization > definitions (defcustom) can have the keyword `:link' with a link > to an Info node in a `custom-manual' or `info-link' field. Actually, I wrote the code below a while back to do that. It's pretty rough, errors are only printed with `message', and I seem to have omitted the name of the offending variable, but I think it vaguely works so far as it goes. The messy bit is forcibly loading all the autoloads. I forget exactly, but I'm pretty sure I had to suppress errors because not everything would load successfully. Not sure if loading in a crazy order is/was the problem, or if packages are at fault. Maybe others have more experience with such forcible loading. ;; 2003 (require 'info-xref) ;; reftex-vars doesn't autoload quite right on its own (require 'reftex) (defun cusxref-autoloads-list () "Return a list of loads and requires for all custom variables. The list is in no particular order. Duplicates have been removed." (let ((result nil)) (mapatoms (lambda (symbol) (dolist (i (get symbol 'custom-loads)) (add-to-list 'result i)))) result)) (defun cusxref-load (cusxref-name) "Load CUSXREF-NAME, but suppress errors. CUSXREF-NAME can be a symbol to `require' or a filename string to `load'." ;; The NOERROR parameter to `load' doesn't cover sub-loads, it seems, so ;; protect ourselves explicitly. (condition-case cause (if (symbolp cusxref-name) (require cusxref-name) (load cusxref-name)) (error (message "Warning: cannot load: %s: %s\n" cusxref-name cause)))) (defun cusxref-load-all-autoloads () "Load all files mentioned in custom variable loads or requires." (message "loaded %d" (length (mapcar 'cusxref-load (cusxref-autoloads-list))))) (defun cusxref-missing () (let ((good 0) (bad 0)) (mapatoms (lambda (symbol) (dolist (link (get symbol 'custom-links)) (when (eq 'custom-manual (car link)) (if (info-xref-goto-node-p (cadr link)) (setq good (1+ good)) (setq bad (1+ bad)) (message "Cannot open: %s" (cadr link))))))) (message "%d good, %d bad\n" good bad))) (cusxref-load-all-autoloads) (cusxref-missing)