0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-22 10:18:32 +00:00

Modified default number of blank lines when inserting an item.

* org-list.el (org-list-insert-item-generic): the second item in a
  list will be separated from its predecessor with the number of blank
  lines separating the first item from its parent, if any, or no blank
  line.
This commit is contained in:
Nicolas Goaziou 2010-07-26 09:53:17 +02:00
parent a905db7db7
commit 3a91400baa

View file

@ -398,14 +398,8 @@ function ends."
;; Trivial cases where there should be none.
((or org-empty-line-terminates-plain-lists
(not insert-blank-p)) 0)
;; When `org-blank-before-new-entry' says so, or item is
;; alone in the whole list, it is 1.
((or (eq insert-blank-p t)
(save-excursion
(goto-char (org-list-top-point))
(end-of-line)
(not (org-search-forward-unenclosed
org-item-beginning-re (org-list-bottom-point) t)))) 1)
;; When `org-blank-before-new-entry' says so, it is 1.
((eq insert-blank-p t) 1)
;; plain-list-item is 'auto. Count blank lines separating
;; neighbours items in list.
(t (let ((next-p (org-get-next-item (point) (org-list-bottom-point))))
@ -415,12 +409,10 @@ function ends."
(org-back-over-empty-lines))
;; Is there a previous item?
((not (org-first-list-item-p)) (org-back-over-empty-lines))
;; Local search failed: search globally.
((and (goto-char (org-list-bottom-point))
(beginning-of-line 0)
(org-search-backward-unenclosed "^[ \t]*$" (org-list-top-point) t))
(1+ (org-back-over-empty-lines)))
;; No blank line found in the whole list.
;; Item alone: count lines separating it from parent, if any
((/= (org-list-top-point) (point-at-bol))
(org-back-over-empty-lines))
;; No parent: no blank line.
(t 0)))))))
(insert-fun
(lambda (text)