forked from mirrors/org-mode
ox: Tiny refactoring
* lisp/ox.el (org-export-replace-region-by): Refactor.
This commit is contained in:
parent
e900ebed08
commit
e6f36cfe3a
12
lisp/ox.el
12
lisp/ox.el
|
@ -2978,14 +2978,10 @@ Return code as a string."
|
|||
BACKEND is either an export back-end, as returned by, e.g.,
|
||||
`org-export-create-backend', or a symbol referring to
|
||||
a registered back-end."
|
||||
(if (not (org-region-active-p))
|
||||
(user-error "No active region to replace")
|
||||
(let* ((beg (region-beginning))
|
||||
(end (region-end))
|
||||
(str (buffer-substring beg end)) rpl)
|
||||
(setq rpl (org-export-string-as str backend t))
|
||||
(delete-region beg end)
|
||||
(insert rpl))))
|
||||
(unless (org-region-active-p) (user-error "No active region to replace"))
|
||||
(insert
|
||||
(org-export-string-as
|
||||
(delete-and-extract-region (region-beginning) (region-end)) backend t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-export-insert-default-template (&optional backend subtreep)
|
||||
|
|
Loading…
Reference in New Issue