mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
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))
|
||||
(ind (org-list-get-ind (point-at-bol) struct))
|
||||
(bullet (org-list-get-bullet (point-at-bol) struct)))
|
||||
;; Check that item is really empty
|
||||
(when (and (save-excursion
|
||||
(beginning-of-line)
|
||||
(looking-at org-list-full-item-re))
|
||||
(>= (match-end 0) (save-excursion
|
||||
(goto-char (org-list-get-item-end
|
||||
(point-at-bol) struct))
|
||||
(skip-chars-backward " \r\t\n")
|
||||
(point))))
|
||||
;; Accept empty items or if cycle has already started.
|
||||
(when (or (eq last-command 'org-cycle-item-indentation)
|
||||
(and (save-excursion
|
||||
(beginning-of-line)
|
||||
(looking-at org-list-full-item-re))
|
||||
(>= (match-end 0) (save-excursion
|
||||
(goto-char (org-list-get-item-end
|
||||
(point-at-bol) struct))
|
||||
(skip-chars-backward " \r\t\n")
|
||||
(point)))))
|
||||
(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,
|
||||
|
Loading…
Reference in New Issue
Block a user