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: Thu, 11 Mar 2004 10:09:02 +1000	[thread overview]
Message-ID: <873c8gw8gx.fsf@zip.com.au> (raw)
In-Reply-To: <87llmshzqf.fsf@zip.com.au> (Kevin Ryde's message of "Wed, 25 Feb 2004 08:36:08 +1000")

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

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.


[-- Attachment #2: info-xref.el.custom.diff --]
[-- Type: text/plain, Size: 2943 bytes --]

*** 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

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

      reply	other threads:[~2004-03-11  0:09 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
2004-03-11  0:09       ` Kevin Ryde [this message]

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=873c8gw8gx.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).