From: Stefan Kangas Date: Thu, 23 Jan 2025 23:44:21 +0000 (+0100) Subject: Support loading dynamic docstrings from Emacs <29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f7fe74c5608934763f4dd799e2d10c4779ecbd10;p=emacs.git 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) --- 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;