forked from mirrors/org-mode
Continue fixing fdb4b54e
This commit is contained in:
parent
03acfe44b6
commit
d438fbfb1b
21
lisp/org.el
21
lisp/org.el
|
@ -7583,14 +7583,15 @@ command."
|
||||||
(cond
|
(cond
|
||||||
|
|
||||||
((or (= (buffer-size) 0)
|
((or (= (buffer-size) 0)
|
||||||
(and (or (and (bolp)
|
(and (not (save-excursion
|
||||||
(not (save-excursion
|
(and (ignore-errors (org-back-to-heading invisible-ok))
|
||||||
(and (ignore-errors (org-back-to-heading invisible-ok))
|
(org-at-heading-p))))
|
||||||
(org-at-heading-p)))))
|
|
||||||
(and (bolp) (not (looking-at org-outline-regexp-bol))))
|
|
||||||
(or arg (not itemp))))
|
(or arg (not itemp))))
|
||||||
;; At beginning of buffer or so high up that only a heading
|
;; At beginning of buffer or so high up that only a heading
|
||||||
;; makes sense.
|
;; makes sense.
|
||||||
|
(when (and (org-before-first-heading-p) (not (bolp)))
|
||||||
|
(re-search-forward org-outline-regexp-bol)
|
||||||
|
(beginning-of-line 0))
|
||||||
(insert
|
(insert
|
||||||
(if (or (bobp) (org-previous-line-empty-p)) "" "\n")
|
(if (or (bobp) (org-previous-line-empty-p)) "" "\n")
|
||||||
(if (org-in-src-block-p) ",* " "* "))
|
(if (org-in-src-block-p) ",* " "* "))
|
||||||
|
@ -7654,7 +7655,8 @@ command."
|
||||||
|
|
||||||
;; If we insert after content, move there and clean up whitespace
|
;; If we insert after content, move there and clean up whitespace
|
||||||
(when (and respect-content
|
(when (and respect-content
|
||||||
(not (org-looking-at-p org-outline-regexp-bol)))
|
(not (org-looking-at-p org-outline-regexp-bol))
|
||||||
|
(not (bolp)))
|
||||||
(if (not (org-before-first-heading-p))
|
(if (not (org-before-first-heading-p))
|
||||||
(org-end-of-subtree nil t)
|
(org-end-of-subtree nil t)
|
||||||
(re-search-forward org-outline-regexp-bol)
|
(re-search-forward org-outline-regexp-bol)
|
||||||
|
@ -7687,10 +7689,9 @@ command."
|
||||||
(setq initial-content (org-trim initial-content)))
|
(setq initial-content (org-trim initial-content)))
|
||||||
(goto-char pos))
|
(goto-char pos))
|
||||||
;; a normal line
|
;; a normal line
|
||||||
(unless (bolp)
|
(setq initial-content
|
||||||
(setq initial-content (buffer-substring (point) (point-at-eol)))
|
(org-trim (buffer-substring (point) (point-at-eol))))
|
||||||
(delete-region (point) (point-at-eol))
|
(delete-region (point) (point-at-eol))))
|
||||||
(setq initial-content (org-trim initial-content)))))
|
|
||||||
|
|
||||||
;; If we are at the beginning of the line, insert before it. Else after
|
;; If we are at the beginning of the line, insert before it. Else after
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Reference in New Issue