Subject: bug#12686: PATCH: ambiguous help doc strings

From: "Aaron S. Hawley" <[email-masked]>
Date: Tue, 23 Oct 2012 11:24:01 -0400

> To avoid crashes after loading all the libraries I suggest to try
> static analysis without loading the libraries.  This is possible
> to do with a function like `emacs-lisp-grep' from
> http://lists.gnu.org/archive/html/emacs-devel/2005-05/msg01259.html

Nice.

> When the first element of an expression read from the source file
> is `defun', its docstring is in the fourth element.  A variable name
> is the second element of the expression whose first element is `defvar'
> or `defcustom', etc.  Conditional defvars are more tricky to process
> but fortunately they are rare.

For this problem, this would require two passes.  The first pass to
find the ambiguous symbol definitions (a defun and defvar or
defcustom) then a second to find the references to these symbols in
documentation in an ambiguous way.  I'd probably use something like an
obarray to keep track of symbols in the first pass, but it would be a
second-rate reimplementation to what Emacs already does.  And
`emacs-lisp-grep' wouldn't search the C sources.  So for laziness and
completeness, I went with mapatoms.

-- 
In general, we reserve the right to have a poor
memory--the computer, however, is supposed to
remember!  Poor computer.  -- Guy Lewis Steele Jr.