From f7fe74c5608934763f4dd799e2d10c4779ecbd10 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 24 Jan 2025 00:44:21 +0100 Subject: [PATCH] Support loading dynamic docstrings from Emacs <29 * src/doc.c (get_doc_string): Take absolute value to be compatible with bytecode from Emacs <29. (cherry picked from commit f14c24dbe7f65786115f8f62a337be45996c38b8) --- src/doc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/doc.c b/src/doc.c index 0ce1274fe12..6f4ce79f1f1 100644 --- a/src/doc.c +++ b/src/doc.c @@ -127,7 +127,10 @@ get_doc_string (Lisp_Object filepos, bool unibyte) else return Qnil; - EMACS_INT position = XFIXNUM (pos); + /* We used to emit negative positions for 'user variables' (whose doc + strings started with an asterisk); take the absolute value for + compatibility with bytecode from Emacs <29. */ + EMACS_INT position = eabs (XFIXNUM (pos)); if (!STRINGP (dir)) return Qnil; -- 2.39.5