/[emacs]/emacs/src/doc.c
ViewVC logotype

Diff of /emacs/src/doc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.87 by rms, Sat Nov 17 22:38:58 2001 UTC revision 1.88 by monnier, Wed Dec 5 01:47:27 2001 UTC
# Line 81  static char *get_doc_string_buffer; Line 81  static char *get_doc_string_buffer;
81  static int get_doc_string_buffer_size;  static int get_doc_string_buffer_size;
82    
83  static unsigned char *read_bytecode_pointer;  static unsigned char *read_bytecode_pointer;
84    Lisp_Object Fsnarf_documentation P_ ((Lisp_Object));
85    
86  /* readchar in lread.c calls back here to fetch the next byte.  /* readchar in lread.c calls back here to fetch the next byte.
87     If UNREADFLAG is 1, we unread a byte.  */     If UNREADFLAG is 1, we unread a byte.  */
# Line 134  get_doc_string (filepos, unibyte, defini Line 135  get_doc_string (filepos, unibyte, defini
135      {      {
136        file = XCAR (filepos);        file = XCAR (filepos);
137        position = XINT (XCDR (filepos));        position = XINT (XCDR (filepos));
       if (position < 0)  
         position = - position;  
138      }      }
139    else    else
140      return Qnil;      return Qnil;
141    
142      if (position < 0)
143        position = - position;
144    
145    if (!STRINGP (Vdoc_directory))    if (!STRINGP (Vdoc_directory))
146      return Qnil;      return Qnil;
147    
# Line 329  string is passed through `substitute-com Line 331  string is passed through `substitute-com
331        else if ((EMACS_INT) XSUBR (fun)->doc >= 0)        else if ((EMACS_INT) XSUBR (fun)->doc >= 0)
332          doc = build_string (XSUBR (fun)->doc);          doc = build_string (XSUBR (fun)->doc);
333        else        else
334          doc = get_doc_string (make_number (- (EMACS_INT) XSUBR (fun)->doc),          doc = make_number ((EMACS_INT) XSUBR (fun)->doc);
                               0, 0);  
335      }      }
336    else if (COMPILEDP (fun))    else if (COMPILEDP (fun))
337      {      {
338        if ((XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING)        if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING)
339          return Qnil;          return Qnil;
340        tem = XVECTOR (fun)->contents[COMPILED_DOC_STRING];        tem = AREF (fun, COMPILED_DOC_STRING);
341        if (STRINGP (tem))        if (STRINGP (tem))
342          doc = tem;          doc = tem;
343        else if (NATNUMP (tem) || CONSP (tem))        else if (NATNUMP (tem) || CONSP (tem))
344          doc = get_doc_string (tem, 0, 0);          doc = tem;
345        else        else
346          return Qnil;          return Qnil;
347      }      }
# Line 365  string is passed through `substitute-com Line 366  string is passed through `substitute-com
366              doc = tem;              doc = tem;
367            /* Handle a doc reference--but these never come last            /* Handle a doc reference--but these never come last
368               in the function body, so reject them if they are last.  */               in the function body, so reject them if they are last.  */
369            else if ((NATNUMP (tem) || CONSP (tem))            else if ((NATNUMP (tem) || (CONSP (tem) && INTEGERP (XCDR (tem))))
370                     && ! NILP (XCDR (tem1)))                     && !NILP (XCDR (tem1)))
371              doc = get_doc_string (tem, 0, 0);              doc = tem;
372            else            else
373              return Qnil;              return Qnil;
374          }          }
# Line 384  string is passed through `substitute-com Line 385  string is passed through `substitute-com
385        Fsignal (Qinvalid_function, Fcons (fun, Qnil));        Fsignal (Qinvalid_function, Fcons (fun, Qnil));
386      }      }
387    
388      if (INTEGERP (doc) || CONSP (doc))
389        doc = get_doc_string (doc, 0, 0);
390    
391    if (NILP (raw))    if (NILP (raw))
392      doc = Fsubstitute_command_keys (doc);      doc = Fsubstitute_command_keys (doc);
393    return doc;    return doc;
# Line 404  aren't strings.  */) Line 408  aren't strings.  */)
408    Lisp_Object tem;    Lisp_Object tem;
409    
410    tem = Fget (symbol, prop);    tem = Fget (symbol, prop);
411    if (INTEGERP (tem))    if (INTEGERP (tem) || (CONSP (tem) && INTEGERP (XCDR (tem))))
     tem = get_doc_string (XINT (tem) > 0 ? tem : make_number (- XINT (tem)), 0, 0);  
   else if (CONSP (tem) && INTEGERP (XCDR (tem)))  
412      tem = get_doc_string (tem, 0, 0);      tem = get_doc_string (tem, 0, 0);
413    else if (!STRINGP (tem))    else if (!STRINGP (tem))
414      /* Feval protects its argument.  */      /* Feval protects its argument.  */
# Line 454  store_function_docstring (fun, offset) Line 456  store_function_docstring (fun, offset)
456      {      {
457        /* This bytecode object must have a slot for the        /* This bytecode object must have a slot for the
458           docstring, since we've found a docstring for it.  */           docstring, since we've found a docstring for it.  */
459        if ((XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)        if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)
460          XSETFASTINT (XVECTOR (fun)->contents[COMPILED_DOC_STRING], offset);          XSETFASTINT (AREF (fun, COMPILED_DOC_STRING), offset);
461      }      }
462  }  }
463    

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26