Support loading dynamic docstrings from Emacs <29

* src/doc.c (get_doc_string): Take absolute value to be compatible with
bytecode from Emacs <29.
This commit is contained in:
Stefan Kangas 2025-01-24 00:44:21 +01:00
parent c7f6da7a41
commit f14c24dbe7

View file

@ -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;