]> code.delx.au - gnu-emacs/blobdiff - src/doc.c
* syntax.c (Fchar_syntax): Minor doc fix (Bug#119).
[gnu-emacs] / src / doc.c
index c307119eaf957561ef63f8a6850fff4e7b271502..71308e6904f48e5a067a08bb9fa601591494d8e9 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, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
-                 2002, 2003, 2004, 2005, 2006, 2007, 2008
+                 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
                  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -22,7 +22,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <config.h>
 
 #include <sys/types.h>
-#include <sys/file.h>  /* Must be after sys/types.h for USG and BSD4_1*/
+#include <sys/file.h>  /* Must be after sys/types.h for USG*/
 #include <ctype.h>
 
 #ifdef HAVE_FCNTL_H
@@ -42,6 +42,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keyboard.h"
 #include "character.h"
 #include "keymap.h"
+#include "buildobj.h"
 
 #ifdef HAVE_INDEX
 extern char *index P_ ((const char *, int));
@@ -58,28 +59,6 @@ extern Lisp_Object Voverriding_local_map;
 
 extern Lisp_Object Qremap;
 
-/* For VMS versions with limited file name syntax,
-   convert the name to something VMS will allow.  */
-static void
-munge_doc_file_name (name)
-     char *name;
-{
-#ifdef VMS
-#ifndef NO_HYPHENS_IN_FILENAMES
-  extern char * sys_translate_unix (char *ufile);
-  strcpy (name, sys_translate_unix (name));
-#else /* NO_HYPHENS_IN_FILENAMES */
-  char *p = name;
-  while (*p)
-    {
-      if (*p == '-')
-       *p = '_';
-      p++;
-    }
-#endif /* NO_HYPHENS_IN_FILENAMES */
-#endif /* VMS */
-}
-
 /* Buffer used for reading from documentation file.  */
 static char *get_doc_string_buffer;
 static int get_doc_string_buffer_size;
@@ -169,7 +148,6 @@ get_doc_string (filepos, unibyte, definition)
       name = (char *) alloca (minsize + SCHARS (file) + 8);
       strcpy (name, SDATA (Vdoc_directory));
       strcat (name, SDATA (file));
-      munge_doc_file_name (name);
     }
   else
     {
@@ -186,7 +164,6 @@ get_doc_string (filepos, unibyte, definition)
             So check in ../etc. */
          strcpy (name, "../etc/");
          strcat (name, SDATA (file));
-         munge_doc_file_name (name);
 
          fd = emacs_open (name, O_RDONLY, 0);
        }
@@ -576,6 +553,7 @@ store_function_docstring (fun, offset)
     }
 }
 
+static const char buildobj[] = BUILDOBJ;
 
 DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation,
        1, 1, 0,
@@ -618,37 +596,13 @@ the same file name is found in the `doc-directory'.  */)
       strcpy (name, SDATA (Vdoc_directory));
     }
   strcat (name, SDATA (filename));     /*** Add this line ***/
-  munge_doc_file_name (name);
 
   /* Vbuild_files is nil when temacs is run, and non-nil after that.  */
   if (NILP (Vbuild_files))
   {
-    size_t cp_size = 0;
-    size_t to_read;
-    int nr_read;
-    char *cp = NULL;
-    char *beg, *end;
-
-    fd = emacs_open ("buildobj.lst", O_RDONLY, 0);
-    if (fd < 0)
-      report_file_error ("Opening file buildobj.lst", Qnil);
-
-    filled = 0;
-    for (;;)
-      {
-        cp_size += 1024;
-        to_read = cp_size - 1 - filled;
-        cp = xrealloc (cp, cp_size);
-        nr_read = emacs_read (fd, &cp[filled], to_read);
-        filled += nr_read;
-        if (nr_read < to_read)
-          break;
-      }
+    const char *beg, *end;
 
-    emacs_close (fd);
-    cp[filled] = 0;
-
-    for (beg = cp; *beg; beg = end)
+    for (beg = buildobj; *beg; beg = end)
       {
         int len;
 
@@ -664,8 +618,6 @@ the same file name is found in the `doc-directory'.  */)
         if (len > 0)
           Vbuild_files = Fcons (make_string (beg, len), Vbuild_files);
       }
-
-    xfree (cp);
   }
 
   fd = emacs_open (name, O_RDONLY, 0);
@@ -850,10 +802,7 @@ a new string, without any text properties, is returned.  */)
          name = Fintern (make_string (start, length_byte), Qnil);
 
        do_remap:
-         /* Ignore remappings unless there are no ordinary bindings. */
-         tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt);
-         if (NILP (tem))
-           tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
+         tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
 
          if (VECTORP (tem) && XVECTOR (tem)->size > 1
              && EQ (AREF (tem, 0), Qremap) && SYMBOLP (AREF (tem, 1))