From unknown Thu Jun 19 13:55:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7611 <7611@debbugs.gnu.org> To: bug#7611 <7611@debbugs.gnu.org> Subject: Status: 23.2; info-xref.el v.3 Reply-To: bug#7611 <7611@debbugs.gnu.org> Date: Thu, 19 Jun 2025 20:55:07 +0000 retitle 7611 23.2; info-xref.el v.3 reassign 7611 emacs submitter 7611 Kevin Ryde severity 7611 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 10 17:35:28 2010 Received: (at submit) by debbugs.gnu.org; 10 Dec 2010 22:35:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRBYl-0004D7-Sl for submit@debbugs.gnu.org; Fri, 10 Dec 2010 17:35:28 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRBYi-0004Cu-W2 for submit@debbugs.gnu.org; Fri, 10 Dec 2010 17:35:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PRBea-0003EV-AV for submit@debbugs.gnu.org; Fri, 10 Dec 2010 17:41:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_MIME_NO_TEXT, T_TVD_MIME_NO_HEADERS autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:58096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PRBea-0003E8-1A for submit@debbugs.gnu.org; Fri, 10 Dec 2010 17:41:28 -0500 Received: from [140.186.70.92] (port=51060 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRBeY-0007av-Ov for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2010 17:41:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PRBeX-0003DE-EK for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2010 17:41:26 -0500 Received: from mailout1-5.pacific.net.au ([61.8.2.212]:44793 helo=mailout1.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PRBeW-0003Bv-AV for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2010 17:41:25 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 9F36A5E1C63 for ; Sat, 11 Dec 2010 09:41:18 +1100 (EST) Received: from blah.blah (unknown [203.26.175.116]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 265C08C06 for ; Sat, 11 Dec 2010 09:41:14 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1PRBeN-0001Lo-0P for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2010 09:41:15 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 23.2; info-xref.el v.3 Date: Sat, 11 Dec 2010 09:41:14 +1100 Message-ID: <87wrnhl08l.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --=-=-= This is a new version of my info-xref.el to install please (I posted to the sources list a while ago). The main new feature is M-x info-xref-docstrings which checks docstring hyperlinks Info node `(elisp)Documentation Tips' to see that the target node really does exist. (An early version a while ago picked up a couple of typos for instance.) --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=info-xref.el Content-Transfer-Encoding: quoted-printable ;;; info-xref.el --- check external references in an Info document ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ;; Free Software Foundation, Inc. ;; Author: Kevin Ryde ;; Keywords: docs ;; Version: 3 ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Commentary: ;; This is some simple checking of external cross references in info files, ;; docstrings and custom-links by attempting to visit the nodes specified. ;; ;; `M-x info-xref-check' checks a single info file. See the docstring for ;; details. ;; ;; `M-x info-xref-check-all' checks all info files in Info-directory-list. ;; This is a good way to check the consistency of the whole system. ;; ;; `M-x info-xref-check-all-custom' loads up all defcustom variables and ;; checks any info references in them. ;; ;; `M-x info-xref-docstrings' checks docstring "Info node ..." hyperlinks in ;; source files (and other files). ;;; History: ;; Version 3 - new M-x info-xref-docstrings, use compilation-mode ;;; Code: (require 'info) (eval-when-compile (require 'cl)) ;; for `incf' ;;-------------------------------------------------------------------------= ---- ;; vaguely generic (defun info-xref-lock-file-p (filename) "Return non-nil if FILENAME is an Emacs lock file. A lock file is \".#foo.txt\" etc per `lock-buffer'." (string-match "\\(\\`\\|\\/\\)\\.#" filename)) (defun info-xref-subfile-p (filename) "Return t if FILENAME is an info subfile. If removing the last \"-\" from the filename gives a file which exists, then consider FILENAME a subfile. This is an imperfect test, probably ought to open up the purported top file and see what subfiles it says." (and (string-match "\\`\\(\\([^-]*-\\)*[^-]*\\)-[0-9]+\\(.*\\)\\'" filena= me) (file-exists-p (concat (match-string 1 filename) (match-string 3 filename))))) (defmacro info-xref-with-file (filename &rest body) ;; checkdoc-params: (filename body) "Evaluate BODY in a buffer containing the contents of FILENAME. If FILENAME is already in a buffer then that's used, otherwise a temporary buffer. The current implementation uses `insert-file-contents' rather than `find-file-noselect' so as not to be held up by queries about local variables or possible weirdness in a major mode. `lm-with-file' does a similar thing, but it sets `emacs-lisp-mode' which is not wanted here." (declare (debug t) (indent 1)) `(let* ((info-xref-with-file--filename ,filename) (info-xref-with-file--body (lambda () ,@body)) (info-xref-with-file--existing (find-buffer-visiting info-xref-with-file--filename))) (if info-xref-with-file--existing (with-current-buffer info-xref-with-file--existing (save-excursion (funcall info-xref-with-file--body))) (with-temp-buffer (insert-file-contents ,filename) (funcall info-xref-with-file--body))))) ;;-------------------------------------------------------------------------= ---- ;; output buffer (defconst info-xref-output-buffer "*info-xref results*" "Name of the buffer for info-xref results.") (defvar info-xref-good 0 "Count of good cross references, during info-xref processing.") (defvar info-xref-bad 0 "Count of bad cross references, during info-xref processing.") (defvar info-xref-unavail 0 "Count of unavailable cross references, during info-xref processing.") (defvar info-xref-output-heading "" "A heading string, during info-xref processing. This is shown if there's an error, but not if successful.") (defvar info-xref-filename nil "The current buffer's filename, during info-xref processing. When looking at file contents in a temp buffer there's no `buffer-file-name', hence this variable.") (defvar info-xref-xfile-alist nil "Info files found or not found, during info-xref processing. Key is \"(foo)\" etc and value nil or t according to whether info manual \"(foo)\" exists or not. This is used to suppress duplicate messages about foo not being available. (Duplicates within one top-level file that is.)") (defvar info-xref-in-progress nil) (defmacro info-xref-with-output (&rest body) "Run BODY with an info-xref output buffer. This is meant to nest, so you can wrap it around a set of different info-xref checks and have them write to the one output buffer created by the outermost `info-xref-with-output', with an overall good/bad count summary inserted at the very end." (declare (debug t)) `(save-excursion (unless info-xref-in-progress (display-buffer (get-buffer-create info-xref-output-buffer)) (set-buffer info-xref-output-buffer) (setq buffer-read-only nil) (fundamental-mode) (erase-buffer) (insert ";; info-xref output -*- mode: compilation -*-\n\n") (compilation-mode) (setq info-xref-good 0 info-xref-bad 0 info-xref-unavail 0 info-xref-xfile-alist nil)) (let ((info-xref-in-progress t) (info-xref-output-heading "")) ,@body) (unless info-xref-in-progress (info-xref-output "done, %d good, %d bad, %d unavailable" info-xref-good info-xref-bad info-xref-unavail)))) =20=20 (defun info-xref-output (fmt &rest args) "Emit a `format'-ed message FMT+ARGS to the `info-xref-output-buffer'." (with-current-buffer info-xref-output-buffer (save-excursion (goto-char (point-max)) (let ((inhibit-read-only t)) (insert info-xref-output-heading (apply 'format fmt args) "\n"))) (setq info-xref-output-heading "") ;; all this info-xref can be pretty slow, display now so the user sees ;; some progress (sit-for 0))) (put 'info-xref-output 'byte-compile-format-like t) (defun info-xref-output-error (fmt &rest args) "Emit a `format'-ed error FMT+ARGS to the `info-xref-output-buffer'. The error is attributed to `info-xref-filename' and the current buffer's line and column of point." (apply 'info-xref-output (concat "%s:%s:%s: " fmt) info-xref-filename (1+ (count-lines (point-min) (line-beginning-position))) (1+ (current-column)) args)) (put 'info-xref-output-error 'byte-compile-format-like t) ;;-------------------------------------------------------------------------= ---- ;; node checking ;; When asking Info-goto-node to fork, *info* needs to be the current ;; buffer, otherwise it seems to clone the current buffer but then do the ;; goto-node in plain *info*. ;; ;; We only fork if *info* already exists, if it doesn't then can create and ;; destroy just that instead of a new name. ;; ;; If Info-goto-node can't find the file, then no new buffer is created. If ;; it finds the file but not the node, then a buffer is created. Handle ;; this difference by checking before killing. ;; (defun info-xref-goto-node-p (node) "Return t if it's possible to go to the given NODE." (let ((oldbuf (current-buffer))) (save-excursion (save-window-excursion (prog1 (condition-case err (progn (Info-goto-node node (when (get-buffer "*info*") (set-buffer "*info*") "xref - temporary")) t) (error nil)) (unless (equal (current-buffer) oldbuf) (kill-buffer))))))) (defun info-xref-check-node (node) ;; Collapse spaces as per info.el and `help-make-xrefs'. ;; Note defcustom :info-link nodes don't get this whitespace collapsing, ;; they should be the exact node name ready to visit. ;; `info-xref-check-all-custom' uses `info-xref-goto-node-p' and so ;; doesn't come through here. ;; ;; Could use "[\t\n ]+" but try to avoid uselessly replacing " " with " ". (setq node (replace-regexp-in-string "[\t\n][\t\n ]*\\| [\t\n ]+" " " node t t)) (if (not (string-match "\\`([^)]*)" node)) (info-xref-output-error "no `(file)' part at start of node: %s\n" nod= e) (let ((file (match-string 0 node))) (if (string-equal "()" file) (info-xref-output-error "empty filename part: %s" node) ;; see if the file exists, if haven't looked 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-error "not available to check: %s\n (thi= s reported once per file)" file)))) ;; if the file exists, try the node (cond ((not (cdr (assoc file info-xref-xfile-alist))) (incf info-xref-unavail)) ((info-xref-goto-node-p node) (incf info-xref-good)) (t (incf info-xref-bad) (info-xref-output-error "no such node: %s" node))))))) ;;-------------------------------------------------------------------------= ---- ;;;###autoload (defun info-xref-check (filename) "Check external references in FILENAME, an info document. Interactively from an `Info-mode' or `texinfo-mode' buffer the current info file is the default. Results are shown in a `compilation-mode' buffer. The format is a bit rough, but there shouldn't be many problems normally. The file:line:column: is the info document, but of course normally any correction should be made in the original .texi file. Finding the right place in the .texi is a manual process. When a target info file doesn't exist there's obviously no way to validate node references within it. A message is given for missing target files once per source document. It could be simply that you don't have the target installed, or it could be a mistake in the reference. Indirect info files are understood, just pass the top-level foo.info to `info-xref-check' and it traverses all sub-files. Compressed info files are accepted too as usual for `Info-mode'. \"makeinfo\" checks references internal to an info document, but not external references, which makes it rather easy for mistakes to creep in or node name changes to go unnoticed. `Info-validate' doesn't check external references either." (interactive (list (let* ((default-filename (cond ((eq major-mode 'Info-mode) Info-current-file) ((eq major-mode 'texinfo-mode) ;; look for @setfilename like makeinfo.el does (save-excursion (goto-char (point-min)) (if (re-search-forward "^@setfilename[ \t]+\\([^ \t\n]+\\)[ \t]*" (line-beginning-position 100) t) (expand-file-name (match-string 1))))))) (prompt (if default-filename (format "Info file (%s): " default-filename) "Info file: "))) (read-file-name prompt nil default-filename t)))) (info-xref-check-list (list filename))) ;;;###autoload (defun info-xref-check-all () "Check external references in all info documents in the info path. `Info-directory-list' and `Info-additional-directory-list' are the info paths. See `info-xref-check' for how each file is checked. The search for \"all\" info files is rather permissive, since info files don't necessarily have a \".info\" extension and in particular the Emacs manuals normally don't. If you have a source code directory in `Info-directory-list' then a lot of extraneous files might be read. This will be time consuming but should be harmless." (interactive) (info-xref-check-list (info-xref-all-info-files))) ;; An alternative for geting only top-level files here would be to simply ;; return all files and have info-xref-check-list not follow "Indirect:". ;; The current way seems better because it (potentially) gets the proper ;; top-level filename into the error messages, and suppresses duplicate "not ;; available" messages for all subfiles of a single document. (defun info-xref-all-info-files () "Return a list of all available info files. Only top level files are returned, subfiles are excluded. Since info files don't have to have a .info suffix, all files in the relevant directories are considered, which might mean a lot of extraneous things if for instance a source code directory is in the path." (info-initialize) ;; establish Info-directory-list (apply 'nconc (mapcar (lambda (dir) (let ((result nil)) (dolist (name (directory-files dir t ;; absolute filenames "\\`[^.]")) ;; not dotfiles, nor .# lockfiles (when (and (file-exists-p name) ;; ignore broken symlinks (not (string-match "\\.te?xi\\'" name)) ;; not .= texi (not (backup-file-name-p name)) (not (file-directory-p name)) (not (info-xref-subfile-p name))) (push name result))) (nreverse result))) (append Info-directory-list Info-additional-directory-list)))) (defun info-xref-check-list (filename-list) "Check external references in info documents in FILENAME-LIST." (info-xref-with-output (dolist (info-xref-filename filename-list) (setq info-xref-xfile-alist nil) (let ((info-xref-output-heading (format "Info file %s\n" info-xref-filename))) (with-temp-message (format "Looking at %s" info-xref-filename) (with-temp-buffer (info-insert-file-contents info-xref-filename) (goto-char (point-min)) (if (search-forward "\^_\nIndirect:\n" nil t) (let ((dir (file-name-directory info-xref-filename))) (while (looking-at "\\(.*\\): [0-9]+\n") (let ((info-xref-filename (expand-file-name (match-string 1) dir))) (with-temp-buffer (info-insert-file-contents info-xref-filename) (info-xref-check-buffer))) (forward-line))) (info-xref-check-buffer)))))))) (defun info-xref-check-buffer () "Check external references in the info file in the current buffer. 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) (save-excursion (goto-char (match-beginning 1)) ;; start of nodename as error position (info-xref-check-node (match-string 1))))) (defvar viper-mode) ;; quieten the byte compiler (defvar gnus-registry-install) ;;;###autoload (defun info-xref-check-all-custom () "Check info references in all customize groups and variables. Info references can be in `custom-manual' or `info-link' entries of the `custom-links' for a variable. Any `custom-load' autoloads in variables are loaded in order to get full link information. This will be a lot of Lisp packages and can take a long time." (interactive) (info-xref-with-output ;; `custom-load-symbol' is not used, since it quietly ignores errors, but ;; we want to show them since they 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 ...") (require 'cus-start) (require 'cus-load) ;; These are `setq' rather than `let' since a let would unbind the ;; variables after viper.el/gnus-registry.el have loaded, defeating the ;; defvars in those files. Of course it'd be better if those files ;; didn't make interactive queries on loading at all, to allow for ;; programmatic loading like here. (unless (boundp 'viper-mode) (setq viper-mode nil)) ;; avoid viper.el ask about viperizing (unless (boundp 'gnus-registry-install) (setq gnus-registry-install nil)) ;; avoid gnus-registery.el querying (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" symbol load cause)))) ;; skip if previously loaded ((assoc load load-history)) ((assoc (locate-library load) load-history)) (t (condition-case err (load load) (error (info-xref-output "Symbol `%s': cannot load \"%s\": %s" symbol load (error-message-string err))))))))) ;; Don't bother to check whether the info file exists as opposed to just ;; a missing node. If you have the code then you should have the ;; documentation, so a wrong node name will be the usual fault. ;; (info-xref-output "\nChecking custom-links references ...") (mapatoms (lambda (symbol) (dolist (link (get symbol 'custom-links)) (when (memq (car link) '(custom-manual info-link)) ;; skip :tag part of (custom-manual :tag "Foo" "(foo)Node") (if (eq :tag (cadr link)) (setq link (cddr link))) (if (info-xref-goto-node-p (cadr link)) (incf info-xref-good) (incf info-xref-bad) ;; symbol-file gives nil for preloaded variables, would need ;; to copy what describe-variable does to show the right place (info-xref-output "Symbol `%s' (file %s): cannot goto node: %s" symbol (symbol-file symbol 'defvar) (cadr link))))))))) ;;;###autoload (defun info-xref-docstrings (filename-list) ;; checkdoc-params: (filename-list) "Check docstring info node references in source files. The given files are searched for docstring hyperlinks like Info node `(elisp)Documentation Tips' and those links checked by attempting to visit the target nodes as per `info-xref-check' does. Interactively filenames are read as a wildcard pattern like \"foo*.el\", with the current file as a default. Usually this will be lisp sources, but anything with such hyperlinks can be checked, including the Emacs .c sources (or the etc/DOC file of all builtins). Because info node hyperlinks are found by a simple regexp search in the files, the Lisp code checked doesn't have to be loaded, and links can be in the file commentary or elsewhere too. Even .elc files can usually be checked successfully if you don't have the sources handy." (interactive (let* ((default (and buffer-file-name (file-relative-name buffer-file-name))) (prompt (if default (format "Filename with wildcards (%s): " default) "Filename with wildcards: ")) (pattern (read-file-name prompt nil default)) (filename-list (file-expand-wildcards pattern t))) ;; absolute filenames (eval-and-compile (require 'cl)) ;; for `remove-if' (setq filename-list (remove-if 'info-xref-lock-file-p filename-list)) (unless filename-list (error "No files: %S" pattern)) (list filename-list))) (eval-and-compile (require 'help-mode)) ;; for `help-xref-info-regexp' (info-xref-with-output (dolist (info-xref-filename filename-list) (setq info-xref-xfile-alist nil) ;; "not found"s once per file (info-xref-with-file info-xref-filename (goto-char (point-min)) (while (re-search-forward help-xref-info-regexp nil t) (let ((node (match-string 2))) (save-excursion (goto-char (match-beginning 2)) ;; start of node as error posi= tion ;; skip nodes with "%" as probably `format' strings such as in ;; info-look.el (unless (string-match "%" node) ;; "(emacs)" is the default manual for docstring hyperlinks, ;; per `help-make-xrefs' (unless (string-match "\\`(" node) (setq node (concat "(emacs)" node))) (info-xref-check-node node))))))))) (provide 'info-xref) ;;; info-xref.el ends here --=-=-= Content-Disposition: attachment; filename=info-xref.el.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQBMXIj8LFMCIV9q3ToRAkSeAJ9YFKLhwm3puGJnuirl2rMpT3V2BwCgh4Ug UtSva/m1/MN4DAVBndsCYyM= =4aAA -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 13 13:41:52 2010 Received: (at 7611) by debbugs.gnu.org; 13 Dec 2010 18:41:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSDLM-0003v3-1v for submit@debbugs.gnu.org; Mon, 13 Dec 2010 13:41:52 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSDLL-0003us-00 for 7611@debbugs.gnu.org; Mon, 13 Dec 2010 13:41:51 -0500 Received: from localhost ([127.0.0.1]:52499) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSDRF-0002n9-PJ; Mon, 13 Dec 2010 13:47:57 -0500 To: Kevin Ryde Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> From: Glenn Morris X-Spook: SSL Bosnia Blowpipe Guantanamo kibo Abu Ghraib security X-Ran: #/}GQnl+aN[]A>gDSPk9nd}[$*lP.sd`kh*t+SJj9-[5L_BIRe5T5J7-*WwNuTOE1]ee;[ X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Mon, 13 Dec 2010 13:47:57 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 7611 Cc: 7611@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Kevin Ryde wrote: > This is a new version of my info-xref.el to install please (I posted to > the sources list a while ago). Can you resend this as a patch plus ChangeLog, please? From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 13 16:55:40 2010 Received: (at 7611) by debbugs.gnu.org; 13 Dec 2010 21:55:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSGMt-0008AR-I8 for submit@debbugs.gnu.org; Mon, 13 Dec 2010 16:55:39 -0500 Received: from mailout1-5.pacific.net.au ([61.8.2.212] helo=mailout1.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSGMq-0008A5-IH for 7611@debbugs.gnu.org; Mon, 13 Dec 2010 16:55:37 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 2EA605E5659 for <7611@debbugs.gnu.org>; Tue, 14 Dec 2010 09:01:46 +1100 (EST) Received: from blah.blah (unknown [203.26.175.199]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id A891527408 for <7611@debbugs.gnu.org>; Tue, 14 Dec 2010 09:01:45 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1PSGSo-0001yv-6q for 7611@debbugs.gnu.org; Tue, 14 Dec 2010 09:01:46 +1100 From: Kevin Ryde To: 7611@debbugs.gnu.org Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> Date: Tue, 14 Dec 2010 09:01:45 +1100 In-Reply-To: (Glenn Morris's message of "Mon, 13 Dec 2010 13:47:57 -0500") Message-ID: <874oahl4c6.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 7611 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.8 (---) Glenn Morris writes: > > Can you resend this as a patch Alas, the bazaar repo is hugely too big for me to use (both initial 10-year download and subsequent 10-meg updates). This new file is a drop-in, I believe nobody else has done anything to it. > plus ChangeLog, please? 2010-12-13 Kevin Ryde * info-xref.el: Use compilation-mode for the errors. Move explanations from commentary to relevant docstrings. (info-xref-docstrings): New command. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 14 13:33:09 2010 Received: (at 7611) by debbugs.gnu.org; 14 Dec 2010 18:33:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSZgR-0005FF-NB for submit@debbugs.gnu.org; Tue, 14 Dec 2010 13:33:09 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSZgO-0005Ej-Fx for 7611@debbugs.gnu.org; Tue, 14 Dec 2010 13:33:06 -0500 Received: from localhost ([127.0.0.1]:40388) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSZmM-0004WU-46; Tue, 14 Dec 2010 13:39:14 -0500 To: Kevin Ryde Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> From: Glenn Morris X-Spook: plutonium Attorney General Freeh class struggle SAPO X-Ran: fj#1gTr6~?j$GxTlIh?^hTU%Y1o+u$weIlHn`m/j6//=df[ X-Hue: white X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 14 Dec 2010 13:39:13 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 7611 Cc: 7611@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Kevin Ryde wrote: >> Can you resend this as a patch > > Alas, the bazaar repo is hugely too big for me to use (both initial > 10-year download and subsequent 10-meg updates). Well, there is http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/info-xref.el but at that speed, it will take you ~ 10 hours to load the page. :( > * info-xref.el: Use compilation-mode for the errors. > Move explanations from commentary to relevant docstrings. > (info-xref-docstrings): New command. This doesn't adequately describe the diff (below) between your version and the version in the Emacs trunk. Also the new version uses a cl-function (remove-if) at run-time. *** info-xref.el 2010-12-06 13:38:37.000000000 -0800 --- ../info-xref.el 2010-12-13 14:26:59.000000000 -0800 *************** *** 5,10 **** --- 5,11 ---- ;; Author: Kevin Ryde ;; Keywords: docs + ;; Version: 3 ;; This file is part of GNU Emacs. *************** *** 23,78 **** ;;; Commentary: ! ;; This file implements some simple checking of external cross references in ! ;; info files, by attempting to visit the nodes specified. ;; ! ;; "makeinfo" checks references internal to a document, but not external ! ;; references, which makes it rather easy for mistakes to creep in or node ! ;; name changes to go unnoticed. `Info-validate' doesn't check external ! ;; references either. ! ;; ! ;; `M-x info-xref-check' checks one file. When invoked from an Info-mode or ! ;; texinfo-mode buffer, the current info file is the default at the prompt. ! ;; ! ;; `M-x info-xref-check-all' looks at everything in the normal info path. ! ;; This might be a lot of files but it's a good way to check the consistency ! ;; of the whole system. ! ;; ! ;; Results are shown in a buffer. The format is a bit rough, but hopefully ! ;; there won't be too many problems normally, and correcting them is a ! ;; manual process anyway, a case of finding the right spot in the original ! ;; .texi and finding what node it ought to point to. ! ;; ! ;; When a target info file doesn't exist there's clearly no way to validate ! ;; node references within it. A message is given for missing target files ! ;; (once per source document), it could be simply that the target hasn't ! ;; been installed, or it could be a mistake in the reference. ! ;; ! ;; Indirect info files are understood, just pass the top-level foo.info to ! ;; `info-xref-check' and it traverses all sub-files. Compressed info files ! ;; are accepted too, as usual for `Info-mode'. ! ;; ! ;; `info-xref-check-all' is rather permissive in what it considers an info ! ;; file. It has to be since info files don't necessarily have a ".info" ! ;; suffix (eg. this is usual for the emacs manuals). One consequence of ! ;; this is that if for instance there's a source code directory in ! ;; `Info-directory-list' then a lot of extraneous files might be read, which ! ;; will be time consuming but should be harmless. ! ;; ! ;; `M-x info-xref-check-all-custom' is a related command, it goes through ! ;; all info document references in customizable variables, checking them ! ;; like info file cross references. ;;; Code: (require 'info) ! (defconst info-xref-results-buffer "*info-xref results*" "Name of the buffer for info-xref results.") ;;;###autoload (defun info-xref-check (filename) ! "Check external references in FILENAME, an info document." (interactive (list (let* ((default-filename --- 24,282 ---- ;;; Commentary: ! ;; This is some simple checking of external cross references in info files, ! ;; docstrings and custom-links by attempting to visit the nodes specified. ;; ! ;; `M-x info-xref-check' checks a single info file. See the docstring for ! ;; details. ! ;; ! ;; `M-x info-xref-check-all' checks all info files in Info-directory-list. ! ;; This is a good way to check the consistency of the whole system. ! ;; ! ;; `M-x info-xref-check-all-custom' loads up all defcustom variables and ! ;; checks any info references in them. ! ;; ! ;; `M-x info-xref-docstrings' checks docstring "Info node ..." hyperlinks in ! ;; source files (and other files). ! ! ;;; History: ! ! ;; Version 3 - new M-x info-xref-docstrings, use compilation-mode ;;; Code: (require 'info) + (eval-when-compile + (require 'cl)) ;; for `incf' + + ;;----------------------------------------------------------------------------- + ;; vaguely generic + + (defun info-xref-lock-file-p (filename) + "Return non-nil if FILENAME is an Emacs lock file. + A lock file is \".#foo.txt\" etc per `lock-buffer'." + (string-match "\\(\\`\\|\\/\\)\\.#" filename)) + + (defun info-xref-subfile-p (filename) + "Return t if FILENAME is an info subfile. + If removing the last \"-\" from the filename gives a file + which exists, then consider FILENAME a subfile. This is an + imperfect test, probably ought to open up the purported top file + and see what subfiles it says." + (and (string-match "\\`\\(\\([^-]*-\\)*[^-]*\\)-[0-9]+\\(.*\\)\\'" filename) + (file-exists-p (concat (match-string 1 filename) + (match-string 3 filename))))) + + (defmacro info-xref-with-file (filename &rest body) + ;; checkdoc-params: (filename body) + "Evaluate BODY in a buffer containing the contents of FILENAME. + If FILENAME is already in a buffer then that's used, otherwise a + temporary buffer. + + The current implementation uses `insert-file-contents' rather + than `find-file-noselect' so as not to be held up by queries + about local variables or possible weirdness in a major mode. + `lm-with-file' does a similar thing, but it sets + `emacs-lisp-mode' which is not wanted here." + + (declare (debug t) (indent 1)) + `(let* ((info-xref-with-file--filename ,filename) + (info-xref-with-file--body (lambda () ,@body)) + (info-xref-with-file--existing + (find-buffer-visiting info-xref-with-file--filename))) + (if info-xref-with-file--existing + (with-current-buffer info-xref-with-file--existing + (save-excursion + (funcall info-xref-with-file--body))) + (with-temp-buffer + (insert-file-contents ,filename) + (funcall info-xref-with-file--body))))) + ! ;;----------------------------------------------------------------------------- ! ;; output buffer ! ! (defconst info-xref-output-buffer "*info-xref results*" "Name of the buffer for info-xref results.") + (defvar info-xref-good 0 + "Count of good cross references, during info-xref processing.") + (defvar info-xref-bad 0 + "Count of bad cross references, during info-xref processing.") + (defvar info-xref-unavail 0 + "Count of unavailable cross references, during info-xref processing.") + + (defvar info-xref-output-heading "" + "A heading string, during info-xref processing. + This is shown if there's an error, but not if successful.") + + (defvar info-xref-filename nil + "The current buffer's filename, during info-xref processing. + When looking at file contents in a temp buffer there's no + `buffer-file-name', hence this variable.") + + (defvar info-xref-xfile-alist nil + "Info files found or not found, during info-xref processing. + Key is \"(foo)\" etc and value nil or t according to whether info + manual \"(foo)\" exists or not. This is used to suppress + duplicate messages about foo not being available. (Duplicates + within one top-level file that is.)") + + (defvar info-xref-in-progress nil) + (defmacro info-xref-with-output (&rest body) + "Run BODY with an info-xref output buffer. + This is meant to nest, so you can wrap it around a set of + different info-xref checks and have them write to the one output + buffer created by the outermost `info-xref-with-output', with an + overall good/bad count summary inserted at the very end." + + (declare (debug t)) + `(save-excursion + (unless info-xref-in-progress + (display-buffer (get-buffer-create info-xref-output-buffer)) + (set-buffer info-xref-output-buffer) + (setq buffer-read-only nil) + (fundamental-mode) + (erase-buffer) + (insert ";; info-xref output -*- mode: compilation -*-\n\n") + (compilation-mode) + (setq info-xref-good 0 + info-xref-bad 0 + info-xref-unavail 0 + info-xref-xfile-alist nil)) + + (let ((info-xref-in-progress t) + (info-xref-output-heading "")) + ,@body) + + (unless info-xref-in-progress + (info-xref-output "done, %d good, %d bad, %d unavailable" + info-xref-good info-xref-bad info-xref-unavail)))) + + (defun info-xref-output (fmt &rest args) + "Emit a `format'-ed message FMT+ARGS to the `info-xref-output-buffer'." + (with-current-buffer info-xref-output-buffer + (save-excursion + (goto-char (point-max)) + (let ((inhibit-read-only t)) + (insert info-xref-output-heading + (apply 'format fmt args) + "\n"))) + (setq info-xref-output-heading "") + ;; all this info-xref can be pretty slow, display now so the user sees + ;; some progress + (sit-for 0))) + (put 'info-xref-output 'byte-compile-format-like t) + + (defun info-xref-output-error (fmt &rest args) + "Emit a `format'-ed error FMT+ARGS to the `info-xref-output-buffer'. + The error is attributed to `info-xref-filename' and the current + buffer's line and column of point." + (apply 'info-xref-output + (concat "%s:%s:%s: " fmt) + info-xref-filename + (1+ (count-lines (point-min) (line-beginning-position))) + (1+ (current-column)) + args)) + (put 'info-xref-output-error 'byte-compile-format-like t) + + + ;;----------------------------------------------------------------------------- + ;; node checking + + ;; When asking Info-goto-node to fork, *info* needs to be the current + ;; buffer, otherwise it seems to clone the current buffer but then do the + ;; goto-node in plain *info*. + ;; + ;; We only fork if *info* already exists, if it doesn't then can create and + ;; destroy just that instead of a new name. + ;; + ;; If Info-goto-node can't find the file, then no new buffer is created. If + ;; it finds the file but not the node, then a buffer is created. Handle + ;; this difference by checking before killing. + ;; + (defun info-xref-goto-node-p (node) + "Return t if it's possible to go to the given NODE." + (let ((oldbuf (current-buffer))) + (save-excursion + (save-window-excursion + (prog1 + (condition-case err + (progn + (Info-goto-node node + (when (get-buffer "*info*") + (set-buffer "*info*") + "xref - temporary")) + t) + (error nil)) + (unless (equal (current-buffer) oldbuf) + (kill-buffer))))))) + + (defun info-xref-check-node (node) + + ;; Collapse spaces as per info.el and `help-make-xrefs'. + ;; Note defcustom :info-link nodes don't get this whitespace collapsing, + ;; they should be the exact node name ready to visit. + ;; `info-xref-check-all-custom' uses `info-xref-goto-node-p' and so + ;; doesn't come through here. + ;; + ;; Could use "[\t\n ]+" but try to avoid uselessly replacing " " with " ". + (setq node (replace-regexp-in-string "[\t\n][\t\n ]*\\| [\t\n ]+" " " + node t t)) + + (if (not (string-match "\\`([^)]*)" node)) + (info-xref-output-error "no `(file)' part at start of node: %s\n" node) + (let ((file (match-string 0 node))) + + (if (string-equal "()" file) + (info-xref-output-error "empty filename part: %s" node) + + ;; see if the file exists, if haven't looked 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-error "not available to check: %s\n (this reported once per file)" file)))) + + ;; if the file exists, try the node + (cond ((not (cdr (assoc file info-xref-xfile-alist))) + (incf info-xref-unavail)) + ((info-xref-goto-node-p node) + (incf info-xref-good)) + (t + (incf info-xref-bad) + (info-xref-output-error "no such node: %s" node))))))) + + + ;;----------------------------------------------------------------------------- + ;;;###autoload (defun info-xref-check (filename) ! "Check external references in FILENAME, an info document. ! Interactively from an `Info-mode' or `texinfo-mode' buffer the ! current info file is the default. ! ! Results are shown in a `compilation-mode' buffer. The format is ! a bit rough, but there shouldn't be many problems normally. The ! file:line:column: is the info document, but of course normally ! any correction should be made in the original .texi file. ! Finding the right place in the .texi is a manual process. ! ! When a target info file doesn't exist there's obviously no way to ! validate node references within it. A message is given for ! missing target files once per source document. It could be ! simply that you don't have the target installed, or it could be a ! mistake in the reference. ! ! Indirect info files are understood, just pass the top-level ! foo.info to `info-xref-check' and it traverses all sub-files. ! Compressed info files are accepted too as usual for `Info-mode'. ! ! \"makeinfo\" checks references internal to an info document, but ! not external references, which makes it rather easy for mistakes ! to creep in or node name changes to go unnoticed. ! `Info-validate' doesn't check external references either." ! (interactive (list (let* ((default-filename *************** *** 90,187 **** (format "Info file (%s): " default-filename) "Info file: "))) (read-file-name prompt nil default-filename t)))) (info-xref-check-list (list filename))) ;;;###autoload (defun info-xref-check-all () ! "Check external references in all info documents in the usual path. ! The usual path is `Info-directory-list' and `Info-additional-directory-list'." (interactive) (info-xref-check-list (info-xref-all-info-files))) ! ;; An alternative to trying to get only top-level files here would be to ! ;; simply return all files, and have info-xref-check-list not follow ! ;; Indirect:. The current way seems a bit nicer though, because it gets the ! ;; proper top-level filename into the error messages, and suppresses ! ;; duplicate "not available" messages for all subfiles of a single document. (defun info-xref-all-info-files () "Return a list of all available info files. ! Only top-level files are returned, subfiles are excluded. ! Since info files don't have to have a .info suffix, all files in the ! relevant directories are considered, which might mean a lot of extraneous ! things are returned if for instance a source code directory is in the path." (info-initialize) ;; establish Info-directory-list (apply 'nconc (mapcar (lambda (dir) (let ((result nil)) ! (dolist (name (directory-files dir t)) ! (unless (or (file-directory-p name) (info-xref-subfile-p name)) (push name result))) (nreverse result))) (append Info-directory-list Info-additional-directory-list)))) - (defun info-xref-subfile-p (filename) - "Return t if FILENAME is an info subfile. - If removing the last \"-\" from the filename gives a file that exists, - then consider FILENAME a subfile. This is an imperfect test, we probably - should open up the purported top file and see what subfiles it says." - (and (string-match "\\`\\(\\([^-]*-\\)*[^-]*\\)-[0-9]+\\(.*\\)\\'" filename) - (file-exists-p (concat (match-string 1 filename) - (match-string 3 filename))))) - - - ;; Some dynamic variables are used to share information with sub-functions - ;; below. - ;; - ;; info-xref-filename-header - a heading message for the current top-level - ;; filename, or "" when it's been printed. - ;; - (defvar info-xref-xfile-alist) - ;; - ;; info-xref-good - count of good cross references. - ;; - (defvar info-xref-good) - ;; - ;; info-xref-bad - count of bad cross references. - ;; - (defvar info-xref-bad) - ;; - ;; info-xref-xfile-alist - indexed by "(foo)" with value nil or t according - ;; to whether "(foo)" exists or not. This is used to suppress duplicate - ;; messages about foo not being available. (Duplicates within one - ;; top-level file that is.) - ;; - (defvar info-xref-filename-heading) - (defun info-xref-check-list (filename-list) "Check external references in info documents in FILENAME-LIST." ! (pop-to-buffer info-xref-results-buffer t) ! (erase-buffer) ! (let ((info-xref-good 0) ! (info-xref-bad 0)) (dolist (info-xref-filename filename-list) ! (let ((info-xref-filename-heading ! (format "In file %s:\n" info-xref-filename)) ! (info-xref-xfile-alist nil)) (with-temp-message (format "Looking at %s" info-xref-filename) (with-temp-buffer (info-insert-file-contents info-xref-filename) (goto-char (point-min)) ! (if (re-search-forward "\^_\nIndirect:\n" nil t) (let ((dir (file-name-directory info-xref-filename))) (while (looking-at "\\(.*\\): [0-9]+\n") ! (let ((subfile (match-string 1))) (with-temp-buffer ! (info-insert-file-contents ! (expand-file-name subfile dir)) (info-xref-check-buffer))) (forward-line))) ! (info-xref-check-buffer)))))) ! (insert (format "done, %d good, %d bad\n" info-xref-good info-xref-bad)))) (defun info-xref-check-buffer () "Check external references in the info file in the current buffer. --- 294,373 ---- (format "Info file (%s): " default-filename) "Info file: "))) (read-file-name prompt nil default-filename t)))) + (info-xref-check-list (list filename))) ;;;###autoload (defun info-xref-check-all () ! "Check external references in all info documents in the info path. ! `Info-directory-list' and `Info-additional-directory-list' are ! the info paths. See `info-xref-check' for how each file is ! checked. ! ! The search for \"all\" info files is rather permissive, since ! info files don't necessarily have a \".info\" extension and in ! particular the Emacs manuals normally don't. If you have a ! source code directory in `Info-directory-list' then a lot of ! extraneous files might be read. This will be time consuming but ! should be harmless." ! (interactive) (info-xref-check-list (info-xref-all-info-files))) ! ;; An alternative for geting only top-level files here would be to simply ! ;; return all files and have info-xref-check-list not follow "Indirect:". ! ;; The current way seems better because it (potentially) gets the proper ! ;; top-level filename into the error messages, and suppresses duplicate "not ! ;; available" messages for all subfiles of a single document. (defun info-xref-all-info-files () "Return a list of all available info files. ! Only top level files are returned, subfiles are excluded. ! Since info files don't have to have a .info suffix, all files in ! the relevant directories are considered, which might mean a lot ! of extraneous things if for instance a source code directory is ! in the path." (info-initialize) ;; establish Info-directory-list (apply 'nconc (mapcar (lambda (dir) (let ((result nil)) ! (dolist (name (directory-files ! dir ! t ;; absolute filenames ! "\\`[^.]")) ;; not dotfiles, nor .# lockfiles ! (when (and (file-exists-p name) ;; ignore broken symlinks ! (not (string-match "\\.te?xi\\'" name)) ;; not .texi ! (not (backup-file-name-p name)) ! (not (file-directory-p name)) ! (not (info-xref-subfile-p name))) (push name result))) (nreverse result))) (append Info-directory-list Info-additional-directory-list)))) (defun info-xref-check-list (filename-list) "Check external references in info documents in FILENAME-LIST." ! (info-xref-with-output (dolist (info-xref-filename filename-list) ! (setq info-xref-xfile-alist nil) ! (let ((info-xref-output-heading ! (format "Info file %s\n" info-xref-filename))) (with-temp-message (format "Looking at %s" info-xref-filename) (with-temp-buffer (info-insert-file-contents info-xref-filename) (goto-char (point-min)) ! (if (search-forward "\^_\nIndirect:\n" nil t) (let ((dir (file-name-directory info-xref-filename))) (while (looking-at "\\(.*\\): [0-9]+\n") ! (let ((info-xref-filename ! (expand-file-name (match-string 1) dir))) (with-temp-buffer ! (info-insert-file-contents info-xref-filename) (info-xref-check-buffer))) (forward-line))) ! (info-xref-check-buffer)))))))) (defun info-xref-check-buffer () "Check external references in the info file in the current buffer. *************** *** 190,301 **** (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 "") - ;; all this info-xref can be pretty slow, display now so the user can - ;; see some progress - (sit-for 0))) - - ;; When asking Info-goto-node to fork, *info* needs to be the current - ;; buffer, otherwise it seems to clone the current buffer but then do the - ;; goto-node in plain *info*. - ;; - ;; We only fork if *info* already exists, if it doesn't then we can create - ;; and destroy just that instead of a new name. - ;; - ;; If Info-goto-node can't find the file, then no new buffer is created. If - ;; it finds the file but not the node, then a buffer is created. Handle - ;; this difference by checking before killing. - ;; - (defun info-xref-goto-node-p (node) - "Return t if it's possible to go to the given NODE." - (let ((oldbuf (current-buffer))) (save-excursion ! (save-window-excursion ! (prog1 ! (condition-case err ! (progn ! (Info-goto-node node ! (when (get-buffer "*info*") ! (set-buffer "*info*") ! "xref - temporary")) ! t) ! (error nil)) ! (unless (equal (current-buffer) oldbuf) ! (kill-buffer (current-buffer)))))))) ;;;###autoload (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)) --- 376,445 ---- (while (re-search-forward "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]*)\\)[^.,]+\\)[.,]" nil t) (save-excursion ! (goto-char (match-beginning 1)) ;; start of nodename as error position ! (info-xref-check-node (match-string 1))))) ! ! (defvar viper-mode) ;; quieten the byte compiler ! (defvar gnus-registry-install) ;;;###autoload (defun info-xref-check-all-custom () "Check info references in all customize groups and variables. ! Info references can be in `custom-manual' or `info-link' entries ! of the `custom-links' for a variable. ! Any `custom-load' autoloads in variables are loaded in order to ! get full link information. This will be a lot of Lisp packages ! and can take a long time." (interactive) ! (info-xref-with-output ! ;; `custom-load-symbol' is not used, since it quietly ignores errors, but ! ;; we want to show them since they 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 ...") (require 'cus-start) (require 'cus-load) ! ! ;; These are `setq' rather than `let' since a let would unbind the ! ;; variables after viper.el/gnus-registry.el have loaded, defeating the ! ;; defvars in those files. Of course it'd be better if those files ! ;; didn't make interactive queries on loading at all, to allow for ! ;; programmatic loading like here. ! (unless (boundp 'viper-mode) ! (setq viper-mode nil)) ;; avoid viper.el ask about viperizing ! (unless (boundp 'gnus-registry-install) ! (setq gnus-registry-install nil)) ;; avoid gnus-registery.el querying ! (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" symbol load cause)))) ;; skip if previously loaded ((assoc load load-history)) ((assoc (locate-library load) load-history)) (t ! (condition-case err ! (load load) (error ! (info-xref-output "Symbol `%s': cannot load \"%s\": %s" ! symbol load ! (error-message-string err))))))))) ;; Don't bother to check whether the info file exists as opposed to just ! ;; a missing node. If you have the code then you should have the ! ;; documentation, so a wrong node name will be the usual fault. ;; ! (info-xref-output "\nChecking custom-links references ...") (mapatoms (lambda (symbol) (dolist (link (get symbol 'custom-links)) *************** *** 304,318 **** (if (eq :tag (cadr link)) (setq link (cddr link))) (if (info-xref-goto-node-p (cadr link)) ! (setq good (1+ good)) ! (setq bad (1+ bad)) ;; symbol-file gives nil for preloaded variables, would need ;; to copy what describe-variable does to show the right place ! (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 ;;; info-xref.el ends here --- 448,528 ---- (if (eq :tag (cadr link)) (setq link (cddr link))) (if (info-xref-goto-node-p (cadr link)) ! (incf info-xref-good) ! (incf info-xref-bad) ;; symbol-file gives nil for preloaded variables, would need ;; to copy what describe-variable does to show the right place ! (info-xref-output "Symbol `%s' (file %s): cannot goto node: %s" ! symbol ! (symbol-file symbol 'defvar) ! (cadr link))))))))) ! ! ;;;###autoload ! (defun info-xref-docstrings (filename-list) ! ;; checkdoc-params: (filename-list) ! "Check docstring info node references in source files. ! The given files are searched for docstring hyperlinks like ! ! Info node `(elisp)Documentation Tips' ! ! and those links checked by attempting to visit the target nodes ! as per `info-xref-check' does. ! ! Interactively filenames are read as a wildcard pattern like ! \"foo*.el\", with the current file as a default. Usually this ! will be lisp sources, but anything with such hyperlinks can be ! checked, including the Emacs .c sources (or the etc/DOC file of ! all builtins). ! ! Because info node hyperlinks are found by a simple regexp search ! in the files, the Lisp code checked doesn't have to be loaded, ! and links can be in the file commentary or elsewhere too. Even ! .elc files can usually be checked successfully if you don't have ! the sources handy." ! ! (interactive ! (let* ((default (and buffer-file-name ! (file-relative-name buffer-file-name))) ! (prompt (if default ! (format "Filename with wildcards (%s): " ! default) ! "Filename with wildcards: ")) ! (pattern (read-file-name prompt nil default)) ! (filename-list (file-expand-wildcards pattern ! t))) ;; absolute filenames ! (eval-and-compile ! (require 'cl)) ;; for `remove-if' ! (setq filename-list (remove-if 'info-xref-lock-file-p filename-list)) ! (unless filename-list ! (error "No files: %S" pattern)) ! (list filename-list))) ! ! (eval-and-compile ! (require 'help-mode)) ;; for `help-xref-info-regexp' ! ! (info-xref-with-output ! (dolist (info-xref-filename filename-list) ! (setq info-xref-xfile-alist nil) ;; "not found"s once per file ! ! (info-xref-with-file info-xref-filename ! (goto-char (point-min)) ! (while (re-search-forward help-xref-info-regexp nil t) ! (let ((node (match-string 2))) ! (save-excursion ! (goto-char (match-beginning 2)) ;; start of node as error position ! ! ;; skip nodes with "%" as probably `format' strings such as in ! ;; info-look.el ! (unless (string-match "%" node) ! ! ;; "(emacs)" is the default manual for docstring hyperlinks, ! ;; per `help-make-xrefs' ! (unless (string-match "\\`(" node) ! (setq node (concat "(emacs)" node))) ! ! (info-xref-check-node node))))))))) ! (provide 'info-xref) ;;; info-xref.el ends here From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 20 18:43:47 2010 Received: (at 7611) by debbugs.gnu.org; 20 Dec 2010 23:43:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PUpON-0003kB-Fu for submit@debbugs.gnu.org; Mon, 20 Dec 2010 18:43:47 -0500 Received: from mailout1-5.pacific.net.au ([61.8.2.212] helo=mailout1.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PUpOK-0003ju-QI for 7611@debbugs.gnu.org; Mon, 20 Dec 2010 18:43:46 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 33A965E5978; Tue, 21 Dec 2010 10:50:14 +1100 (EST) Received: from blah.blah (unknown [203.26.175.38]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id EA6068C14; Tue, 21 Dec 2010 10:50:12 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1PUpUb-00046L-11; Tue, 21 Dec 2010 10:50:13 +1100 From: Kevin Ryde To: Glenn Morris Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> Date: Tue, 21 Dec 2010 10:50:12 +1100 In-Reply-To: (Glenn Morris's message of "Tue, 14 Dec 2010 13:39:13 -0500") Message-ID: <8762uoovgr.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.7 (---) X-Debbugs-Envelope-To: 7611 Cc: 7611@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) Glenn Morris writes: > > http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/info-xref.el Oh, that might be better. Yet even last time I tried a big git no-history download it seemed to download the lot anyway, presumably to then discard or something. > This doesn't adequately describe the diff Believe it or not that's all the operative changes. A couple of bits split out or moved up to share or help, but no more than that. (I wrote the original, and nobody else has done anything to it, so I wouldn't think every detail will be of much interest.) > remove-if That's orright in one interactive case is it? It's primarily a development tool anyway, so wouldn't be loaded in normal user sessions. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 23:11:44 2010 Received: (at 7611) by debbugs.gnu.org; 29 Dec 2010 04:11:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXnO3-0005bO-Rb for submit@debbugs.gnu.org; Tue, 28 Dec 2010 23:11:43 -0500 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXnO2-0005bE-9p for 7611@debbugs.gnu.org; Tue, 28 Dec 2010 23:11:42 -0500 Received: from furball (bb220-255-229-62.singnet.com.sg [220.255.229.62]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id oBT4ITjD020019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 28 Dec 2010 23:18:32 -0500 Received: by furball (Postfix, from userid 1000) id 9F78B160AB5; Wed, 29 Dec 2010 12:18:27 +0800 (SGT) From: Chong Yidong To: Kevin Ryde Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> <8762uoovgr.fsf@blah.blah> Date: Wed, 29 Dec 2010 12:18:27 +0800 In-Reply-To: <8762uoovgr.fsf@blah.blah> (Kevin Ryde's message of "Tue, 21 Dec 2010 10:50:12 +1100") Message-ID: <8762ud1ab0.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 7611 Cc: Glenn Morris , 7611@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Kevin Ryde writes: > Believe it or not that's all the operative changes. A couple of bits > split out or moved up to share or help, but no more than that. (I wrote > the original, and nobody else has done anything to it, so I wouldn't > think every detail will be of much interest.) The log should at the very least list the functions and variables that are new, changed, or removed. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 01 17:30:58 2011 Received: (at 7611) by debbugs.gnu.org; 1 Jan 2011 22:30:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZ9yU-0008HV-66 for submit@debbugs.gnu.org; Sat, 01 Jan 2011 17:30:58 -0500 Received: from mailout2-1.pacific.net.au ([61.8.2.224] helo=mailout2.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZ9yR-0008HF-Bi for 7611@debbugs.gnu.org; Sat, 01 Jan 2011 17:30:56 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id D78F32A9A66 for <7611@debbugs.gnu.org>; Sun, 2 Jan 2011 09:37:54 +1100 (EST) Received: from blah.blah (unknown [203.26.175.213]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 6783A8C04 for <7611@debbugs.gnu.org>; Sun, 2 Jan 2011 09:37:53 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1PZA5I-0000mW-Gv for 7611@debbugs.gnu.org; Sun, 02 Jan 2011 09:38:00 +1100 From: Kevin Ryde To: 7611@debbugs.gnu.org Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> <8762uoovgr.fsf@blah.blah> <8762ud1ab0.fsf@stupidchicken.com> Date: Sun, 02 Jan 2011 09:38:00 +1100 In-Reply-To: <8762ud1ab0.fsf@stupidchicken.com> (Chong Yidong's message of "Wed, 29 Dec 2010 12:18:27 +0800") Message-ID: <87wrmojlmf.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7611 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) Chong Yidong writes: > > The log should at the very least list the functions and variables that > are new, changed, or removed. Ok. I'll get to that soon. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 07 19:35:31 2011 Received: (at 7611) by debbugs.gnu.org; 8 Jan 2011 00:35:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PbMmJ-000109-Ds for submit@debbugs.gnu.org; Fri, 07 Jan 2011 19:35:31 -0500 Received: from mailout2-1.pacific.net.au ([61.8.2.224] helo=mailout2.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PbMmH-0000zv-4x for 7611@debbugs.gnu.org; Fri, 07 Jan 2011 19:35:30 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 695422AB808 for <7611@debbugs.gnu.org>; Sat, 8 Jan 2011 11:42:45 +1100 (EST) Received: from blah.blah (unknown [203.26.175.210]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id E6C4C8C03 for <7611@debbugs.gnu.org>; Sat, 8 Jan 2011 11:42:39 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1PbMsk-0004XT-8U for 7611@debbugs.gnu.org; Sat, 08 Jan 2011 11:42:10 +1100 From: Kevin Ryde To: 7611@debbugs.gnu.org Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> <8762uoovgr.fsf@blah.blah> <8762ud1ab0.fsf@stupidchicken.com> <87wrmojlmf.fsf@blah.blah> Date: Sat, 08 Jan 2011 11:42:09 +1100 In-Reply-To: <87wrmojlmf.fsf@blah.blah> (Kevin Ryde's message of "Sun, 02 Jan 2011 09:38:00 +1100") Message-ID: <87tyhk2plq.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 7611 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) 2011-01-07 Kevin Ryde * info-xref.el: Version 3. (info-xref-check, info-xref-check-all): Commentary details moved into docstrings for better visibility. Use compilation-mode for the results buffer. (info-xref-output, info-xref-output-error, info-xref-with-output) (info-xref-filename, info-xref-in-progress): New internals for this. (info-xref-check-list, info-xref-check-buffer) (info-xref-check-all-custom): Use those. (info-xref-output-buffer): Renamed from info-xref-results-buffer. (info-xref-output-heading): Renamed from info-xref-filename-heading. (info-xref-good, info-xref-bad, info-xref-xfile-alist) (info-xref-filename-heading): Moved to output managing section. (info-xref-docstrings): New command checking "Info node `(foo)Bar'" (info-xref-lock-file-p, info-xref-with-file): New helpers for it. (info-xref-subfile-p): Moved to generic section with those two. (info-xref-check-node): New function split from info-xref-check-buffer, shared by info-xref-docstrings. (info-xref-goto-node-p): Moved to a checking section with that func. (info-xref-unavail): New counter. (info-xref-check-node): Use it. (info-xref-with-output): Show count of unavailables at end of output. (info-xref-all-info-files): Exclude ".*" dotfiles. Ignore broken symlinks. Exclude .texi files. Exclude Emacs backup files. (info-xref-check-all-custom): Fix quietening viper-mode and gnus-registry-install -- must use setq not let so as not to unbind after load. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 10 18:28:30 2011 Received: (at 7611) by debbugs.gnu.org; 10 Jan 2011 23:28:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PcRA5-0007ZB-VK for submit@debbugs.gnu.org; Mon, 10 Jan 2011 18:28:30 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PcRA4-0007Yz-5H for 7611@debbugs.gnu.org; Mon, 10 Jan 2011 18:28:28 -0500 Received: from localhost ([127.0.0.1]:39197) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PcRHB-0007Wd-7R; Mon, 10 Jan 2011 18:35:49 -0500 To: Kevin Ryde Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> <8762uoovgr.fsf@blah.blah> <8762ud1ab0.fsf@stupidchicken.com> <87wrmojlmf.fsf@blah.blah> <87tyhk2plq.fsf@blah.blah> From: Glenn Morris X-Spook: Europol basement Attorney General asset Bellcore global X-Ran: -ap5g,R7ajd|rGs|acNV^5827u.Xu(NkdbHH{8*-E=wStX_SsWPB^`$*p{=W,VT1Ach>`0 X-Hue: black X-Debbugs-No-Ack: yes X-Attribution: GM Date: Mon, 10 Jan 2011 18:35:48 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 7611 Cc: 7611@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Great, just get rid of the cl function and I can install this. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 14 13:50:25 2011 Received: (at 7611) by debbugs.gnu.org; 14 Jan 2011 18:50:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PdojA-0000wg-Mu for submit@debbugs.gnu.org; Fri, 14 Jan 2011 13:50:25 -0500 Received: from mailout1-5.pacific.net.au ([61.8.2.212] helo=mailout1.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pdoj8-0000wT-2U for 7611@debbugs.gnu.org; Fri, 14 Jan 2011 13:50:23 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id A1A5D5E8B98; Sat, 15 Jan 2011 05:57:57 +1100 (EST) Received: from blah.blah (unknown [203.26.175.46]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 9C5388C05; Sat, 15 Jan 2011 05:57:56 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1Pdoqb-0004JS-Rj; Sat, 15 Jan 2011 05:58:05 +1100 From: Kevin Ryde To: Glenn Morris Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> <8762uoovgr.fsf@blah.blah> <8762ud1ab0.fsf@stupidchicken.com> <87wrmojlmf.fsf@blah.blah> <87tyhk2plq.fsf@blah.blah> Date: Sat, 15 Jan 2011 05:58:05 +1100 In-Reply-To: (Glenn Morris's message of "Mon, 10 Jan 2011 18:35:48 -0500") Message-ID: <87pqrzl3cy.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 7611 Cc: 7611@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Glenn Morris writes: > > cl function Is there a native equivalent to `remove-if' list filter by predicate? Were some of those coming into the core? I suppose at worst the `loop' macro is a macro. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 14 17:20:47 2011 Received: (at 7611) by debbugs.gnu.org; 14 Jan 2011 22:20:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pds0k-0005p0-Td for submit@debbugs.gnu.org; Fri, 14 Jan 2011 17:20:47 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pds0i-0005ol-Ru for 7611@debbugs.gnu.org; Fri, 14 Jan 2011 17:20:45 -0500 Received: by wwj40 with SMTP id 40so3557957wwj.15 for <7611@debbugs.gnu.org>; Fri, 14 Jan 2011 14:28:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.156.84 with SMTP id l62mr1059989wek.58.1295043991859; Fri, 14 Jan 2011 14:26:31 -0800 (PST) Received: by 10.216.70.212 with HTTP; Fri, 14 Jan 2011 14:26:31 -0800 (PST) Date: Fri, 14 Jan 2011 17:26:31 -0500 X-Google-Sender-Auth: V_roETdWVk35d6ruXTHVu2ie33A Message-ID: Subject: bug#7611: 23.2; info-xref.el v.3 From: MON KEY To: 7611@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -3.7 (---) X-Debbugs-Envelope-To: 7611 Cc: user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) > Is there a native equivalent to `remove-if' list filter by predicate? More than one. Sshhhh! Keep these under your hat: doc-view-remove-if lisp/doc-view.el erc-remove-if-not lisp/erc/erc-compat.el > Were some of those coming into the core? They're already distributed with Emacs core but no one advertises 'em for fear that they'll get documented... And if that should happen info-xref might _break_ under its own load what with trying to disambiguate symbols xrefed in the cl manual node and the lispref manual node! :P If/when the ert.el package moves into core we may inherit these tasty bits too: `ert--cl-do-remf', `ert--remprop', `ert--remove-if-not', `ert--intersection', `ert--set-difference', `ert--union', `ert--gensym', `ert--remove*', `ert--mismatch', `ert--subseq', Still, you needn't worry that myriad CL-feature redundancies are bad for Emacs. After all, having a single canonical well specified implementation of commonly used lisp idioms is overrated. Then again, maybe writing info-xref in Perl was not an option for you... :P -- /s_P\ From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 15 20:53:42 2011 Received: (at 7611-done) by debbugs.gnu.org; 16 Jan 2011 01:53:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PeHoM-0002DO-2l for submit@debbugs.gnu.org; Sat, 15 Jan 2011 20:53:42 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PeHoK-0002DC-NN for 7611-done@debbugs.gnu.org; Sat, 15 Jan 2011 20:53:41 -0500 Received: from localhost ([127.0.0.1]:58110) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PeHvg-0001eA-Fr; Sat, 15 Jan 2011 21:01:16 -0500 to: 7611-done@debbugs.gnu.org Subject: Re: bug#7611: 23.2; info-xref.el v.3 References: <87wrnhl08l.fsf@blah.blah> <874oahl4c6.fsf@blah.blah> <8762uoovgr.fsf@blah.blah> <8762ud1ab0.fsf@stupidchicken.com> <87wrmojlmf.fsf@blah.blah> <87tyhk2plq.fsf@blah.blah> <87pqrzl3cy.fsf@blah.blah> From: Glenn Morris X-Spook: Sundevil Aladdin colonel Mantis RSA Rand Corporation X-Ran: ^R43Bey*33j@Zxvns>Q;wf]z8.xO'PNS_JC%f/\59voemsT_:Fox7z2fR]%9Y0TDxM5@N> X-Hue: red X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 15 Jan 2011 21:01:16 -0500 In-Reply-To: <87pqrzl3cy.fsf@blah.blah> (Kevin Ryde's message of "Sat\, 15 Jan 2011 05\:58\:05 +1100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 7611-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Did it for you. From unknown Thu Jun 19 13:55:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Feb 2011 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator