From 3a084384f4f83e32cb4d16d67ee0b98624248535 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 20 Jul 2010 12:01:10 +0200 Subject: [PATCH] Refactoring. --- lisp/org-list.el | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index f533f58b2..c0c7767d8 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -989,26 +989,19 @@ is an integer, 0 means `-', 1 means `+' etc." ((string-match "\\." bullet) "1.") ((string-match ")" bullet) "1)") (t bullet))) - ;; Description items cannot be numbered - (bullet-list (if (org-at-description-p) - '("-" "+" "*") - '("-" "+" "*" "1." "1)"))) - ;; *-bullets are not allowed at column 0 - (bullet-list (if (looking-at "\\S-") - (remove "*" bullet-list) - bullet-list)) + (bullet-list (append '("-" "+" ) + ;; *-bullets are not allowed at column 0 + (unless (looking-at "\\S-") '("*")) + ;; Description items cannot be numbered + (unless (org-at-description-p) '("1." "1)")))) (item-pos (member current bullet-list)) (new (cond ((and (numberp which) (nth (mod which (length bullet-list)) bullet-list))) ((member which bullet-list) which) ((and item-pos (cdr item-pos)) (cadr item-pos)) - (t "-"))) - (old (and (looking-at "\\([ \t]*\\)\\(\\S-+\\)") - (match-string 2)))) - (replace-match (concat "\\1" new)) - (org-shift-item-indentation (- (length new) (length old))) - (org-fix-bullet-type)))) + (t "-")))) + (org-fix-bullet-type new)))) ;;; Checkboxes