commit b10711efe34f179818aed8c6e0b49f953f55a886 parent 4631d00026dbad5a376462ddf76d90354b6f430c Author: Wilfred Hughes <me@wilfred.me.uk> Date: Sun, 2 Apr 2017 13:51:00 +0100 Handle absent properties. Diffstat:
| M | helpful.el | | | 3 | ++- |
| M | test/unit-test.el | | | 10 | ++++++++++ |
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/helpful.el b/helpful.el @@ -123,7 +123,8 @@ state of the current symbol." (or (helpful--docstring helpful--sym) "No docstring.") (helpful--heading "\n\nSymbol Properties\n") - (helpful--format-properties helpful--sym) + (or (helpful--format-properties helpful--sym) + "No properties.") (helpful--heading "\n\nTools\n") (helpful--forget-button) (helpful--heading "\n\nDefinition\n") diff --git a/test/unit-test.el b/test/unit-test.el @@ -46,3 +46,13 @@ "If a function docstring only has usage, do not return it." (should (null (helpful--docstring #'test-foo-usage-docstring)))) +(defun test-foo-no-properties () + nil) + +(ert-deftest helpful--no-symbol-properties () + "Helpful should handle functions without any symbol properties." + ;; Interactively evaluating this file will set edebug properties on + ;; test-foo, so remove all properties. + (setplist #'test-foo-no-properties nil) + + (should (helpful #'test-foo-no-properties)))