From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joost Kremers Subject: Re: Binding literal tab to C-Tab Date: Fri, 06 Mar 2020 09:53:56 +0100 Message-ID: <874kv1n9sr.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41446) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jA8k4-0000g8-2X for emacs-orgmode@gnu.org; Fri, 06 Mar 2020 03:54:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jA8k3-0000IW-2k for emacs-orgmode@gnu.org; Fri, 06 Mar 2020 03:53:59 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:38931) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jA8k2-0000G5-OU for emacs-orgmode@gnu.org; Fri, 06 Mar 2020 03:53:59 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5A08D22337 for ; Fri, 6 Mar 2020 03:53:58 -0500 (EST) Received: from Swift.fastmail.com (ip5f5ac93e.dynamic.kabel-deutschland.de [95.90.201.62]) by mail.messagingengine.com (Postfix) with ESMTPA id DF05630611FB for ; Fri, 6 Mar 2020 03:53:57 -0500 (EST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org On Fri, Mar 06 2020, Josh wrote: > Hi all, > > I have a need to insert literal tab characters into my org-mode > files > frequently. I would like to bind a key to insert literal tabs > (ASCII 9). I > thought Control-TAB would be a good option. So I inserted the > following lines > into my .emacs file. It works when in normal emacs, but not in > org-mode. Is > there a way to get this to work in org-mode? If this is a bad > key combination > for org-mode, I'm ok switching to another key combo. Well, C-TAB is already bound in Org (to `org-force-cycle-archived`), but if you have no use for that command, you can of course rebind it. Since `global-set-key` creates global bindings, which are shadowed by local bindings, your binding has no effect in Org buffers. You need to bind C-TAB in `org-mode-map`: (define-key org-mode-map (kbd "C-") #'my-insert-tab-char) HTH -- Joost Kremers Life has its moments