From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tianxiang Xiong Newsgroups: gmane.emacs.devel Subject: Have `define-key` return the keymap Date: Sat, 13 May 2017 01:19:17 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045f6e506820d4054f637a88" X-Trace: blaine.gmane.org 1494663601 17472 195.159.176.226 (13 May 2017 08:20:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 May 2017 08:20:01 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 13 10:19:57 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9SHM-0004Lh-Fc for ged-emacs-devel@m.gmane.org; Sat, 13 May 2017 10:19:56 +0200 Original-Received: from localhost ([::1]:56653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9SHO-0005Zl-RX for ged-emacs-devel@m.gmane.org; Sat, 13 May 2017 04:19:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9SGm-0005Zg-SR for emacs-devel@gnu.org; Sat, 13 May 2017 04:19:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9SGl-0007YY-VI for emacs-devel@gnu.org; Sat, 13 May 2017 04:19:20 -0400 Original-Received: from mail-yw0-x236.google.com ([2607:f8b0:4002:c05::236]:36318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9SGl-0007Vg-PT for emacs-devel@gnu.org; Sat, 13 May 2017 04:19:19 -0400 Original-Received: by mail-yw0-x236.google.com with SMTP id b68so20111258ywe.3 for ; Sat, 13 May 2017 01:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=kLg0erH4aMJxVm1JP7l7zIBCYMntwstmwACvm3UYZDw=; b=fVrzLVl4s6T1F7pzUESIkRTgJ30XJJkSQhYx5iKQgUzg+BHbGddUjbwfZcQpVlX4BF kq6OuIhek31n/+V7aZ/xvEe1nMydf5RlI+lhEPMRz6a3V6LbpYgkIN8EhfsMwjPc/b2C 3dLG1UjeEb9b8cnN0C3GN/9UOTF0Z65G7d2I1nOv2T6TUEmA0ETgziR3PGCk2J0IYKl4 /YMPHMkT4M78mq5oPbzyIqPhgzof3gIFJSqk2tl6DKS+dQaFkHdZRvhm4izS3wKwQ9EK 5dRDcCasYcrRsLk3Sj5o28eYR2WyS3/yhU4oFY61/KjkK/RaIQY1VE6nsDWjOFD72ucH Ge2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=kLg0erH4aMJxVm1JP7l7zIBCYMntwstmwACvm3UYZDw=; b=MqGTlAYPhujj6jjweNT6z3n3iEtcLEELijkr7xw0IbMSm0vJJSHDdriMJ+UZB6Gx+w 4kNfUOXcdNq5Jd9VSFkGxY72sFPXS6fDjQOYjaWBTxz61a0NAaKXHm+Mtjg22zOdRv0d oQXV34f6yPI0nM5RLBlGhnwcnfoivZq9DGLtEtnFcS9EyJv4JbGj9NUE28fuSAVZZ0YV iJPzwM51wkarefgxdy1U60WZTawIPtowzZxU4aLNx1ffY88MPN6t5XZEiqtW7o+vxxdV PQI94BvImoGzMChGXDlqr9Q0SmV11zHjR5NDVR8inVXVduIF3m49mCGMI9KV0vZxDWvi xMFg== X-Gm-Message-State: AODbwcBeu0F4s9OPNsLWiiDMkIefzg1wXq6JBxJKQSpPrn6VA526E3dt 7ykRj0o83MHfHAwC7o0xk3EGaa/FBaLx X-Received: by 10.129.174.76 with SMTP id g12mr6478583ywk.34.1494663557552; Sat, 13 May 2017 01:19:17 -0700 (PDT) Original-Received: by 10.13.232.22 with HTTP; Sat, 13 May 2017 01:19:17 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214810 Archived-At: --f403045f6e506820d4054f637a88 Content-Type: text/plain; charset="UTF-8" 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)) ``` --f403045f6e506820d4054f637a88 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Would there be any issues with / objections to having `def= ine-key` return the keymap it adds a key to? It currently returns `nil`, ma= king it a statement (bleh!) rather than a function.

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

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


--f403045f6e506820d4054f637a88--