Skip to content

Commit

Permalink
Distil the body of the org-to-gfm hook function
Browse files Browse the repository at this point in the history
1. We can condense 6 lines into 1, the prior code is overcomplicated
2. The refactor by @hlissner can actually trigger the error "Cannot
   replace a buffer with itself"
  • Loading branch information
tecosaur committed Mar 3, 2021
1 parent 9afb9a4 commit 7bdb502
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions emacs-everywhere.el
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,7 @@ Should end in a newline to avoid interfering with the buffer content."
(emacs-everywhere-markdown-p))
(goto-char (point-min))
(insert emacs-everywhere-org-export-options)
(let ((export-buffer (generate-new-buffer "*Emacs Everywhere Export*"))
org-export-show-temporary-export-buffer) ; don't create a split!
(unwind-protect
(replace-buffer-contents
(org-export-to-buffer (if (featurep 'ox-gfm) 'gfm 'md) (current-buffer)))
(kill-buffer export-buffer)))))
(org-export-to-buffer (if (featurep 'ox-gfm) 'gfm 'md) (current-buffer))))

(provide 'emacs-everywhere)
;;; emacs-everywhere.el ends here

0 comments on commit 7bdb502

Please sign in to comment.