unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Have `define-key` return the keymap
@ 2017-05-13  8:19 Tianxiang Xiong
  2017-05-13  8:32 ` Andreas Schwab
  2017-05-13 12:21 ` Michael Heerdegen
  0 siblings, 2 replies; 7+ messages in thread
From: Tianxiang Xiong @ 2017-05-13  8:19 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Would there be any issues with / objections to having `define-key` return
the keymap it adds a key to? It currently returns `nil`, making it a
statement (bleh!) rather than a function.

If `define-key` returned the keymap, calls to it could be chained together
in convenient ways, e.g.

```
(thread-first (make-sparse-keymap)
  (define-key (kbd "a") #'foo)
  (define-key (kbd "b") #'bar))
```

[-- Attachment #2: Type: text/html, Size: 574 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-13 15:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-13  8:19 Have `define-key` return the keymap Tianxiang Xiong
2017-05-13  8:32 ` Andreas Schwab
2017-05-13  9:11   ` Tianxiang Xiong
2017-05-13 12:21 ` Michael Heerdegen
2017-05-13 14:58   ` Drew Adams
2017-05-13 15:12     ` Kaushal Modi
2017-05-13 15:13     ` Stefan Monnier

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).