+ (setq ind-down (current-column)
+ bullet-down (org-get-bullet)))))
+ (if (and bullet-down (string-match "\\`[0-9]+\\(\\.\\|)\\)\\'" bullet-down))
+ (setq bullet-down (concat "1" (match-string 1 bullet-down))))
+ (if (and bullet-up (string-match "\\`[0-9]+\\(\\.\\|)\\)\\'" bullet-up))
+ (setq bullet-up (concat "1" (match-string 1 bullet-up))))
+ (if (and bullet (string-match "\\`[0-9]+\\(\\.\\|)\\)\\'" bullet))
+ (setq bullet (concat "1" (match-string 1 bullet))))
+ (list (cons ind bullet)
+ (cons ind-up bullet-up)
+ (cons ind-down bullet-down))))
+
+(defvar org-tab-ind-state) ; defined in org.el
+(defun org-cycle-item-indentation ()
+ (let ((org-suppress-item-indentation t)
+ (org-adapt-indentation nil))
+ (cond
+ ((and (looking-at "[ \t]*$")
+ (org-looking-back "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[).]\\)[ \t]+"))
+ (setq this-command 'org-cycle-item-indentation)
+ (if (eq last-command 'org-cycle-item-indentation)
+ (condition-case nil
+ (progn (org-outdent-item 1)
+ (if (equal org-tab-ind-state (org-get-indentation))
+ (org-outdent-item 1))
+ (end-of-line 1))
+ (error
+ (progn
+ (while (< (org-get-indentation) org-tab-ind-state)
+ (progn (org-indent-item 1) (end-of-line 1)))
+ (setq this-command 'org-cycle))))
+ (setq org-tab-ind-state (org-get-indentation))
+ (org-indent-item 1))
+ t))))
+
+(defun org-get-bullet ()
+ (save-excursion
+ (goto-char (point-at-bol))
+ (and (looking-at
+ "^\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\(\\*\\)\\)\\( \\|$\\)")
+ (or (match-string 2) (match-string 4)))))