From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Wiegley Subject: Making TAB a touch more magical Date: Fri, 16 Oct 2009 20:59:13 -0400 Message-ID: Mime-Version: 1.0 (Apple Message framework v1075.2) 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 1MyxfM-00016q-Ud for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 21:01:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyxfI-000166-MC for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 21:01:04 -0400 Received: from [199.232.76.173] (port=50418 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyxfI-000163-JR for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 21:01:00 -0400 Received: from mail-qy0-f195.google.com ([209.85.221.195]:56178) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyxfI-0003Qi-62 for emacs-orgmode@gnu.org; Fri, 16 Oct 2009 21:01:00 -0400 Received: by qyk33 with SMTP id 33so1883594qyk.26 for ; Fri, 16 Oct 2009 18:00:59 -0700 (PDT) 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: Org-mode Mode 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) This also works for regular lists. John