unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: peder@klingenberg.no, Zachary Kanfer <zkanfer@gmail.com>
Cc: 24221@debbugs.gnu.org
Subject: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors
Date: Fri, 16 Sep 2016 10:43:46 -0700 (PDT)	[thread overview]
Message-ID: <cbf5bf33-74c4-4ab1-8a9b-bb4ce4f554a8@default> (raw)
In-Reply-To: <95980cc0-0429-449a-8e98-e629b2e885b8@default>

This is the problem behind this regression:

1. `describe-key' calls `describe-function', passing it the
   command definition.

2. Someone changed `describe-function' so that it now barfs
   if its arg is not a function symbol.

The doc string of `describe-function' says (and has long
said) that the arg is a symbol.  However, that should be
the case only for interactive use (the `completing-read'
call requires a match against a function symbol).

What should be done:

1. Remove the error for a non-symbol, except perhaps for the
interactive case.

2. Fix the doc, to say that it need not be a symbol when
called from Lisp.

Before the regression was introduced, both `describe-function'
and using `[back]' to get to it worked for a lambda form.

And a doc string in the lambda form was shown correctly as
the doc, in *Help* - just as if the function had a name.

And a byte-compiled lambda form also worked perfectly well
prior to the introduction of the regression:

(global-set-key
  (kbd "C-c l")
  (byte-compile
    (lambda () "DOC" (interactive) (message "FOO"))))

This regression removed a bunch of useful behavior.

`describe-function' should describe a function - any
function.  The argument should be limited to a function
symbol only when called interactively.

(An argument could even be made that it should not even
be so limited for interactive use, that is, that
`completing-read' should be lax, letting you type a
lambda form if you want.  I'm not making that argument
here, however.)





  reply	other threads:[~2016-09-16 17:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-14  0:59 bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors Zachary Kanfer
2016-08-28 20:07 ` Peder O. Klingenberg
2016-08-28 21:56   ` Drew Adams
2016-09-16 17:43     ` Drew Adams [this message]
2016-09-17 18:28       ` Drew Adams
2016-10-03 23:33       ` npostavs
2016-10-22  2:48         ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbf5bf33-74c4-4ab1-8a9b-bb4ce4f554a8@default \
    --to=drew.adams@oracle.com \
    --cc=24221@debbugs.gnu.org \
    --cc=peder@klingenberg.no \
    --cc=zkanfer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).