]> git.eshelyaron.com Git - emacs.git/commitdiff
doc.c fix for bug#11036
authorGlenn Morris <rgm@gnu.org>
Mon, 9 Apr 2012 20:43:15 +0000 (16:43 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 9 Apr 2012 20:43:15 +0000 (16:43 -0400)
* src/doc.c (Fsnarf_documentation): Check variables, functions are bound,
not just in the obarray, before snarfing them.

src/ChangeLog
src/doc.c

index aa7d3b5eb7f0570ede561fa2766b8f1db5148373..18a3d4545e36082efe4aba783f14f4d575fb855d 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-09  Glenn Morris  <rgm@gnu.org>
 
+       * doc.c (Fsnarf_documentation): Check variables, functions are bound,
+       not just in the obarray, before snarfing them.  (Bug#11036)
+
        * Makefile.in ($(leimdir)/leim-list.el):
        Pass EMACS rather than BUILT_EMACS.
 
index 02db4dde072f87a2e9949a520207acf220fd696f..9e48a4d49f3a3d4b76aa6c602ad981173fdfe21b 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,6 +1,6 @@
 /* Record indices of function doc strings stored in a file.
-   Copyright (C) 1985-1986, 1993-1995, 1997-2012
-                 Free Software Foundation, Inc.
+
+Copyright (C) 1985-1986, 1993-1995, 1997-2012 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -671,15 +671,18 @@ the same file name is found in the `doc-directory'.  */)
                  /* Install file-position as variable-documentation property
                     and make it negative for a user-variable
                     (doc starts with a `*').  */
-                 Fput (sym, Qvariable_documentation,
-                       make_number ((pos + end + 1 - buf)
-                                    * (end[1] == '*' ? -1 : 1)));
+                  if (!NILP (Fboundp (sym)))
+                    Fput (sym, Qvariable_documentation,
+                          make_number ((pos + end + 1 - buf)
+                                       * (end[1] == '*' ? -1 : 1)));
                }
 
              /* Attach a docstring to a function?  */
              else if (p[1] == 'F')
-               store_function_docstring (sym, pos + end + 1 - buf);
-
+                {
+                  if (!NILP (Ffboundp (sym)))
+                    store_function_docstring (sym, pos + end + 1 - buf);
+                }
              else if (p[1] == 'S')
                ; /* Just a source file name boundary marker.  Ignore it.  */