aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/doc.c39
2 files changed, 39 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 061dc2cb591..d8ae770d63e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,10 +1,17 @@
12002-04-02 Stefan Monnier <monnier@cs.yale.edu>
2
3 * doc.c (reread_doc_file): Return whether reload was attempted.
4 (Fdocumentation, Fdocumentation_property): Don't try to reload
5 if the doc is 0 and only ask once.
6
7 * Makefile.in (lisp, shortlisp): Add ucs-tables.elc.
8
12002-04-02 Eli Zaretskii <eliz@is.elta.co.il> 92002-04-02 Eli Zaretskii <eliz@is.elta.co.il>
2 10
3 * keyboard.c (read_char): If the event was Qselect_window, 11 * keyboard.c (read_char): If the event was Qselect_window,
4 restore timer_idleness_start_time to its previous value. 12 restore timer_idleness_start_time to its previous value.
5 13
6 * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when 14 * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when required.
7 required.
8 15
92002-04-01 Stefan Monnier <monnier@cs.yale.edu> 162002-04-01 Stefan Monnier <monnier@cs.yale.edu>
10 17
@@ -13,7 +20,7 @@
13 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): 20 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
14 Use BEG and BEG_BYTE. 21 Use BEG and BEG_BYTE.
15 22
16 * doc.c (get_doc_string): Return nil of the location is wrong. 23 * doc.c (get_doc_string): Return nil if the location is wrong.
17 (reread_doc_file): New fun. 24 (reread_doc_file): New fun.
18 (Fdocumentation, Fdocumentation_property): 25 (Fdocumentation, Fdocumentation_property):
19 Call it if get_doc_string fails. 26 Call it if get_doc_string fails.
diff --git a/src/doc.c b/src/doc.c
index 71a9368d6f2..7ac598e126b 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -335,7 +335,7 @@ read_doc_string (filepos)
335 return get_doc_string (filepos, 0, 1); 335 return get_doc_string (filepos, 0, 1);
336} 336}
337 337
338static void 338static int
339reread_doc_file (file) 339reread_doc_file (file)
340{ 340{
341 Lisp_Object reply, prompt[3]; 341 Lisp_Object reply, prompt[3];
@@ -347,12 +347,14 @@ reread_doc_file (file)
347 reply = Fy_or_n_p (Fconcat (3, prompt)); 347 reply = Fy_or_n_p (Fconcat (3, prompt));
348 UNGCPRO; 348 UNGCPRO;
349 if (NILP (reply)) 349 if (NILP (reply))
350 error ("Aborted"); 350 return 0;
351 351
352 if (NILP (file)) 352 if (NILP (file))
353 Fsnarf_documentation (Vdoc_file_name); 353 Fsnarf_documentation (Vdoc_file_name);
354 else 354 else
355 Fload (file, Qt, Qt, Qt, Qnil); 355 Fload (file, Qt, Qt, Qt, Qnil);
356
357 return 1;
356} 358}
357 359
358DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0, 360DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0,
@@ -365,6 +367,9 @@ string is passed through `substitute-command-keys'. */)
365 Lisp_Object fun; 367 Lisp_Object fun;
366 Lisp_Object funcar; 368 Lisp_Object funcar;
367 Lisp_Object tem, doc; 369 Lisp_Object tem, doc;
370 int try_reload = 1;
371
372 documentation:
368 373
369 doc = Qnil; 374 doc = Qnil;
370 375
@@ -433,18 +438,24 @@ string is passed through `substitute-command-keys'. */)
433 Fsignal (Qinvalid_function, Fcons (fun, Qnil)); 438 Fsignal (Qinvalid_function, Fcons (fun, Qnil));
434 } 439 }
435 440
436 if (INTEGERP (doc) || CONSP (doc)) 441 /* If DOC is 0, it's typically because of a dumped file missing
442 from the DOC file (bug in src/Makefile.in). */
443 if (INTEGERP (doc) && !EQ (tem, make_number (0)) || CONSP (doc))
437 { 444 {
438 Lisp_Object tem; 445 Lisp_Object tem;
439 tem = get_doc_string (doc, 0, 0); 446 tem = get_doc_string (doc, 0, 0);
440 if (NILP (tem)) 447 if (NILP (tem) && try_reload)
441 { 448 {
442 /* The file is newer, we need to reset the pointers. */ 449 /* The file is newer, we need to reset the pointers. */
443 struct gcpro gcpro1, gcpro2; 450 struct gcpro gcpro1, gcpro2;
444 GCPRO2 (function, raw); 451 GCPRO2 (function, raw);
445 reread_doc_file (Fcar_safe (doc)); 452 try_reload = reread_doc_file (Fcar_safe (doc));
446 UNGCPRO; 453 UNGCPRO;
447 return Fdocumentation (function, raw); 454 if (try_reload)
455 {
456 try_reload = 0;
457 goto documentation;
458 }
448 } 459 }
449 else 460 else
450 doc = tem; 461 doc = tem;
@@ -467,21 +478,29 @@ aren't strings. */)
467 (symbol, prop, raw) 478 (symbol, prop, raw)
468 Lisp_Object symbol, prop, raw; 479 Lisp_Object symbol, prop, raw;
469{ 480{
481 int try_reload = 1;
470 Lisp_Object tem; 482 Lisp_Object tem;
471 483
484 documentation_property:
485
472 tem = Fget (symbol, prop); 486 tem = Fget (symbol, prop);
473 if (INTEGERP (tem) || (CONSP (tem) && INTEGERP (XCDR (tem)))) 487 if (INTEGERP (tem) && !EQ (tem, make_number (0))
488 || (CONSP (tem) && INTEGERP (XCDR (tem))))
474 { 489 {
475 Lisp_Object doc = tem; 490 Lisp_Object doc = tem;
476 tem = get_doc_string (tem, 0, 0); 491 tem = get_doc_string (tem, 0, 0);
477 if (NILP (tem)) 492 if (NILP (tem) && try_reload)
478 { 493 {
479 /* The file is newer, we need to reset the pointers. */ 494 /* The file is newer, we need to reset the pointers. */
480 struct gcpro gcpro1, gcpro2, gcpro3; 495 struct gcpro gcpro1, gcpro2, gcpro3;
481 GCPRO3 (symbol, prop, raw); 496 GCPRO3 (symbol, prop, raw);
482 reread_doc_file (Fcar_safe (doc)); 497 try_reload = reread_doc_file (Fcar_safe (doc));
483 UNGCPRO; 498 UNGCPRO;
484 return Fdocumentation_property (symbol, prop, raw); 499 if (try_reload)
500 {
501 try_reload = 0;
502 goto documentation_property;
503 }
485 } 504 }
486 } 505 }
487 else if (!STRINGP (tem)) 506 else if (!STRINGP (tem))