all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hong Xu <hong@topbug.net>
To: Drew Adams <drew.adams@oracle.com>, 30958@debbugs.gnu.org
Subject: bug#30958: 26.0.91; No documentation for key and value in the function passed to `map-keymap'
Date: Tue, 27 Mar 2018 01:07:33 -0700	[thread overview]
Message-ID: <dabc36a6-255f-1b7f-fedd-f07e6ac11d31@topbug.net> (raw)
In-Reply-To: <b9a10185-80ab-4396-9d0f-70d16ecb6317@default>


[-- Attachment #1.1: Type: text/plain, Size: 2306 bytes --]

On 03/26/2018 09:15 PM, Drew Adams wrote:
>> A callback function should be passed to `map-keymap'. However,
>> the description of the callback function seems to be missing
>> (undocumented). For example, the value does not seems to always be a
>> function. It is sometimes an alist, sometimes a more complicated list.
>>
>> I think this might have never been documented. If it is documented, it
>> would be greatly appreciated if a pointer to the actual documentation
>> can be added to the document of `map-keymap'.
> 
> (If this report is clear to others then don't worry about it,
> but it's not clear to me.)
> 
> I wouldn't call the FUNCTION arg a "callback" function, but
> it's the only function that is passed, AFAIK, so I guess
> that's the one you mean.
> 
> What makes you think it doesn't always need to be a function?
> Grepping the Emacs Lisp files, I don't see any cases where it
> is not a function (or where the KEYMAP arg is a function).
> 
> FUNCTION is described pretty well in the doc, I think - the
> args it is passed are described.
> 
> If you instead meant the KEYMAP arg (whose value is not a
> function, AFAIK), then there is a whole section of the Elisp
> manual devoted do describing that, including the various
> forms a keymap can take (e.g. particular kinds of alists).
> 
> See https://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps.html
> and its child nodes.
> 
> (I'm probably missing something that you meant.  If so,
> please ignore.)
> 

Thanks for your reply and sorry for the confusion -- I wrote those in a
hurry.

What is confusing in the current document, IMO, is the VALUE arg of the
FUNCTION arg of `map-keymap'. The document reads:

"It passes two arguments, the event type and the value of the binding."

However, I searched the document, and could not find any useful
information regarding the value of the binding. According to my own
experiments, in most cases, it is a function, but sometimes it is an
alist, or keymap, or of other types. I guess this may be obvious to many
of you and may be documented somewhere, but a link to those is somehow
missing; or it may be completely undocumented. I would appreciate it if
the value of the binding is well documented (or a link to it is added).


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-03-27  8:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25 21:44 bug#30958: 26.0.91; No documentation for key and value in the function passed to `map-keymap' Hong Xu
2018-03-27  4:15 ` Drew Adams
2018-03-27  8:07   ` Hong Xu [this message]
2018-03-27  9:35     ` Andreas Schwab
2018-03-27 14:27       ` Drew Adams
2018-03-27 17:39         ` Hong Xu
2021-10-23 18:03           ` Stefan Kangas
2021-10-23 19:03             ` bug#30958: [External] : " Drew Adams
2021-10-24  6:26               ` Stefan Kangas

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

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

  git send-email \
    --in-reply-to=dabc36a6-255f-1b7f-fedd-f07e6ac11d31@topbug.net \
    --to=hong@topbug.net \
    --cc=30958@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.