From 34328c639ed7aad371a3f57209acad2a5bb66401 Mon Sep 17 00:00:00 2001 From: Sau P Date: Wed, 28 Aug 2024 10:28:16 +0100 Subject: 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. --- helpful.el | 4 ++-- 1 file 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." -- cgit v1.0