emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: emacs-orgmode@gnu.org
Subject: Re: Binding literal tab to C-Tab
Date: Fri, 06 Mar 2020 09:53:56 +0100	[thread overview]
Message-ID: <874kv1n9sr.fsf@fastmail.fm> (raw)
In-Reply-To: <alpine.LRH.2.21.2003060007300.11712@colo.shuman.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-<tab>") #'my-insert-tab-char)

HTH

-- 
Joost Kremers
Life has its moments

      parent reply	other threads:[~2020-03-06  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  8:12 Binding literal tab to C-Tab Josh
2020-03-06  8:38 ` Marco Wahl
2020-03-06  8:53 ` Joost Kremers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kv1n9sr.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).