From 9ae11283d401453256758fb1f36711c449597d6a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 23 Jan 2025 18:45:14 +0100 Subject: [PATCH] Simplify Fdocumentation and Fdocumentation_property * src/doc.c (Fdocumentation, Fdocumentation_property): Simplify; reread_doc_file always returns true so just assume that. (reread_doc_file): Change return type to void. (cherry picked from commit 990b0811adefb4b792d36797540e5773791437f9) --- src/doc.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/doc.c b/src/doc.c index 1c5906de9dc..d16d3d5186e 100644 --- a/src/doc.c +++ b/src/doc.c @@ -307,15 +307,13 @@ Invalid data in documentation file -- %c followed by code %03o", } } -static bool +static void reread_doc_file (Lisp_Object file) { if (NILP (file)) Fsnarf_documentation (Vdoc_file_name); else save_match_data_load (file, Qt, Qt, Qt, Qnil); - - return 1; } DEFUN ("documentation-stringp", Fdocumentation_stringp, Sdocumentation_stringp, @@ -341,7 +339,7 @@ string is passed through `substitute-command-keys'. */) Lisp_Object doc; bool try_reload = true; - documentation: + retry: doc = Qnil; @@ -366,20 +364,15 @@ string is passed through `substitute-command-keys'. */) doc = Qnil; if (FIXNUMP (doc) || CONSP (doc)) { - Lisp_Object tem; - tem = get_doc_string (doc, 0); + Lisp_Object tem = get_doc_string (doc, 0); if (NILP (tem) && try_reload) { /* The file is newer, we need to reset the pointers. */ - try_reload = reread_doc_file (Fcar_safe (doc)); - if (try_reload) - { - try_reload = false; - goto documentation; - } + reread_doc_file (Fcar_safe (doc)); + try_reload = false; + goto retry; } - else - doc = tem; + doc = tem; } if (NILP (raw)) @@ -420,7 +413,7 @@ aren't strings. */) bool try_reload = true; Lisp_Object tem; - documentation_property: + retry: tem = Fget (symbol, prop); @@ -446,12 +439,9 @@ aren't strings. */) if (NILP (tem) && try_reload) { /* The file is newer, we need to reset the pointers. */ - try_reload = reread_doc_file (Fcar_safe (doc)); - if (try_reload) - { - try_reload = false; - goto documentation_property; - } + reread_doc_file (Fcar_safe (doc)); + try_reload = false; + goto retry; } } else if (!STRINGP (tem)) -- 2.39.5