diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-07-09 11:57:21 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-07-09 11:57:21 +0200 |
commit | fae13929f422e564be9a95ce216e0a865ff9ed6d (patch) | |
tree | 081d437d573fa87a1954c3b528160401a07f5145 | |
parent | ae9cd4370b4daaaca7bc53923d5e438c08955e48 (diff) | |
parent | d73f65b57a4f78f63e3c18ae0c1162c77c39e9fa (diff) | |
download | org-mode-fae13929f422e564be9a95ce216e0a865ff9ed6d.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-list.el | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el index f32a203..c4aef32 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -1552,22 +1552,6 @@ STRUCT may be modified if `org-list-demote-modify-bullet' matches bullets between START and END." (let* (acc (set-assoc (lambda (cell) (push cell acc) cell)) - (change-bullet-maybe - (lambda (item) - (let ((new-bul - (cdr (assoc - ;; Normalize ordered bullets. - (let ((bul (org-list-get-bullet item struct)) - (case-fold-search nil)) - (cond ((string-match "[A-Z]\\." bul) "A.") - ((string-match "[A-Z])" bul) "A)") - ((string-match "[a-z]\\." bul) "a.") - ((string-match "[a-z])" bul) "a)") - ((string-match "[0-9]\\." bul) "1.") - ((string-match "[0-9])" bul) "1)") - (t (org-trim bul)))) - org-list-demote-modify-bullet)))) - (when new-bul (org-list-set-bullet item struct new-bul))))) (ind (lambda (cell) (let* ((item (car cell)) @@ -1583,7 +1567,20 @@ bullets between START and END." ;; Item is in zone... (let ((prev (org-list-get-prev-item item struct prevs))) ;; Check if bullet needs to be changed. - (funcall change-bullet-maybe item) + (pcase (assoc (let ((b (org-list-get-bullet item struct)) + (case-fold-search nil)) + (cond ((string-match "[A-Z]\\." b) "A.") + ((string-match "[A-Z])" b) "A)") + ((string-match "[a-z]\\." b) "a.") + ((string-match "[a-z])" b) "a)") + ((string-match "[0-9]\\." b) "1.") + ((string-match "[0-9])" b) "1)") + (t (org-trim b)))) + org-list-demote-modify-bullet) + (`(,_ . ,bullet) + (org-list-set-bullet + item struct (org-list-bullet-string bullet))) + (_ nil)) (cond ;; First item indented but not parent: error ((and (not prev) (or (not parent) (< parent start))) @@ -2658,11 +2655,12 @@ Return t if successful." (error "Cannot outdent an item without its children")) ;; Normal shifting (t - (let* ((new-parents + (let* ((old-struct (copy-tree struct)) + (new-parents (if (< arg 0) (org-list-struct-outdent beg end struct parents) (org-list-struct-indent beg end struct parents prevs)))) - (org-list-write-struct struct new-parents)) + (org-list-write-struct struct new-parents old-struct)) (org-update-checkbox-count-maybe)))))) t) |