emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Making TAB a touch more magical
@ 2009-10-17  0:59 John Wiegley
  2009-10-17  6:55 ` Carsten Dominik
  2009-11-02 13:18 ` Carsten Dominik
  0 siblings, 2 replies; 6+ messages in thread
From: John Wiegley @ 2009-10-17  0:59 UTC (permalink / raw)
  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-<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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-11-03  9:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-17  0:59 Making TAB a touch more magical John Wiegley
2009-10-17  6:55 ` Carsten Dominik
2009-11-02 13:18 ` Carsten Dominik
2009-11-02 19:56   ` Samuel Wales
2009-11-03  5:29     ` Carsten Dominik
2009-11-03  9:39   ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).