1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-25 07:27:57 +00:00

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.
This commit is contained in:
Nicolas Goaziou 2012-01-12 18:37:08 +01:00
parent df9e196edb
commit 8c2f226b4d

View File

@ -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))