/[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.108 by monnier, Fri Oct 15 14:49:30 2004 UTC revision 1.109 by jhd, Tue Nov 9 08:19:51 2004 UTC
# Line 51  Lisp_Object Vdoc_file_name; Line 51  Lisp_Object Vdoc_file_name;
51    
52  Lisp_Object Qfunction_documentation;  Lisp_Object Qfunction_documentation;
53    
54    /* A list of files used to build this Emacs binary.  */
55    static Lisp_Object Vbuild_files;
56    
57  extern Lisp_Object Voverriding_local_map;  extern Lisp_Object Voverriding_local_map;
58    
59  /* For VMS versions with limited file name syntax,  /* For VMS versions with limited file name syntax,
# Line 581  the same file name is found in the `doc- Line 584  the same file name is found in the `doc-
584    register char *p, *end;    register char *p, *end;
585    Lisp_Object sym;    Lisp_Object sym;
586    char *name;    char *name;
587      int skip_file = 0;
588    
589    CHECK_STRING (filename);    CHECK_STRING (filename);
590    
# Line 618  the same file name is found in the `doc- Line 622  the same file name is found in the `doc-
622  #endif /* VMS4_4 */  #endif /* VMS4_4 */
623  #endif /* VMS */  #endif /* VMS */
624    
625      /* Vbuild_files is nil when temacs is run, and non-nil after that.  */
626      if (NILP (Vbuild_files))
627      {
628        size_t cp_size = 0;
629        size_t to_read;
630        int nr_read;
631        char *cp = NULL;
632        char *beg, *end;
633    
634        fd = emacs_open ("buildobj.lst", O_RDONLY, 0);
635        if (fd < 0)
636          report_file_error ("Opening file buildobj.lst", Qnil);
637    
638        filled = 0;
639        for (;;)
640          {
641            cp_size += 1024;
642            to_read = cp_size - 1 - filled;
643            cp = xrealloc (cp, cp_size);
644            nr_read = emacs_read (fd, &cp[filled], to_read);
645            filled += nr_read;
646            if (nr_read < to_read)
647              break;
648          }
649    
650        emacs_close (fd);
651        cp[filled] = 0;
652    
653        for (beg = cp; *beg; beg = end)
654          {
655            int len;
656    
657            while (*beg && isspace (*beg)) ++beg;
658    
659            for (end = beg; *end && ! isspace (*end); ++end)
660              if (*end == '/') beg = end+1;  /* skip directory part  */
661    
662            len = end - beg;
663            if (len > 4 && end[-4] == '.' && end[-3] == 'o')
664              len -= 2;  /* Just take .o if it ends in .obj  */
665    
666            if (len > 0)
667              Vbuild_files = Fcons (make_string (beg, len), Vbuild_files);
668          }
669    
670        xfree (cp);
671      }
672    
673    fd = emacs_open (name, O_RDONLY, 0);    fd = emacs_open (name, O_RDONLY, 0);
674    if (fd < 0)    if (fd < 0)
675      report_file_error ("Opening doc string file",      report_file_error ("Opening doc string file",
# Line 640  the same file name is found in the `doc- Line 692  the same file name is found in the `doc-
692        if (p != end)        if (p != end)
693          {          {
694            end = (char *) index (p, '\n');            end = (char *) index (p, '\n');
695    
696              /* See if this is a file name, and if it is a file in build-files.  */
697              if (p[1] == 'S' && end - p > 4 && end[-2] == '.'
698                  && (end[-1] == 'o' || end[-1] == 'c'))
699                {
700                  int len = end - p - 2;
701                  char *fromfile = alloca (len + 1);
702                  strncpy (fromfile, &p[2], len);
703                  fromfile[len] = 0;
704                  if (fromfile[len-1] == 'c')
705                    fromfile[len-1] = 'o';
706    
707                  if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil))
708                    skip_file = 1;
709                  else
710                    skip_file = 0;
711                }
712    
713            sym = oblookup (Vobarray, p + 2,            sym = oblookup (Vobarray, p + 2,
714                            multibyte_chars_in_text (p + 2, end - p - 2),                            multibyte_chars_in_text (p + 2, end - p - 2),
715                            end - p - 2);                            end - p - 2);
716            if (SYMBOLP (sym))            if (! skip_file && SYMBOLP (sym))
717              {              {
718                /* Attach a docstring to a variable?  */                /* Attach a docstring to a variable?  */
719                if (p[1] == 'V')                if (p[1] == 'V')
# Line 919  syms_of_doc () Line 989  syms_of_doc ()
989                 doc: /* Name of file containing documentation strings of built-in symbols.  */);                 doc: /* Name of file containing documentation strings of built-in symbols.  */);
990    Vdoc_file_name = Qnil;    Vdoc_file_name = Qnil;
991    
992      DEFVAR_LISP ("build-files", &Vbuild_files,
993                   doc: /* A list of files used to build this Emacs binary.  */);
994      Vbuild_files = Qnil;
995    
996    defsubr (&Sdocumentation);    defsubr (&Sdocumentation);
997    defsubr (&Sdocumentation_property);    defsubr (&Sdocumentation_property);
998    defsubr (&Ssnarf_documentation);    defsubr (&Ssnarf_documentation);

Legend:
Removed from v.1.108  
changed lines
  Added in v.1.109

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