summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-04-09 16:43:15 -0400
committerGlenn Morris <rgm@gnu.org>2012-04-09 16:43:15 -0400
commit05920a43fc18e696b464387e781e7cfdcea5b5af (patch)
tree9844632d0dfe04426c4032776764dfd01b33b7ff /src/doc.c
parent935396c0f0f97df05f0e41af517abed22655fd20 (diff)
downloademacs-05920a43fc18e696b464387e781e7cfdcea5b5af.tar.gz
emacs-05920a43fc18e696b464387e781e7cfdcea5b5af.tar.bz2
emacs-05920a43fc18e696b464387e781e7cfdcea5b5af.zip
doc.c fix for bug#11036
* src/doc.c (Fsnarf_documentation): Check variables, functions are bound, not just in the obarray, before snarfing them.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/doc.c b/src/doc.c
index 02db4dde072..9e48a4d49f3 100644
--- 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. */