aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSau P <sau@yaaama.xyz>2024-08-28 10:28:16 +0100
committerWilfred Hughes <me@wilfred.me.uk>2025-01-31 08:45:49 -0800
commit34328c639ed7aad371a3f57209acad2a5bb66401 (patch)
tree3ab7b2a7cdaa74f9c7eabcd5148512630ce4a07b
parent4ba24cac9fb14d5fdc32582cd947572040e82b2c (diff)
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.
-rw-r--r--helpful.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/helpful.el b/helpful.el
index b9ee878..de41012 100644
--- 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."