瀏覽代碼

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.
Nicolas Goaziou 12 年之前
父節點
當前提交
f506348bcf
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      contrib/lisp/org-export.el

+ 6 - 4
contrib/lisp/org-export.el

@@ -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)))