emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Making TAB a touch more magical


From: John Wiegley
Subject: [Orgmode] Making TAB a touch more magical
Date: Fri, 16 Oct 2009 20:59:13 -0400

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-<right> 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- <right> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]