From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: TAB key isn't bound to org-cycle with emacs on console Date: Fri, 9 Feb 2007 09:17:59 +0100 Message-ID: <65bdce56daecf4a9b037d952ebbafed7@science.uva.nl> References: <87d54kpupt.fsf@baldur.tsdh.de> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFQxF-0001vd-1W for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 03:18:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFQxD-0001vR-6w for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 03:18:00 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFQxC-0001vO-Vj for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 03:17:59 -0500 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HFQxC-0006hf-KC for emacs-orgmode@gnu.org; Fri, 09 Feb 2007 03:17:58 -0500 In-Reply-To: <87d54kpupt.fsf@baldur.tsdh.de> 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: Tassilo Horn Cc: emacs-orgmode@gnu.org On Feb 8, 2007, at 15:52, Tassilo Horn wrote: > Hello, > > I use Org since about 2 month and I really enjoy it. Normally I use > GNU/Emacs with its X11 interface, but today I noticed that TAB is not > bound to `org-cycle' when I use emacs -nw or emacs in a login > shell. Then it's bound to the function I local-set-key it in > fundamental-mode-hook. > > ,----[ grep -A2 fundamental-mode-hook ~/.emacs ] > | (add-hook 'fundamental-mode-hook > | (lambda () > | (local-set-key "\C-i" 'th-complete-or-indent))) > `---- > > When I do M-x org-cycle emacs echoes that I can run this function with > , too. 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. If you cannot fix this, you need to have org-cycle bound to C-i in order to get it executed by TAB. 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!) 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? If you only need it in, say, fundamental-mode and in text-mode, you could do (define-key fundamental-mode-map "\C-i" th-......) (define-key text-mode-map "\C-i" th-......) 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))) 3. You could make th-complete-or-indent smarter so that it calls org-cycle when you are in org-mode. Hope this helps - Carsten > > Does anyone suspect what could be the culprit? > > BTW: I use Org-mode-4.64. > > Bye, > Tassilo > -- > [Emacs] is written in Lisp, which is the only computer language that is > beautiful. -- Neal Stephenson, _In the Beginning was the Command Line_ > > > > _______________________________________________ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > -- Carsten Dominik Sterrenkundig Instituut "Anton Pannekoek" Universiteit van Amsterdam Kruislaan 403 NL-1098SJ Amsterdam phone: +31 20 525 7477