]> git.eshelyaron.com Git - emacs.git/commitdiff
Support loading dynamic docstrings from Emacs <29
authorStefan Kangas <stefankangas@gmail.com>
Thu, 23 Jan 2025 23:44:21 +0000 (00:44 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 25 Jan 2025 17:43:33 +0000 (18:43 +0100)
* 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

index 0ce1274fe12ccad7e56823c5b0cdf1472a556a12..6f4ce79f1f139d436609629edd9070789eb6643c 100644 (file)
--- 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;