diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2021-12-10 23:03:15 -0800 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2021-12-10 23:03:15 -0800 |
| commit | 2afbde902742b1aa64daa31a635ba564f14b35ae (patch) | |
| tree | f22d5ae7c223729213f030d36eedd59f8da93a60 | |
| parent | dd806b8f04bcaca725a481b0b4a9bda384e570a6 (diff) | |
Use lexical-binding in tests and fix crash exposed0.19
argdesc in byte-code function objects may be an integer rather than a
list, so handle that case gracefully.
| -rw-r--r-- | helpful.el | 9 | ||||
| -rw-r--r-- | test/helpful-unit-test.el | 2 |
2 files changed, 10 insertions, 1 deletions
@@ -2470,7 +2470,14 @@ For example, \"(some-func FOO &optional BAR)\"." ((symbolp sym) (help-function-arglist sym)) ((byte-code-function-p sym) - (aref sym 0)) + ;; argdesc can be a list of arguments or an integer + ;; encoding the min/max number of arguments. See + ;; Byte-Code Function Objects in the elisp manual. + (let ((argdesc (aref sym 0))) + (if (consp argdesc) + argdesc + ;; TODO: properly handle argdesc values. + nil))) (t ;; Interpreted function (lambda ...) (cadr sym)))) diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el index 4e87efe..a07aa8e 100644 --- a/test/helpful-unit-test.el +++ b/test/helpful-unit-test.el @@ -1,3 +1,5 @@ +;;; helpful-unit-test.el -*- lexical-binding: t; -*- + (require 'ert) (require 'edebug) (require 'helpful) |
