1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2025-01-01 11:15:00 +00:00

org-list: fix bug with item cycling

* lisp/org-list.el (org-cycle-item-indentation): cycling back to
  original position deleted any additional information in the item,
  like a counter or a tag.
This commit is contained in:
Nicolas Goaziou 2011-06-28 11:50:48 +02:00
parent c4086ad1e4
commit cc76e76509

View File

@ -2497,7 +2497,7 @@ Return t at each successful move."
(let* ((org-adapt-indentation nil)
(struct (org-list-struct))
(ind (org-list-get-ind (point-at-bol) struct))
(bullet (org-list-get-bullet (point-at-bol) struct)))
(bullet (org-trim (buffer-substring (point-at-bol) (point-at-eol)))))
;; Accept empty items or if cycle has already started.
(when (or (eq last-command 'org-cycle-item-indentation)
(and (save-excursion
@ -2511,7 +2511,7 @@ Return t at each successful move."
(setq this-command 'org-cycle-item-indentation)
;; When in the middle of the cycle, try to outdent first. If
;; it fails, and point is still at initial position, indent.
;; Else, go back to original position.
;; Else, re-create it at its original position.
(if (eq last-command 'org-cycle-item-indentation)
(cond
((ignore-errors (org-list-indent-item-generic -1 t struct)))
@ -2519,7 +2519,7 @@ Return t at each successful move."
(ignore-errors (org-list-indent-item-generic 1 t struct))))
(t (delete-region (point-at-bol) (point-at-eol))
(org-indent-to-column (car org-tab-ind-state))
(insert (cdr org-tab-ind-state))
(insert (cdr org-tab-ind-state) " ")
;; Break cycle
(setq this-command 'identity)))
;; If a cycle is starting, remember indentation and bullet,