From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Emacs keybindings according to file type Date: Wed, 23 Sep 2020 09:44:33 +0200 Message-ID: References: <83v9g7xliv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 23 09:47:06 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKzUY-0007dL-EN for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 09:47:06 +0200 Original-Received: from localhost ([::1]:47308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKzUX-00023a-AQ for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 03:47:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKzSD-00021h-A3 for help-gnu-emacs@gnu.org; Wed, 23 Sep 2020 03:44:44 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:40347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKzS7-0007ib-TM; Wed, 23 Sep 2020 03:44:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600847073; bh=CyXdIq24YeDSAgPNIALDN3okovy5qDaCXWh3Unr/AYg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=U29Tr/g+nokIcXh3yUERaI1RQi8XLkmWb9jdjj7HM1QoFmWxmWRTDvQDzpMXNJdHq /byWtm4S9nPJeAANAiXtNmV98c5GT5BSiicD2iNujA25cIJEjuaFNXIIvF5+lz8trC Rm+yH2c3yfaADcHR6il4rCeNvQFcVebZG0juRgsQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs02.server.lan [172.19.170.129]) (via HTTP); Wed, 23 Sep 2020 09:44:33 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:tyFG0AA0JS5H2d/+IgcP4Vn+0YE628ISnuO1GXr2BFDvAiRp4iY73ZbcJncpAXE/slQmR uGcIWQpqVwOLfh9331oBaWVSF0FT3U1qclekkUhXC1CxyNrQ4OIJmiXZ6y2YUTqZpme/02GTxVwx 0Mte2Uk6GOdWWL7iPD3q5ie1wjRxVn/ochuMpskkQF2NSIV7+Yfhy4BKTVC9a0z4x+9VBL6kdnKC dC9mE/R87+XHDm4DxjJzVmy8QISLr5XmWxHf+E6qAYOCUmoAlaaG/XHlR1eNkr07BLqBPG3MF61b Do= X-UI-Out-Filterresults: notjunk:1;V03:K0:JC/yUWkHDOM=:n4baKwJzvHXFCyTTFjz0+q VQTqe20J/CCnXKSAPeU+YEeX/oz6gggIXRteWo3rcp/QY6dhb+YwOhMWxWca9sWbu5CaBlO/w JUtkbcDF0Iqb0/xXa7gmVtmKcPzs0y0pxQeey8Ffs6imRpfnUqyMgnQpAyF3+N4KQgLMeusF7 Spl5hnCFMOllwGfrB3Qsjs9Rs4Kf0nj732SQSkZu3pIjc8Y9ptK4EV6Y6czVKtzRKQMcbReT/ +blcpMKy/6gothEBQaJavE99vvWV/gEzFm+hT73jzEyJBV3zKt4u1a2jhxmgdv3ZbklG7mTmi +GIt6OwftvnFuEaeG29ggGApJg1tNR1R+JPdUuiXrz8W/jhoGnnkxmEUz2+vh8rG13dzCMyyI TajTUTLAtC9n7R42aADwmGRCeMZEUwk3W9AsI9XUwCYm6Lq45d236XsvDHKhQmejpgbhLghsq YUSIc3AYUb2Bxzo42dkTDtDYbPMZ8a+jUjlH7S4kkpHCaGpCfJZi+w8p9ZsaArYbvrVx1Vucd UjZy2RvQOAMlc13jWXv7m8II76hHwWac51sPDxzXNlAn+/RV2pUlpUZDl45R19kZxXpfHOMqf y5gbiiCLeQWVemRedHd9RZqlkuFOiqIeHDWixnV90ZLTWmGJEa8xqCJMzg0xi5PsDDeNbeuL4 peX4+B5cgb893VKffXNHuScmcAbiS58Mvf6LUu0s+R7Gpow== Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/23 03:15:29 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124152 Archived-At: Thank you for pointing the misspelling, it now works correctly=2E In the meantime I have used the following ( org-defkey org-mode-map (kbd "C-t l f") 'org-drag-line-forward ) ( org-defkey org-mode-map (kbd "C-t l b") 'org-drag-line-backward ) Concerning the repeatable binding, have you practiced, because I have not= =2E How do you go about it? =20 > Sent: Wednesday, September 23, 2020 at 7:33 AM > From: "Yuri Khan" > To: "Christopher Dimech" > Cc: "Eli Zaretskii" , "help-gnu-emacs" > Subject: Re: Emacs keybindings according to file type > > On Wed, 23 Sep 2020 at 13:33, Christopher Dimech wrot= e: >=20 > > I wrote the following code to swap line for org files=2E > > Did not work after trying it=2E I need to have the thing work for > > org files and other files on whicn I call M-x org-mode=2E > > > > ( defun Transpose-Org-Line () > > "Binds up and down keys to org-drag-line* commands" > > (local-set-key (kbd "C-t l f") 'org-drag-line-forwarrd) > > (local-set-key (kbd "C-t l b") 'org-drag-line-backward) > > ) > > > > ( add-hook 'org-mode-hook 'Transpose-Org-Line ) >=20 > Works for me in emacs -Q, except that you misspelled =E2=80=98forward=E2= =80=99=2E >=20 > Also, org-mode already binds M-S- and M-S- to commands that > work the same way as org-drag-line-* unless you are in a table or on a > clock timestamp=2E It=E2=80=99s likely that you will want to drag a line= more > than once in a row, so a repeatable binding (a key that you can hold > down) is better than a long sequence such as C-t l f=2E >