From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: TAB key isn't bound to org-cycle with emacs on console Date: Fri, 09 Feb 2007 11:24:34 +0100 Message-ID: <87veib6331.fsf@baldur.tsdh.de> References: <87d54kpupt.fsf@baldur.tsdh.de> <65bdce56daecf4a9b037d952ebbafed7@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFSw7-0000YJ-Rv for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 05:24:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFSw4-0000W0-7D for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 05:24:59 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFSw4-0000Vv-2v for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 05:24:56 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HFSw2-0008Pc-Uh for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 05:24:55 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HFSvt-0001b8-9K for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 11:24:45 +0100 Received: from dslb-084-063-056-060.pools.arcor-ip.net ([84.63.56.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Feb 2007 11:24:45 +0100 Received: from tassilo by dslb-084-063-056-060.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Feb 2007 11:24:45 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik writes: Hi Carsten, > First of all, not all terminal programs can distinguish between the > TAB key and C-i - obviously yours cannot. I am not sure if this can > be fixed with som setup - you need to look into documentation on > terminal windows for this. Hm, I've tried the usual linux login shell, urxvt, xterm and konsole. None of them seem to be capable of it, at least not with their default settings. > If you cannot fix this, you need to have org-cycle bound to C-i in > order to get it executed by TAB. Ok, no problem. > The problem is that you do the above binding in a hook, and that you > use local-set-key to do it. Local-set-key defines the key in the > current local map, which in org-mode is org-mode-map. > Fundamental-mode-hook seems to be run (I did not know this!) It was introduced yesterday and removed on RMS demand some hours later. ;-) Nevertheless, I've bound th-complete-or-indent in text-mode, too. > when org-mode is started, because org-mode is derived from > outline-mode, which is derived from text-mode which is derived from > fundamental-mode, so all these hooks are run! > > Here is what you can do: > > 1. Did you really intend to have this key binding in all modes, or did > you only want it in fundamental mode? Well, I want to have them in all modes that don't use TAB for a different purpose than indenting. > 2. If you really meant to have this in all modes except org-mode, you > can make org-mode-hook (which runs after fundamental-mode-hook) to > overrule this binding again. > > (add-hook 'org-mode-hook > (lambda () > (local-set-key "\C-i" 'th-complete-or-indent))) > ^^^^^^^^^^^^^^^^^^^^^ I guess you've meant org-cycle there, right? > 3. You could make th-complete-or-indent smarter so that it calls > org-cycle when you are in org-mode. Well, yes. But if I think about the whole function: I've written it, because typing `dabbrev-expand' (M-/) is a pain on German keyboards and I didn't want to lose indenting functionality with tab. But a while ago I switched to a German Dvorak Typ II layout, where M-/ is easily accessible. So I'll bint th-complete-or-indent to M-/ globally. Bye, Tassilo