forked from mirrors/org-mode
org-list: indentation has precedence over visibility cycling
* lisp/org-list (org-cycle-item-indentation): do not break an indentation cycle because visibility cycling is requested. This happens when an item becomes a parent, due to indentation change. Not considered empty anymore, the function cannot change its indentation again.
This commit is contained in:
parent
9dc1ac5660
commit
90ad814703
|
@ -2476,15 +2476,16 @@ Return t at each successful move."
|
||||||
(struct (org-list-struct))
|
(struct (org-list-struct))
|
||||||
(ind (org-list-get-ind (point-at-bol) struct))
|
(ind (org-list-get-ind (point-at-bol) struct))
|
||||||
(bullet (org-list-get-bullet (point-at-bol) struct)))
|
(bullet (org-list-get-bullet (point-at-bol) struct)))
|
||||||
;; Check that item is really empty
|
;; Accept empty items or if cycle has already started.
|
||||||
(when (and (save-excursion
|
(when (or (eq last-command 'org-cycle-item-indentation)
|
||||||
|
(and (save-excursion
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(looking-at org-list-full-item-re))
|
(looking-at org-list-full-item-re))
|
||||||
(>= (match-end 0) (save-excursion
|
(>= (match-end 0) (save-excursion
|
||||||
(goto-char (org-list-get-item-end
|
(goto-char (org-list-get-item-end
|
||||||
(point-at-bol) struct))
|
(point-at-bol) struct))
|
||||||
(skip-chars-backward " \r\t\n")
|
(skip-chars-backward " \r\t\n")
|
||||||
(point))))
|
(point)))))
|
||||||
(setq this-command 'org-cycle-item-indentation)
|
(setq this-command 'org-cycle-item-indentation)
|
||||||
;; When in the middle of the cycle, try to outdent first. If it
|
;; When in the middle of the cycle, try to outdent first. If it
|
||||||
;; fails, and point is still at initial position, indent. Else,
|
;; fails, and point is still at initial position, indent. Else,
|
||||||
|
|
Loading…
Reference in New Issue