Create helper command my-org-fix-newlines
This commit is contained in:
parent
a3577588bb
commit
2eef05cb80
23
init.org
23
init.org
|
@ -4096,6 +4096,29 @@ From https://emacs.stackexchange.com/questions/20577/org-babel-load-all-language
|
||||||
ad-do-it))
|
ad-do-it))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
*** my-org-fix-newlines
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun my-org-fix-newlines ()
|
||||||
|
"Insert newlines around Org headings.
|
||||||
|
Newlines are inserted before headings (unless immediately
|
||||||
|
preceded by another heading) and after headings."
|
||||||
|
(interactive)
|
||||||
|
(org-map-tree
|
||||||
|
(lambda ()
|
||||||
|
(save-excursion
|
||||||
|
(forward-line -1)
|
||||||
|
(goto-char (point-at-bol))
|
||||||
|
(unless (or (looking-at-p "^$")
|
||||||
|
(org-at-heading-p))
|
||||||
|
(goto-char (point-at-eol))
|
||||||
|
(insert "\n")))
|
||||||
|
(save-excursion
|
||||||
|
(forward-line)
|
||||||
|
(goto-char (point-at-bol))
|
||||||
|
(when (looking-at-p "^$")
|
||||||
|
(join-line))))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
*** org-html-themify
|
*** org-html-themify
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package org-html-themify
|
(use-package org-html-themify
|
||||||
|
|
Loading…
Reference in New Issue