emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: Org-mode Mode <emacs-orgmode@gnu.org>
Subject: Making TAB a touch more magical
Date: Fri, 16 Oct 2009 20:59:13 -0400	[thread overview]
Message-ID: <F423AE52-4791-478E-AE96-5B80B088FF30@gmail.com> (raw)

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	other threads:[~2009-10-17  1:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-17  0:59 John Wiegley [this message]
2009-10-17  6:55 ` Making TAB a touch more magical 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F423AE52-4791-478E-AE96-5B80B088FF30@gmail.com \
    --to=jwiegley@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).