We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having a error similar to one reported here, but for ordinary (non-byte-complied) closures.
Debugger entered--Lisp error: (wrong-type-argument symbolp (orig-fun . dired-next-line)) symbol-name((orig-fun . dired-next-line)) helpful--format-argument((orig-fun . dired-next-line)) mapcar(helpful--format-argument ((orig-fun . dired-next-line) t)) -map(helpful--format-argument ((orig-fun . dired-next-line) t)) (cond (advertised-args (-map #'helpful--format-argument advertised-args)) ((listp function-args) (-map #'helpful--format-argument function-args)) (t (list function-args))) (let* ((function-args (cond ((symbolp sym) (help-function-arglist sym)) ((byte-code-function-p sym) (aref sym 0)) (t (cadr sym)))) (formatted-args (cond (advertised-args (-map #'helpful--format-argument advertised-args)) ((listp function-args) (-map #'helpful--format-argument function-args)) (t (list function-args))))) (setq source-sig (cond ((not (symbolp sym)) (format "(%s)" (s-join " " formatted-args))) (formatted-args (format "(%s %s)" (helpful--format-symbol sym) (s-join " " formatted-args))) (t (format "(%s)" (helpful--format-symbol sym)))))) (let (docstring-sig source-sig (advertised-args (when (symbolp sym) (gethash (symbol-function sym) advertised-signature-table)))) (let* ((function-args (cond ((symbolp sym) (help-function-arglist sym)) ((byte-code-function-p sym) (aref sym 0)) (t (cadr sym)))) (formatted-args (cond (advertised-args (-map #'helpful--format-argument advertised-args)) ((listp function-args) (-map #'helpful--format-argument function-args)) (t (list function-args))))) (setq source-sig (cond ((not (symbolp sym)) (format "(%s)" (s-join " " formatted-args))) (formatted-args (format "(%s %s)" (helpful--format-symbol sym) (s-join " " formatted-args))) (t (format "(%s)" (helpful--format-symbol sym)))))) (-when-let (docstring (documentation sym)) (-when-let (docstring-with-usage (help-split-fundoc docstring sym)) (setq docstring-sig (car docstring-with-usage)))) (cond (advertised-args source-sig) (docstring-sig) (t source-sig))) helpful--signature((closure ((orig-fun . dired-next-line) t) (&optional arg) "Send a message before calling ORIG-FUN" (interactive "^p") (message "Foo is about to call %S" orig-fun) (call-interactively orig-fun))) helpful-update() helpful-key("\356") funcall-interactively(helpful-key "\356") call-interactively(helpful-key nil nil) command-execute(helpful-key)
Steps to Reproduce Download the attached baz.el.txt to somewhere in your load-path and rename it to baz.el. Then run the following in Emacs:
baz.el
(require 'helpful) (require 'baz) (dired ".") (helpful-key (kbd "M-C"))
Potential Fix I believe I was able to fix the problem with the following code modifications:
helpful--in-manual-p
(assoc-string sym completions))))
(and (stringp sym) (assoc-string sym completions)))))
helpful--format-argument
(let ((arg-str (symbol-name arg)))
(let ((arg-str (symbol-name (if (consp arg) (car arg) arg))))
I can provide this as a pull request if it would be more convenient.
The text was updated successfully, but these errors were encountered:
Fix crash on lambdas with docstrings
55a8ebc
Spotted when debugging #278.
No branches or pull requests
I'm having a error similar to one reported here, but for ordinary (non-byte-complied) closures.
Backtrace
Steps to Reproduce
Download the attached baz.el.txt to somewhere in your load-path and rename it to
baz.el
. Then run the following in Emacs:Potential Fix
I believe I was able to fix the problem with the following code modifications:
helpful--in-manual-p
, change line 1270 from:(assoc-string sym completions))))
to:
(and (stringp sym) (assoc-string sym completions)))))
helpful--format-argument
change line 2439 from(let ((arg-str (symbol-name arg)))
to:
(let ((arg-str (symbol-name (if (consp arg) (car arg) arg))))
I can provide this as a pull request if it would be more convenient.
The text was updated successfully, but these errors were encountered: