views:

130

answers:

1

I want to use intelligent tabbing in Emacs in C++ mode, but I also want to be able to insert a tab character when necessary. From other posts, I gather that the easiest way is to bind <Ctrl>-<Tab> to indent. However, it appears that Konsole in KUbuntu won't forward the <Ctrl>?

My current .emacs file contains:

(defun my-c-mode-common-hook ()  
 (setq c++-tab-always-indent t)
 (setq tab-width 4)
 (setq indent-tabs-mode t)
 )

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

(global-set-key [C-tab] 'self-insert-command)

So I believe that this will bind <Ctrl>-<Tab> to inserting a tab character. However, when I run:

<Ctrl>-h k <Ctrl>-<Tab>

Emacs only reports that I pressed the tab key. Is there some option to Konsole (which I have searched through to no avail) or global preferences in KUbuntu that I need to set so that the <Ctrl>- is also forwarded? (It certainly forwards all of the other <Ctrl>-blah commands.)

+1  A: 

You can use Control-Q (quote, is what I think of in order to remember this), and then press your Tab key, and you'll insert a tab character. You can use Control-Q to insert any character sequence you need to. Hope this helps. :)

Scott Jones
`<Ctrl>-Q TAB` works. Thanx!
M. Tibbits