+2002-04-02 Stefan Monnier <monnier@cs.yale.edu>
+
+ * doc.c (reread_doc_file): Return whether reload was attempted.
+ (Fdocumentation, Fdocumentation_property): Don't try to reload
+ if the doc is 0 and only ask once.
+
+ * Makefile.in (lisp, shortlisp): Add ucs-tables.elc.
+
2002-04-02 Eli Zaretskii <eliz@is.elta.co.il>
* keyboard.c (read_char): If the event was Qselect_window,
restore timer_idleness_start_time to its previous value.
- * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when
- required.
+ * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when required.
2002-04-01 Stefan Monnier <monnier@cs.yale.edu>
* marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
Use BEG and BEG_BYTE.
- * doc.c (get_doc_string): Return nil of the location is wrong.
+ * doc.c (get_doc_string): Return nil if the location is wrong.
(reread_doc_file): New fun.
(Fdocumentation, Fdocumentation_property):
Call it if get_doc_string fails.
return get_doc_string (filepos, 0, 1);
}
-static void
+static int
reread_doc_file (file)
{
Lisp_Object reply, prompt[3];
reply = Fy_or_n_p (Fconcat (3, prompt));
UNGCPRO;
if (NILP (reply))
- error ("Aborted");
+ 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,
Lisp_Object fun;
Lisp_Object funcar;
Lisp_Object tem, doc;
+ int try_reload = 1;
+
+ documentation:
doc = Qnil;
Fsignal (Qinvalid_function, Fcons (fun, Qnil));
}
- if (INTEGERP (doc) || CONSP (doc))
+ /* 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))
+ if (NILP (tem) && try_reload)
{
/* The file is newer, we need to reset the pointers. */
struct gcpro gcpro1, gcpro2;
GCPRO2 (function, raw);
- reread_doc_file (Fcar_safe (doc));
+ try_reload = reread_doc_file (Fcar_safe (doc));
UNGCPRO;
- return Fdocumentation (function, raw);
+ if (try_reload)
+ {
+ try_reload = 0;
+ goto documentation;
+ }
}
else
doc = tem;
(symbol, prop, raw)
Lisp_Object symbol, prop, raw;
{
+ int try_reload = 1;
Lisp_Object tem;
+ documentation_property:
+
tem = Fget (symbol, prop);
- if (INTEGERP (tem) || (CONSP (tem) && INTEGERP (XCDR (tem))))
+ 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))
+ if (NILP (tem) && try_reload)
{
/* 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));
+ try_reload = reread_doc_file (Fcar_safe (doc));
UNGCPRO;
- return Fdocumentation_property (symbol, prop, raw);
+ if (try_reload)
+ {
+ try_reload = 0;
+ goto documentation_property;
+ }
}
}
else if (!STRINGP (tem))