lang/org: don't auto-demote headings on C-RET

This can be harder to predict. Instead, use TAB and S-TAB after-the-fact
to adjust heading level.
This commit is contained in:
Henrik Lissner 2019-11-11 14:48:37 -05:00
parent 781238f986
commit f70f788df3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -90,24 +90,16 @@
org-insert-heading-respect-content) org-insert-heading-respect-content)
(goto-char (line-end-position)) (goto-char (line-end-position))
(org-end-of-subtree) (org-end-of-subtree)
(insert (concat "\n" (insert "\n" (make-string level ?*) " ")))
(when (= level 1)
(if at-eol
(ignore (cl-incf level))
"\n"))
(make-string level ?*)
" "))))
(`above (`above
(org-back-to-heading) (org-back-to-heading)
(insert (make-string level ?*) " ") (insert (make-string level ?*) " ")
(save-excursion (save-excursion (insert "\n"))))
(insert "\n")
(if (= level 1) (insert "\n")))))
(when-let (todo-keyword (org-element-property :todo-keyword context)) (when-let (todo-keyword (org-element-property :todo-keyword context))
(org-todo (or (car (+org-get-todo-keywords-for todo-keyword)) (org-todo (or (car (+org-get-todo-keywords-for todo-keyword))
'todo))))) 'todo)))))
(t (user-error "Not a valid list, heading or table"))) ((user-error "Not a valid list, heading or table")))
(when (org-invisible-p) (when (org-invisible-p)
(org-show-hidden-entry)) (org-show-hidden-entry))