From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Let tab do org-cycle only at special place. Date: Wed, 23 May 2007 16:20:09 +0200 Message-ID: <431a3cfee08266a8b3a5d4c1f4dac538@science.uva.nl> References: <200705231756.53173.zsdjw@21cn.com> 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 1HqrhJ-0005a2-P1 for emacs-orgmode@gnu.org; Wed, 23 May 2007 10:20:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HqrhI-0005ZA-79 for emacs-orgmode@gnu.org; Wed, 23 May 2007 10:20:17 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HqrhI-0005Z7-0W for emacs-orgmode@gnu.org; Wed, 23 May 2007 10:20:16 -0400 Received: from ug-out-1314.google.com ([66.249.92.172]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HqrhF-0005q1-Sf for emacs-orgmode@gnu.org; Wed, 23 May 2007 10:20:14 -0400 Received: by ug-out-1314.google.com with SMTP id 34so570632ugf for ; Wed, 23 May 2007 07:20:12 -0700 (PDT) In-Reply-To: <200705231756.53173.zsdjw@21cn.com> 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: Levin Du Cc: emacs-orgmode Yes, this is a good idea. The org-mode implementation will use the variable org-cycle-emulate-tab, in the next version there will be an additional value for this option to get the bahavior you propose. Thanks! - Carsten On May 23, 2007, at 11:56, Levin Du wrote: > I've my busy tab key set to a super expand/indent function: > > (global-set-key "\t" 'ext-super-tab) > > Currently in org-mode, tab is only doing indent in none > headline/special > place. I'd like to use tab only at the beginning of headline or > buffer. So I > put something like this in my org-conf.el : > > (defun org-tab (&optional arg) > "Do org-cycle only at the beginning of a headline, otherwise do > the job defined in global keymap." > (interactive "P") > (let* ((outline-regexp > (if (and (org-mode-p) org-cycle-include-plain-lists) > "\\(?:\\*+\\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)" > outline-regexp)) > (bob-special (and org-cycle-global-at-bob (bobp) > (not (looking-at outline-regexp))))) > (if (or bob-special > (eq arg t) > (integerp arg) > (org-at-table-p 'any) > (looking-at outline-regexp)) > (org-cycle arg) > (call-interactively (global-key-binding "\t"))))) > > (define-key org-mode-map [(tab)] 'org-tab) > > Hope this is useful for someone else. > > Levin > > > _______________________________________________ > 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