aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helpful.el3
-rw-r--r--test/unit-test.el8
2 files changed, 6 insertions, 5 deletions
diff --git a/helpful.el b/helpful.el
index 7b43533..64b719d 100644
--- a/helpful.el
+++ b/helpful.el
@@ -619,7 +619,8 @@ For example, \"(some-func FOO &optional BAR)\"."
"Get the docstring for SYM."
(let (docstring)
(if callable-p
- (-when-let (docstring (documentation sym))
+ (progn
+ (setq docstring (documentation sym))
(-when-let (docstring-with-usage (help-split-fundoc docstring sym))
(setq docstring (cdr docstring-with-usage))
(when docstring
diff --git a/test/unit-test.el b/test/unit-test.el
index 5e453b2..5cdde74 100644
--- a/test/unit-test.el
+++ b/test/unit-test.el
@@ -21,14 +21,14 @@
"Basic docstring fetching."
(should
(equal
- (helpful--docstring #'test-foo)
+ (helpful--docstring #'test-foo t)
"Docstring here.")))
(ert-deftest helpful--docstring-advice ()
"Get the docstring on advised functions."
(should
(equal
- (helpful--docstring #'test-foo-advised)
+ (helpful--docstring #'test-foo-advised t)
"Docstring here too.")))
(defun test-foo-no-docstring ()
@@ -36,7 +36,7 @@
(ert-deftest helpful--no-docstring ()
"We should not crash on a function without a docstring."
- (should (null (helpful--docstring #'test-foo-no-docstring))))
+ (should (null (helpful--docstring #'test-foo-no-docstring t))))
(defun test-foo-usage-docstring ()
"\n\n(fn &rest ARGS)"
@@ -44,7 +44,7 @@
(ert-deftest helpful--usage-docstring ()
"If a function docstring only has usage, do not return it."
- (should (null (helpful--docstring #'test-foo-usage-docstring))))
+ (should (null (helpful--docstring #'test-foo-usage-docstring t))))
(defun test-foo-no-properties ()
nil)