From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Arne Babenhauserheide Newsgroups: gmane.emacs.devel Subject: * src/keymap.c (define-key) add practical example to docstring Date: Mon, 7 Jan 2013 17:14:55 +0100 Message-ID: <50EAF47F.1000806@kit.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig452EB927C0ED50F1461AA0E9" X-Trace: ger.gmane.org 1357591923 24259 80.91.229.3 (7 Jan 2013 20:52:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Jan 2013 20:52:03 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 07 21:52:16 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TsJg3-0003eA-QV for ged-emacs-devel@m.gmane.org; Mon, 07 Jan 2013 21:52:12 +0100 Original-Received: from localhost ([::1]:52871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsJfo-00010N-D4 for ged-emacs-devel@m.gmane.org; Mon, 07 Jan 2013 15:51:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsFLz-0005Hd-A8 for emacs-devel@gnu.org; Mon, 07 Jan 2013 11:15:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsFLt-0000ev-9j for emacs-devel@gnu.org; Mon, 07 Jan 2013 11:15:11 -0500 Original-Received: from mailout.scc.kit.edu ([129.13.185.202]:35411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsFLt-0000Xb-01 for emacs-devel@gnu.org; Mon, 07 Jan 2013 11:15:05 -0500 Original-Received: from KIT-MSX-04.kit.edu (kit-msx-04.kit.edu [172.21.117.14]) by scc-mailout-02.scc.kit.edu with esmtps (Exim 4.72 #1) id 1TsFLq-0000kN-B1; Mon, 07 Jan 2013 17:15:02 +0100 Original-Received: from [141.52.58.243] (172.21.117.7) by smtp.kit.edu (172.21.117.14) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 7 Jan 2013 17:15:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20130102 Thunderbird/10.0.11 X-Enigmail-Version: 1.3.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 129.13.185.202 X-Mailman-Approved-At: Mon, 07 Jan 2013 15:51:54 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156125 Archived-At: --------------enig452EB927C0ED50F1461AA0E9 Content-Type: multipart/mixed; boundary="------------020709060703030506050009" This is a multi-part message in MIME format. --------------020709060703030506050009 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Based on a discussion in #emacs, I=E2=80=99d like to contribute the attac= hed patch. It adds documentation for defining keys in a keymap which would have helped me a lot when I wrote my last minor mode. Best wishes, Arne --------------020709060703030506050009 Content-Type: text/x-patch; name="define-key-example.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="define-key-example.diff" # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: arne_bab@web.de-20130107114658-r7tm2oqdmanez2ps # target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/ # testament_sha1: 423a0e7828e9bdddd00b37d04a7da41effaee0af # timestamp: 2013-01-07 12:51:40 +0100 # base_revision_id: eliz@gnu.org-20121019064312-moqbalgi86m1r07g #=20 # Begin patch =3D=3D=3D modified file 'src/keymap.c' --- src/keymap.c 2012-10-10 20:09:47 +0000 +++ src/keymap.c 2013-01-07 11:46:58 +0000 @@ -1088,7 +1088,10 @@ =20 KEY is a string or a vector of symbols and characters, representing a sequence of keystrokes and events. Non-ASCII characters with codes -above 127 (such as ISO Latin-1) can be represented by vectors. +above 127 (such as ISO Latin-1) can be represented by vectors. With +`C-h c` you can get a string representation of any key sequence. Use +(kbd string) to get the representation for the keymap. For example use +(kbd "") to bind F6. Two types of vector have special meanings: [remap COMMAND] remaps any key binding for COMMAND. [t] creates a default definition, which applies to any event with no # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWW1rjiYAAYRfgAAQUHP/9= 3sk ioD/7//wUAPNeB10e9gDpw0QpsUMmgxABk0MjJoMgAhFNPSeiD1PaUyBiGTIMQBhGDQEKeiDa= keo wQBhGgDAmQaaSjyg0PKANGRoAAAAAkkE0NJiZMiZqMmQNTKek0YahtRsLT62CAP8Q+MT2Gk3Q= BTj Wm8yFMVFC8sKWmZjtUPClmDphsVGg4q67dSCdv11XsVxX3t+77stnJITV7XijtmNRCOtxQW+8= wzZ XsGbLkx2STiVSASBGDlutvwTRZrxGosAJB7xyh5LuyVorcPHz+KobpQDcl23qjO+yvGOq2Qs2= 13M F8PIWuAPYTBIcqKz0goi7kxFM3oovTsIPsIMSZ/04T4MqUqF4nPrTWqK1iKcvKrFSDGx2+va8= X1e tbsU8Wk3Vddm1jNTVCq63bfhYULbuVTCIKAQeYPe2F+++AbC4sF8is1lAmTA1Seny33v4GrZV= q0x ZqrNdaytqTFKnZWtquKhVw4bRxEjNM4ffGimkldq1CaDGzQKEHDXaKgnHC57OtSxbASJZCzNn= BIo xGSAmYRN0E5g4mqlmK6usTa7Kol2m5PmRp1Vm0o2kcHuC6jqSgZJMooJAxKY5pY0BXXWihiWk= zWC B0I3NiQUSbfy6nnv8dlj3FH2uhLktiWc4gxZ+PeDw+P04ele02Dr7POk5adtAXDtxnhwil319= fTw 424aGMQwmumWXMiUWCmyPG1HccRu78Skviw4Z/zbkk2mbc9YHQ/5L2TeHzBuhi2fqM2zAG+QX= h8I KoV0pCiAlbyLlY6qUvJ9VIXGxAal+S46slEx1NopQ2mmbg2dkQLmD9YHJxqBdlMc2WRprxt8D= c4g KGj+kDK8mQ3N7eko5nm6xKdIW/KU7i6+txumvbv043rtubyxljhus4tR+nEg8NniUrJOE6nfm= 8v7 +MloQHByJLFLEVHLhs9vFfQY3nkriOlvZqcuwcta3VHRDbJFPRU+azx+7HYEYFttyeV2KD2oq= 9VQ 6OhsTi5sN4QsmuuV0KS8O4PntzUGyKzZfg318mbMN+0JhNwT3cOQxJRTY86eKyFRoL8o3qrsm= bee ajEYi0GZzBnXCCKWZKLxPB8JW/RPAiywTlLtuVKurs2Ui8IF69xfmcw9U5O3MscumtFd2bMnF= DFO cclRaLuVKCDVN6p6zFXALNCSJqKno8kqjtsJS5XCK1nnVGQNzJhExikaPGNObqVbXsBi7jAOY= 4Ny p0rKQtgc364m12DvuYuHNZUc73FOWquwguoqFYFE05NjS5V188WIJ0uX276oWW+qm+tbA9UuK= 1K+ CJtWeWAoHEI9KZCr/F3JFOFCQbWuOJg=3D --------------020709060703030506050009-- --------------enig452EB927C0ED50F1461AA0E9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJQ6vSEAAoJEFyD82SnDaCepagH/jwWsjhmPq2MrRdqqZJYpqt3 5dK+hX4mvOGMvpYOuJQj5Q1DOqTKVIEAqOiyIt9500hAE9wiF6hX5yc34QT10TpU k9sQ6tdKga3A14a/DpZea2WluahgfvzgPYDf3w4OoSEvOku1psftTt/XgbKCRbp1 rf1I/Ky/oVkzjUhSQL5WL/LitVUdkkRyLPOOMJRQvtO8Id/SCsiUf86sa5L5HVOG roYuZMIlehLx+ejAPLCIf/39BLE+TbLm/oQHaZhehIWbj6WFDV36KiVM8Kj1KIXZ 35sbCNRjYw6QNexTtI8l53eqI6je0lXkhVat1A4QH9DKZWFmTTsJY3xYKrbFCoI= =lMeB -----END PGP SIGNATURE----- --------------enig452EB927C0ED50F1461AA0E9--