summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-01-12 18:37:08 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2012-01-12 18:37:08 +0100
commit8c2f226b4d7cadc4fea2941e1bd3795f6adf8c2e (patch)
treefac6751407cf9fc357fec3dfbcf8f9c8d323ac74
parentdf9e196edb7a250d12bfadf8385feb0a0aa7f303 (diff)
downloadorg-mode-8c2f226b4d7cadc4fea2941e1bd3795f6adf8c2e.tar.gz
C-c C-c renumbers ordered lists again
* lisp/org.el (org-ctrl-c-ctrl-c): Fix a naive structure backup. Those must be done with `copy-tree'. Thanks to Anthony Lander for reporting it.
-rw-r--r--lisp/org.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/org.el b/lisp/org.el
index b6d31cf..50ee688 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18424,22 +18424,22 @@ This command does many different things, depending on context:
;; only if function was called with an argument. Send list only
;; if at top item.
(let* ((struct (org-list-struct))
- (new-struct struct)
- (firstp (= (org-list-get-top-point struct) (point-at-bol))))
+ (firstp (= (org-list-get-top-point struct) (point-at-bol)))
+ old-struct)
(when arg
- (setq new-struct (copy-tree struct))
+ (setq old-struct (copy-tree struct))
(if firstp
;; If at first item of sub-list, add check-box to every
;; item at the same level.
(mapc
(lambda (pos)
- (unless (org-list-get-checkbox pos new-struct)
- (org-list-set-checkbox pos new-struct "[ ]")))
+ (unless (org-list-get-checkbox pos struct)
+ (org-list-set-checkbox pos struct "[ ]")))
(org-list-get-all-items
- (point-at-bol) new-struct (org-list-prevs-alist new-struct)))
- (org-list-set-checkbox (point-at-bol) new-struct "[ ]")))
+ (point-at-bol) struct (org-list-prevs-alist struct)))
+ (org-list-set-checkbox (point-at-bol) struct "[ ]")))
(org-list-write-struct
- new-struct (org-list-parents-alist new-struct) struct)
+ struct (org-list-parents-alist struct) old-struct)
(when arg (org-update-checkbox-count-maybe))
(when firstp (org-list-send-list 'maybe))))
((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re))