]> code.delx.au - gnu-emacs/blobdiff - src/doc.c
Ibuffer change marks
[gnu-emacs] / src / doc.c
index 017dd173d0ace2f58cb5cc5392960601143a7f17..6ffdad10f030221f1ee54943bce482f04de4bcc0 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -339,16 +339,7 @@ string is passed through `substitute-command-keys'.  */)
   if (CONSP (fun) && EQ (XCAR (fun), Qmacro))
     fun = XCDR (fun);
   if (SUBRP (fun))
-    {
-      if (XSUBR (fun)->doc == 0)
-       return Qnil;
-      /* FIXME: This is not portable, as it assumes that string
-        pointers have the top bit clear.  */
-      else if ((intptr_t) XSUBR (fun)->doc >= 0)
-       doc = build_string (XSUBR (fun)->doc);
-      else
-       doc = make_number ((intptr_t) XSUBR (fun)->doc);
-    }
+    doc = make_number (XSUBR (fun)->doc);
   else if (COMPILEDP (fun))
     {
       if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING)
@@ -473,7 +464,7 @@ aren't strings.  */)
 /* Scanning the DOC files and placing docstring offsets into functions.  */
 
 static void
-store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
+store_function_docstring (Lisp_Object obj, EMACS_INT offset)
 {
   /* Don't use indirect_function here, or defaliases will apply their
      docstrings to the base functions (Bug#2603).  */
@@ -481,15 +472,10 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
 
   /* The type determines where the docstring is stored.  */
 
-  /* Lisp_Subrs have a slot for it.  */
-  if (SUBRP (fun))
-    {
-      intptr_t negative_offset = - offset;
-      XSUBR (fun)->doc = (char *) negative_offset;
-    }
-
   /* If it's a lisp form, stick it in the form.  */
-  else if (CONSP (fun))
+  if (CONSP (fun) && EQ (XCAR (fun), Qmacro))
+    fun = XCDR (fun);
+  if (CONSP (fun))
     {
       Lisp_Object tem;
 
@@ -503,10 +489,12 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
               correctness is quite delicate.  */
            XSETCAR (tem, make_number (offset));
        }
-      else if (EQ (tem, Qmacro))
-       store_function_docstring (XCDR (fun), offset);
     }
 
+  /* Lisp_Subrs have a slot for it.  */
+  else if (SUBRP (fun))
+    XSUBR (fun)->doc = offset;
+
   /* Bytecode objects sometimes have slots for it.  */
   else if (COMPILEDP (fun))
     {