summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2010-07-25 20:16:26 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2010-09-01 19:05:50 +0200
commiteabb0189136ab4da3eb4e0d1885ed696907b1602 (patch)
tree35d133f9dfb993ce80b083fd63a465f7ec8f310e
parent7c424b33ead413314188bc029e02ebcce67fcbc0 (diff)
downloadorg-mode-eabb0189136ab4da3eb4e0d1885ed696907b1602.tar.gz
`org-cycle-item-indentation' works only on empty items.
* org-list.el (org-cycle-item-indentation): Cycle when the whole item only contains bullet and maybe a checkbox. Previously, TAB would cycle when the first line of the item was blank.
-rw-r--r--lisp/org-list.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 7575acc..6c54506 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -927,9 +927,11 @@ Assumes cursor in item line."
(defun org-cycle-item-indentation ()
(let ((org-suppress-item-indentation t)
(org-adapt-indentation nil))
- (when (and (looking-at "[ \t]*$")
- (or (org-at-description-p) (org-at-item-checkbox-p) (org-at-item-p))
- (>= (match-end 0) (save-excursion (skip-chars-backward " \r\t\n") (point))))
+ (when (and (or (org-at-description-p) (org-at-item-checkbox-p) (org-at-item-p))
+ (>= (match-end 0) (save-excursion
+ (org-end-of-item-text-before-children)
+ (skip-chars-backward " \r\t\n")
+ (point))))
(setq this-command 'org-cycle-item-indentation)
;; When in the middle of the cycle, try to outdent first. If it
;; fails, and point is still at initial position, indent. Else,