From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Making TAB a touch more magical Date: Mon, 2 Nov 2009 14:18:09 +0100 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4wng-0002lj-Nj for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 08:18:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4wnc-0002jS-Nz for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 08:18:24 -0500 Received: from [199.232.76.173] (port=45750 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4wnc-0002j9-DI for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 08:18:20 -0500 Received: from mail-ew0-f211.google.com ([209.85.219.211]:61763) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4wnb-0006OE-9O for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 08:18:20 -0500 Received: by ewy7 with SMTP id 7so10322ewy.31 for ; Mon, 02 Nov 2009 05:18:15 -0800 (PST) In-Reply-To: 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: John Wiegley Cc: Org-mode Mode On Oct 17, 2009, at 2:59 AM, John Wiegley wrote: > In most "power" outliners on the Mac, pressing TAB indents the > outline level of the current item. This lets you add subnotes very > quickly by typing M-RET TAB. (I find M-S- way too cumbersome > to use while typing). > > Since pressing TAB on a new entry (one with no body) doesn't do > anything right now, I think TAB in that case should do what M-S- > does. This little snippet achieves that: > > (defun org-indent-empty-items (arg) > (when (eq arg 'empty) > (goto-char (line-end-position)) > (cond > ((org-at-item-p) (org-indent-item 1)) > ((org-on-heading-p) (org-demote-subtree))))) > > (add-hook 'org-pre-cycle-hook 'org-indent-empty-items) Hi John, this is not a bad idea, but it is a bit unstable because the definition of empty entry is a bit unstable, it depends on empty lines and how they are treated. An alternative would be to activate this special feature only immediately after starting a new entry, either by looking at last-command, or, maybe better, by doing this in entries which only have the stars and maybe a TODO keyword, but but no text yet. Then, TAB could even walk you through a number of indentations, like child, and then parent, grandparent,..., all the way to top level, and then back to the initial level. - Carsten > > This also works for regular lists. > > John > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten