1

When using describe-key, the following block from the help+20 package, in the describe-function-1 function:

(help-xref-button 1 #'(lambda (arg)
                      (let ((location
                         (find-function-noselect arg)))
                    (pop-to-buffer (car location))
                    (goto-char (cdr location))))
                function)

Is causing the following error:

help-xref-button: Wrong type argument: symbolp, (lambda (arg) (let ((location (find-function-noselect arg))) (pop-to-buffer (car location)) (goto-char (cdr location))))

I tried pulling the lambda out into its own function:

;;;###autoload
(defun describe-function-1--hyperlink (arg)
    (let ((location
        (find-function-noselect arg)))
  (pop-to-buffer (car location))
  (goto-char (cdr location))))

Modifying the help-xref-button call accordingly:

(help-xref-button 1 #'describe-function-1--hyperlink function)

But am getting the following error:

make-text-button: Unknown button type ‘describe-function-1--hyperlink’

How can I create a new button type, if that's what I really need to do?

  • 2
    IIUC, help+20.el is the version of the help+.el package that is meant for Emacs 20. Are you really running that ancient an Emacs? If not, you should probably delete the help+20.el package and install help+.el. See Emacs Wiki. – NickD Sep 14 '22 at 07:43
  • Ah; that makes much more sense. I didn't quite understand the difference between the two versions, as I thought that help+20 was version 20 and above. I'll report back on whether it works later this afternoon EST! – ShadowRylander Sep 14 '22 at 08:32
  • 1
    No, I believe that help+20.el is for Emacs 20 only. help+.el is for Emacs 22 and later. Not sure what one should use for Emacs 21 (but I hope the question is a cademic: at this point, nobody should be using Emacs 21 IMO). See the Emacs Wiki link in my first comment. – NickD Sep 14 '22 at 08:41
  • No, no, I understand; I usually use the latest master via nix overlays. I was simply confused about versioning! I had initially got the file from the wiki itself! – ShadowRylander Sep 14 '22 at 08:49
  • 1
    What @NickD said. The header of file help+20.el says: "Extensions to `help.el' for Emacs 20" and "Compatibility: GNU Emacs 20.x". – Drew Sep 14 '22 at 15:48
  • And confirmed; thanks for all the help! I'll answer the question myself, then? – ShadowRylander Sep 15 '22 at 00:19
  • 1
    That would be fine AFAIAC. – NickD Sep 16 '22 at 17:13

1 Answers1

0

As mentioned by NickD and Drew in the comments of the question, the issue was my using help+20, which is used only for emacs 20, instead of help+.