aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorStefan Monnier2011-02-01 12:09:25 -0500
committerStefan Monnier2011-02-01 12:09:25 -0500
commit8f1d2ef658f95549eb33fe5265f8f11c5129bece (patch)
treeb7cd852a1adb423384532cfe22c31547160b22bc /src/doc.c
parent590130fb19e1f433965c421d98fedeb2d7c33310 (diff)
parent1dc4075fa8809805aed5092e93e225e889725c94 (diff)
downloademacs-8f1d2ef658f95549eb33fe5265f8f11c5129bece.tar.gz
emacs-8f1d2ef658f95549eb33fe5265f8f11c5129bece.zip
Merge from trunk
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/doc.c b/src/doc.c
index 8ae152dca9a..f9f67c03863 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,6 +1,5 @@
1/* Record indices of function doc strings stored in a file. 1/* Record indices of function doc strings stored in a file.
2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2 Copyright (C) 1985-1986, 1993-1995, 1997-2011
3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
5 4
6This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -26,10 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <ctype.h> 25#include <ctype.h>
27#include <setjmp.h> 26#include <setjmp.h>
28#include <fcntl.h> 27#include <fcntl.h>
29
30#ifdef HAVE_UNISTD_H
31#include <unistd.h> 28#include <unistd.h>
32#endif
33 29
34#include "lisp.h" 30#include "lisp.h"
35#include "buffer.h" 31#include "buffer.h"
@@ -38,13 +34,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include "keymap.h" 34#include "keymap.h"
39#include "buildobj.h" 35#include "buildobj.h"
40 36
41Lisp_Object Vdoc_file_name;
42
43Lisp_Object Qfunction_documentation; 37Lisp_Object Qfunction_documentation;
44 38
45/* A list of files used to build this Emacs binary. */
46static Lisp_Object Vbuild_files;
47
48extern Lisp_Object Qclosure; 39extern Lisp_Object Qclosure;
49/* Buffer used for reading from documentation file. */ 40/* Buffer used for reading from documentation file. */
50static char *get_doc_string_buffer; 41static char *get_doc_string_buffer;
@@ -130,12 +121,12 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
130 if (minsize < 8) 121 if (minsize < 8)
131 minsize = 8; 122 minsize = 8;
132 name = (char *) alloca (minsize + SCHARS (file) + 8); 123 name = (char *) alloca (minsize + SCHARS (file) + 8);
133 strcpy (name, SDATA (Vdoc_directory)); 124 strcpy (name, SSDATA (Vdoc_directory));
134 strcat (name, SDATA (file)); 125 strcat (name, SSDATA (file));
135 } 126 }
136 else 127 else
137 { 128 {
138 name = (char *) SDATA (file); 129 name = SSDATA (file);
139 } 130 }
140 131
141 fd = emacs_open (name, O_RDONLY, 0); 132 fd = emacs_open (name, O_RDONLY, 0);
@@ -147,7 +138,7 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
147 /* Preparing to dump; DOC file is probably not installed. 138 /* Preparing to dump; DOC file is probably not installed.
148 So check in ../etc. */ 139 So check in ../etc. */
149 strcpy (name, "../etc/"); 140 strcpy (name, "../etc/");
150 strcat (name, SDATA (file)); 141 strcat (name, SSDATA (file));
151 142
152 fd = emacs_open (name, O_RDONLY, 0); 143 fd = emacs_open (name, O_RDONLY, 0);
153 } 144 }
@@ -578,9 +569,9 @@ the same file name is found in the `doc-directory'. */)
578 CHECK_STRING (Vdoc_directory); 569 CHECK_STRING (Vdoc_directory);
579 name = (char *) alloca (SCHARS (filename) 570 name = (char *) alloca (SCHARS (filename)
580 + SCHARS (Vdoc_directory) + 1); 571 + SCHARS (Vdoc_directory) + 1);
581 strcpy (name, SDATA (Vdoc_directory)); 572 strcpy (name, SSDATA (Vdoc_directory));
582 } 573 }
583 strcat (name, SDATA (filename)); /*** Add this line ***/ 574 strcat (name, SSDATA (filename)); /*** Add this line ***/
584 575
585 /* Vbuild_files is nil when temacs is run, and non-nil after that. */ 576 /* Vbuild_files is nil when temacs is run, and non-nil after that. */
586 if (NILP (Vbuild_files)) 577 if (NILP (Vbuild_files))
@@ -909,7 +900,7 @@ a new string, without any text properties, is returned. */)
909 bufp += length_byte; 900 bufp += length_byte;
910 nchars += length; 901 nchars += length;
911 /* Check STRING again in case gc relocated it. */ 902 /* Check STRING again in case gc relocated it. */
912 strp = (unsigned char *) SDATA (string) + idx; 903 strp = SDATA (string) + idx;
913 } 904 }
914 } 905 }
915 else if (! multibyte) /* just copy other chars */ 906 else if (! multibyte) /* just copy other chars */
@@ -943,11 +934,11 @@ syms_of_doc (void)
943 Qfunction_documentation = intern_c_string ("function-documentation"); 934 Qfunction_documentation = intern_c_string ("function-documentation");
944 staticpro (&Qfunction_documentation); 935 staticpro (&Qfunction_documentation);
945 936
946 DEFVAR_LISP ("internal-doc-file-name", &Vdoc_file_name, 937 DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name,
947 doc: /* Name of file containing documentation strings of built-in symbols. */); 938 doc: /* Name of file containing documentation strings of built-in symbols. */);
948 Vdoc_file_name = Qnil; 939 Vdoc_file_name = Qnil;
949 940
950 DEFVAR_LISP ("build-files", &Vbuild_files, 941 DEFVAR_LISP ("build-files", Vbuild_files,
951 doc: /* A list of files used to build this Emacs binary. */); 942 doc: /* A list of files used to build this Emacs binary. */);
952 Vbuild_files = Qnil; 943 Vbuild_files = Qnil;
953 944
@@ -956,6 +947,3 @@ syms_of_doc (void)
956 defsubr (&Ssnarf_documentation); 947 defsubr (&Ssnarf_documentation);
957 defsubr (&Ssubstitute_command_keys); 948 defsubr (&Ssubstitute_command_keys);
958} 949}
959
960/* arch-tag: 56281d4d-6949-43e2-be2e-f6517de744ba
961 (do not change this comment) */