org-export: Allow to force viewing of a stack source in Emacs

* contrib/lisp/org-export.el (org-export--stack-view): Add optional
  prefix argument to view a file in Emacs.

Patch from Jambunathan K.
This commit is contained in:
Nicolas Goaziou 2012-12-19 22:27:58 +01:00
parent 90de5ee463
commit f506348bcf
1 changed files with 6 additions and 4 deletions

View File

@ -5189,14 +5189,16 @@ If optional argument SOURCE is non-nil, remove it instead."
(org-remove-if (lambda (el) (equal (car el) source))
org-export-stack-contents))))
(defun org-export--stack-view ()
"View export results at point in stack."
(interactive)
(defun org-export--stack-view (&optional in-emacs)
"View export results at point in stack.
With an optional prefix argument IN-EMACS, force viewing files
within Emacs."
(interactive "P")
(let ((source (org-export--stack-source-at-point)))
(cond ((processp source)
(org-switch-to-buffer-other-window (process-buffer source)))
((bufferp source) (org-switch-to-buffer-other-window source))
(t (org-open-file source)))))
(t (org-open-file source in-emacs)))))
(defconst org-export-stack-mode-map
(let ((km (make-sparse-keymap)))