unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: Re: info-xref empty filenames
Date: Wed, 25 Feb 2004 08:36:08 +1000	[thread overview]
Message-ID: <87llmshzqf.fsf@zip.com.au> (raw)
In-Reply-To: <8765dxclax.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 24 Feb 2004 03:34:30 +0200")

Juri Linkov <juri@jurta.org> 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)

  reply	other threads:[~2004-02-24 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-28 23:23 info-xref empty filenames Kevin Ryde
2004-02-16  0:43 ` Kevin Ryde
2004-02-24  1:34   ` Juri Linkov
2004-02-24 22:36     ` Kevin Ryde [this message]
2004-03-11  0:09       ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87llmshzqf.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).