summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-08-03 15:32:01 +0200
committerBastien Guerry <bzg@altern.org>2012-08-03 15:32:01 +0200
commit8fca59f71f2209547f2c288892e0d380a6803ffb (patch)
tree26444aaa8113414c2169ded84ba59c4e67cb3f7b
parent6c2d37debffa1cdb65f517413e48f780c701cc1b (diff)
downloadorg-mode-8fca59f71f2209547f2c288892e0d380a6803ffb.tar.gz
org.el: Allow opening multiple shell links.
* org.el (clean-buffer-list-kill-buffer-names): Declare. (org-open-at-point): Allow opening multiple shell links by creating a new output buffer for each shell process. The new buffer is added to `clean-buffer-list-kill-buffer-names'. Thanks to Tobias Naehring for this idea.
-rw-r--r--lisp/org.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index fb2f695..d4367c1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9663,6 +9663,7 @@ Functions in this hook must return t if they identify and follow
a link at point. If they don't find anything interesting at point,
they must return nil.")
+(defvar clean-buffer-list-kill-buffer-names) ; Defined in midnight.el
(defun org-open-at-point (&optional arg reference-buffer)
"Open link at or after point.
If there is no link at point, this function will search forward up to
@@ -9815,7 +9816,8 @@ application the system uses for this file type."
(org-open-file path arg line search)))
((string= type "shell")
- (let ((cmd path))
+ (let ((buf (generate-new-buffer "*Org Shell Output"))
+ (cmd path))
(if (or (and (not (string= org-confirm-shell-link-not-regexp ""))
(string-match org-confirm-shell-link-not-regexp cmd))
(not org-confirm-shell-link-function)
@@ -9825,7 +9827,9 @@ application the system uses for this file type."
'face 'org-warning))))
(progn
(message "Executing %s" cmd)
- (shell-command cmd))
+ (setq clean-buffer-list-kill-buffer-names
+ (cons buf clean-buffer-list-kill-buffer-names))
+ (shell-command cmd buf))
(error "Abort"))))
((string= type "elisp")