commit 34328c639ed7aad371a3f57209acad2a5bb66401
parent 4ba24cac9fb14d5fdc32582cd947572040e82b2c
Author: Sau P <sau@yaaama.xyz>
Date: Wed, 28 Aug 2024 10:28:16 +0100
handle `package-version` safely to prevent `listp` error
When `package-version' is not what we expect (e.g a simple string), a `listp`
error is thrown and you are unable to view the variable documentation due to it.
This now handles it and provides a fallback value.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/helpful.el b/helpful.el
@@ -1317,8 +1317,8 @@ Return nil otherwise."
(package-version
(format
"This variable was added, or its default value changed, in %s version %s."
- (car package-version)
- (cdr package-version)))
+ (or (car-safe package-version) "unknown")
+ (or (cdr-safe package-version) "unknown")))
(emacs-version
(format
"This variable was added, or its default value changed, in Emacs %s."