From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Making TAB a touch more magical Date: Tue, 3 Nov 2009 10:39:59 +0100 Message-ID: <26C91EC5-1CF7-4CC5-B5A6-4C4C7E9D29D7@gmail.com> 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 1N5Fs0-00056P-Ux for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 04:40:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5Frv-00055i-Ep for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 04:40:07 -0500 Received: from [199.232.76.173] (port=46521 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5Frv-00055f-Ae for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 04:40:03 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:47552) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5Fru-0003mU-UG for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 04:40:03 -0500 Received: by ewy28 with SMTP id 28so3313043ewy.42 for ; Tue, 03 Nov 2009 01:40:02 -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: Carsten Dominik Cc: Org-mode Mode On Nov 2, 2009, at 2:18 PM, Carsten Dominik wrote: > > 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. This actually does work now, both in empty headlines, and in empty plain list items. I find it *very* convenient. > > - 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 > > > - Carsten