emacs-devel
[Top][All Lists]
Advanced

[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: Mon, 16 Feb 2004 10:43:14 +1000
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

I wrote:
>
>         * info-xref.el (info-xref-check-buffer): Report empty filename parts.
>         Remove spurious node duplicate suppression, doesn't work, not wanted.
>         (info-xref-output): Take format style args.

I'd like to re-propose this addition to my info-xref.  I think it got
lost while the cvs was down.

*** info-xref.el.~1.4.~ Sat Sep  6 08:15:10 2003
--- info-xref.el        Sun Nov 23 07:46:57 2003
*************** (defun info-xref-check-buffer ()
*** 204,234 ****
  This should be the raw file contents, not `Info-mode'."
    (goto-char (point-min))
    (while (re-search-forward
!           "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]+)\\)[^.,]+\\)[.,]"
            nil t)
      (let* ((file (match-string 2))
             (node ;; Canonicalize spaces: we could use "[\t\n ]+" but
            ;; we try to avoid uselessly replacing " " with " ".
            (replace-regexp-in-string "[\t\n][\t\n ]*\\| [\t\n ]+" " "
                                      (match-string 1) t t)))
!       ;; see if the file exists, if we haven't tried it before
!       (unless (assoc file info-xref-xfile-alist)
!         (let ((found (info-xref-goto-node-p file)))
!           (push (cons file found) info-xref-xfile-alist)
!           (unless found
!           (info-xref-output (format "Not available to check: %s\n" file)))))
!       ;; if the file exists, try the node, if we haven't before
!       (when (cdr (assoc file info-xref-xfile-alist))
!         (unless (assoc node info-xref-xfile-alist)
            (if (info-xref-goto-node-p node)
                (setq info-xref-good (1+ info-xref-good))
              (setq info-xref-bad (1+ info-xref-bad))
!             (info-xref-output (format "No such node: %s\n" node))))))))
  
! (defun info-xref-output (str)
!   "Emit STR as an info-xref result message."
    (with-current-buffer info-xref-results-buffer
!     (insert info-xref-filename-heading str)
      (setq info-xref-filename-heading "")))
  
  ;; When asking Info-goto-node to fork, *info* needs to be the current
--- 204,236 ----
  This should be the raw file contents, not `Info-mode'."
    (goto-char (point-min))
    (while (re-search-forward
!           "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]*)\\)[^.,]+\\)[.,]"
            nil t)
      (let* ((file (match-string 2))
             (node ;; Canonicalize spaces: we could use "[\t\n ]+" but
            ;; we try to avoid uselessly replacing " " with " ".
            (replace-regexp-in-string "[\t\n][\t\n ]*\\| [\t\n ]+" " "
                                      (match-string 1) t t)))
!       (if (string-equal "()" file)
!           (info-xref-output "Empty filename part: %s\n" node)
!         ;; see if the file exists, if we haven't tried it before
!         (unless (assoc file info-xref-xfile-alist)
!           (let ((found (info-xref-goto-node-p file)))
!             (push (cons file found) info-xref-xfile-alist)
!             (unless found
!               (info-xref-output "Not available to check: %s\n" file))))
!         ;; if the file exists, try the node
!         (when (cdr (assoc file info-xref-xfile-alist))
            (if (info-xref-goto-node-p node)
                (setq info-xref-good (1+ info-xref-good))
              (setq info-xref-bad (1+ info-xref-bad))
!             (info-xref-output "No such node: %s\n" node)))))))
  
! (defun info-xref-output (str &rest args)
!   "Emit a `format'-ed message STR+ARGS to the info-xref output buffer."
    (with-current-buffer info-xref-results-buffer
!     (insert info-xref-filename-heading
!             (apply 'format str args))
      (setq info-xref-filename-heading "")))
  
  ;; When asking Info-goto-node to fork, *info* needs to be the current

reply via email to

[Prev in Thread] Current Thread [Next in Thread]