GNU bug report logs - #24221
25.1.50; binding anonymous functions to keys cause help buffer navigation errors

Previous Next

Package: emacs;

Reported by: Zachary Kanfer <zkanfer <at> gmail.com>

Date: Sun, 14 Aug 2016 01:01:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.1.50

Fixed in version 25.2

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: peder <at> klingenberg.no, Zachary Kanfer <zkanfer <at> gmail.com>
Cc: 24221 <at> debbugs.gnu.org
Subject: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors
Date: Sat, 17 Sep 2016 11:28:47 -0700 (PDT)
I suggest using code such as that below - allow FUNCTION to be
`functionp', not only a symbol that is `fboundp' (and test for
the former first).

Also, the function that raises an error should be `user-error'
only when called interactively.  Otherwise, it should be `error'.

[I would even argue that for interactive use it should be
`message', not `user-error', as that allows `describe-function'
to be used, e.g., in the minibuffer to get help on different
function-name candidates.]

(let* ((interactivep  (called-interactively-p 'interactive))
       (err-fn        (if interactivep #user-error #'error)))
  (if (and interactivep  (not function))
      (funcall err-fn "You did not specify a function symbol")
    (if (not (or (functionp function) ; Allow anonymous functions.
                 (and function   ; Allow macros and special forms.
                      (fboundp (intern-soft function))))))
        (funcall err-fn "Not a defined function: `%S'" function)
    (help-setup-xref ...)
    ...)




This bug report was last modified 8 years and 270 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.