X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/0df098bfd1954e61f908671071f7e715a5963d62..2bfa3d3e1fb347ba76bddf77f3e288049635821d:/src/doc.c diff --git a/src/doc.c b/src/doc.c index b6a4cd0a27..2eaaffabec 100644 --- a/src/doc.c +++ b/src/doc.c @@ -84,7 +84,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) int offset; EMACS_INT position; Lisp_Object file, tem, pos; - ptrdiff_t count; USE_SAFE_ALLOCA; if (INTEGERP (filepos)) @@ -150,7 +149,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) file, build_string ("\"\n")); } } - count = SPECPDL_INDEX (); + dynwind_begin (); record_unwind_protect_int (close_file_unwind, fd); /* Seek only to beginning of disk block. */ @@ -206,7 +205,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) } p += nread; } - unbind_to (count, Qnil); + dynwind_end (); SAFE_FREE (); /* Sanity checking. */ @@ -595,7 +594,7 @@ the same file name is found in the `doc-directory'. */) { #include "buildobj.h" }; - int i = sizeof buildobj / sizeof *buildobj; + int i = ARRAYELTS (buildobj); while (0 <= --i) Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files); Vbuild_files = Fpurecopy (Vbuild_files); @@ -608,7 +607,7 @@ the same file name is found in the `doc-directory'. */) report_file_errno ("Opening doc string file", build_string (name), open_errno); } - count = SPECPDL_INDEX (); + dynwind_begin (); record_unwind_protect_int (close_file_unwind, fd); Vdoc_file_name = filename; filled = 0; @@ -688,7 +687,8 @@ the same file name is found in the `doc-directory'. */) filled -= end - buf; memmove (buf, end, filled); } - return unbind_to (count, Qnil); + dynwind_end (); + return Qnil; } DEFUN ("substitute-command-keys", Fsubstitute_command_keys, @@ -747,7 +747,7 @@ Otherwise, return a new string. */) keymap = Voverriding_local_map; bsize = SBYTES (string); - bufp = buf = xmalloc (bsize); + bufp = buf = xmalloc_atomic (bsize); strp = SDATA (string); while (strp < SDATA (string) + SBYTES (string)) @@ -951,12 +951,14 @@ Otherwise, return a new string. */) else tem = string; xfree (buf); - RETURN_UNGCPRO (tem); + return tem; } void syms_of_doc (void) { +#include "doc.x" + DEFSYM (Qfunction_documentation, "function-documentation"); DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name, @@ -966,9 +968,4 @@ syms_of_doc (void) DEFVAR_LISP ("build-files", Vbuild_files, doc: /* A list of files used to build this Emacs binary. */); Vbuild_files = Qnil; - - defsubr (&Sdocumentation); - defsubr (&Sdocumentation_property); - defsubr (&Ssnarf_documentation); - defsubr (&Ssubstitute_command_keys); }