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 08:33:16 +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="894"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 23 08:35:33 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 1kKyNJ-00006W-RI for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 08:35:33 +0200 Original-Received: from localhost ([::1]:60706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKyNI-0002f5-LS for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 02:35:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKyLB-0002es-JY for help-gnu-emacs@gnu.org; Wed, 23 Sep 2020 02:33:21 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:33113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKyL9-0007Uc-Ea; Wed, 23 Sep 2020 02:33:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600842797; bh=P4oY53Ax1CF89RcG4PHgSmHVAJNhHSJLMz6qx6Eu0KM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Y+1giWrAhGv0yHIYxYp72ZPYFvuseDEeGZIJtugoj4eicRuUDuDSOQuTPsWeHVToB WShaTw9mTmHNvpaKCvpCdF0691VF+g9vCciTgjxJGuePiD77ZuQCB3S3iAg7yKIXO2 5srii2lTi7sb8SG+lWN5ib067sC+PLUfqCswW9OI= 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 08:33:16 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <83v9g7xliv.fsf@gnu.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:3tRQeLAU8htKtFpi1OzYEjCYd4RtFm1dNR04JZUavRa5akKatTJ4nY3AxafK4p0XUyz7X t2x03pDIjuIzlX2vtW8jlZ2b+cp07cMm64xD9PHkVUJMmiiQ5xgjTmagaUD89lPohd1EvhBj7ral zPK0M9cHXjOSAyY39cL1A+WgF1TryJs7IbCwfP/CMLRZJLOk1jZhgMifNO7TJnQkicsiNr3Fc3UU 5cypXN43gaCQzk93dLca6dRAPJX56eHkqcsbOcytJ4CP5D1BqQjazRYVTqLniFIaeUUoBAwuWiyw 8w= X-UI-Out-Filterresults: notjunk:1;V03:K0:yopYTHb8wL4=:iWLL3/fW1PEj9O5j4n++IF n6X/ZgcyiMtkBgQOtNargvQiq1mYs0hUj0d+k3I68emTRuc3Y5NzLiqOXQejEhR4/QmeaZ02q u7dUCSSuDbvewGyeODzycfASHTo/Kr8w1H6r7UyOcut3SbalKth1FgrlrsB5VTr0JU6RG+Mll SMze4ol2QDyQyl6+K5YYrSG54zgetoZXuljSOiaEIBvJKtP89BXiAuHsq9xzRMOSSQtVIPGxX WIEhcrlCewnFtjO6d2zP4yjw/+WwbFbxXc6vqZd+bfUjFz9zMlB9ea7Pu4QQP4h+1orfZeWVQ 6ANMJYknNcckRhbTbzfZSrXP9OLo1SyxR2m1x3niyB2Gi8V+j1LG3G2o6sEybSLBbstiiOQYZ bzdHzc1xamUGc789kEJUwcq8scawaBKtAfi2QVbO1mQjwor95HQOu+agK7hD/ia/MzC+amXYu 2zK+2SJ9bB7tA0Ki+9UVRWGYlpHyEDcLGxp60f18LCjV5czIYc9oomUTAr8x82gAAPhweO3x3 6A3h/DpDpFABoI8kS7NQ1S9Cti4AWUzDGbIIEyCobA//wdfnoRQcJE0fOK6f6KeuiWYph1YeF KKOIhAHIXf63cMh7MsNWQFJ1Kv+Z4OzA25TS3icj8sVaVJV4c49w2eeTeZjLhWHCH7U/vY7su Rryk70idk4lrwbP6LVrEdAWYfWBOmQ7z1x18UP69PRX+wxK0vh2n2NtoRKHhghdiOOmg= Received-SPF: pass client-ip=212.227.15.18; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/23 02:33:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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:124150 Archived-At: Dear Compeers, I wrote the following code to swap line for org files. Did not work after trying it. I need to have the thing work for org files and other files on whicn I call M-x org-mode. ( 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 ) =2D-------------------- Christopher Dimech Chief Administrator - Naiad Informatics - GNU Project (Geocomputation) - Geophysical Simulation - Geological Subsurface Mapping - Disaster Preparedness and Mitigation - Natural Resource Exploration and Production - Free Software Advocacy > Sent: Monday, September 21, 2020 at 2:16 PM > From: "Eli Zaretskii" > To: help-gnu-emacs@gnu.org > Subject: Re: Emacs keybindings according to file type > > > From: Christopher Dimech > > Date: Mon, 21 Sep 2020 08:46:02 +0200 > > > > I want to set different keybinding according to the type of file I loa= d > > into a buffer. I wonder how I can do that. > > The usual way of doing this is use local-set-key in a mode hook. Then > the key bindings will only affect the mode of that file. > >