Refactor org-mode config

This commit is contained in:
Henrik Lissner 2015-11-21 18:03:11 -05:00
parent 8537361e50
commit b7d03fff52
3 changed files with 104 additions and 98 deletions

View file

@ -27,24 +27,14 @@
('above
(narf/org-table-prepend-row-or-shift-up))))
(t
(org-back-to-heading)
(let ((first-p (org-first-sibling-p))
(orig-char (point)))
(cl-case direction
('below
(org-insert-heading-after-current)
(unless first-p
(save-excursion
(goto-char orig-char)
(evil-insert-newline-above)))
(save-excursion
(evil-insert-newline-below)))
('above
(save-excursion
(evil-insert-newline-below))
(unless first-p
(save-excursion
(evil-insert-newline-above))))))))
(cl-case direction
('below
(org-insert-heading-after-current))
('above
(org-back-to-heading)
(org-insert-heading)))
(when (org-element-property :todo-type context)
(org-todo 'todo))))
(evil-append-line 1)))
;;;###autoload
@ -250,10 +240,11 @@ COUNT-FOOTNOTES? is non-nil."
(let ((path (if (string-match-p "^[/~]" dest)
dest
(expand-file-name dest default-directory))))
(shell-command
(format "/usr/local/bin/pandoc '%s' -o '%s'"
(buffer-file-name) path))
(message "Done! Exported to: %s" path)))
(if (shell-command
(format "/usr/local/bin/pandoc '%s' -o '%s'"
(buffer-file-name) path))
(message "Done! Exported to: %s" path)
(user-error "Export failed"))))
;;;###autoload
(defun narf/org-remove-link ()