[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/doc.c
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/src/doc.c |
Date: |
Tue, 02 Apr 2002 16:58:40 -0500 |
Index: emacs/src/doc.c
diff -c emacs/src/doc.c:1.91 emacs/src/doc.c:1.92
*** emacs/src/doc.c:1.91 Mon Apr 1 18:04:46 2002
--- emacs/src/doc.c Tue Apr 2 16:58:39 2002
***************
*** 335,341 ****
return get_doc_string (filepos, 0, 1);
}
! static void
reread_doc_file (file)
{
Lisp_Object reply, prompt[3];
--- 335,341 ----
return get_doc_string (filepos, 0, 1);
}
! static int
reread_doc_file (file)
{
Lisp_Object reply, prompt[3];
***************
*** 347,358 ****
reply = Fy_or_n_p (Fconcat (3, prompt));
UNGCPRO;
if (NILP (reply))
! error ("Aborted");
if (NILP (file))
Fsnarf_documentation (Vdoc_file_name);
else
Fload (file, Qt, Qt, Qt, Qnil);
}
DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0,
--- 347,360 ----
reply = Fy_or_n_p (Fconcat (3, prompt));
UNGCPRO;
if (NILP (reply))
! return 0;
if (NILP (file))
Fsnarf_documentation (Vdoc_file_name);
else
Fload (file, Qt, Qt, Qt, Qnil);
+
+ return 1;
}
DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0,
***************
*** 365,370 ****
--- 367,375 ----
Lisp_Object fun;
Lisp_Object funcar;
Lisp_Object tem, doc;
+ int try_reload = 1;
+
+ documentation:
doc = Qnil;
***************
*** 433,450 ****
Fsignal (Qinvalid_function, Fcons (fun, Qnil));
}
! if (INTEGERP (doc) || CONSP (doc))
{
Lisp_Object tem;
tem = get_doc_string (doc, 0, 0);
! if (NILP (tem))
{
/* The file is newer, we need to reset the pointers. */
struct gcpro gcpro1, gcpro2;
GCPRO2 (function, raw);
! reread_doc_file (Fcar_safe (doc));
UNGCPRO;
! return Fdocumentation (function, raw);
}
else
doc = tem;
--- 438,461 ----
Fsignal (Qinvalid_function, Fcons (fun, Qnil));
}
! /* If DOC is 0, it's typically because of a dumped file missing
! from the DOC file (bug in src/Makefile.in). */
! if (INTEGERP (doc) && !EQ (tem, make_number (0)) || CONSP (doc))
{
Lisp_Object tem;
tem = get_doc_string (doc, 0, 0);
! if (NILP (tem) && try_reload)
{
/* The file is newer, we need to reset the pointers. */
struct gcpro gcpro1, gcpro2;
GCPRO2 (function, raw);
! try_reload = reread_doc_file (Fcar_safe (doc));
UNGCPRO;
! if (try_reload)
! {
! try_reload = 0;
! goto documentation;
! }
}
else
doc = tem;
***************
*** 467,487 ****
(symbol, prop, raw)
Lisp_Object symbol, prop, raw;
{
Lisp_Object tem;
tem = Fget (symbol, prop);
! if (INTEGERP (tem) || (CONSP (tem) && INTEGERP (XCDR (tem))))
{
Lisp_Object doc = tem;
tem = get_doc_string (tem, 0, 0);
! if (NILP (tem))
{
/* The file is newer, we need to reset the pointers. */
struct gcpro gcpro1, gcpro2, gcpro3;
GCPRO3 (symbol, prop, raw);
! reread_doc_file (Fcar_safe (doc));
UNGCPRO;
! return Fdocumentation_property (symbol, prop, raw);
}
}
else if (!STRINGP (tem))
--- 478,506 ----
(symbol, prop, raw)
Lisp_Object symbol, prop, raw;
{
+ int try_reload = 1;
Lisp_Object tem;
+ documentation_property:
+
tem = Fget (symbol, prop);
! if (INTEGERP (tem) && !EQ (tem, make_number (0))
! || (CONSP (tem) && INTEGERP (XCDR (tem))))
{
Lisp_Object doc = tem;
tem = get_doc_string (tem, 0, 0);
! if (NILP (tem) && try_reload)
{
/* The file is newer, we need to reset the pointers. */
struct gcpro gcpro1, gcpro2, gcpro3;
GCPRO3 (symbol, prop, raw);
! try_reload = reread_doc_file (Fcar_safe (doc));
UNGCPRO;
! if (try_reload)
! {
! try_reload = 0;
! goto documentation_property;
! }
}
}
else if (!STRINGP (tem))