diff options
author | Michael Weylandt <michael.weylandt@gmail.com> | 2014-04-13 12:58:31 -0400 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2014-04-17 08:26:12 +0200 |
commit | ed44c161f0b6010b988d8c46f4cc1d9aecca321f (patch) | |
tree | c49e5801ef03b951a38b878a8342707743e5feeb | |
parent | 8d20a8419fd711c66d77f0258903e735c113bffe (diff) | |
download | org-mode-ed44c161f0b6010b988d8c46f4cc1d9aecca321f.tar.gz |
Keybinding to remove result blocks
* ob-core.el (org-babel-remove-result-one-or-many): New function.
* ob-keys.el: Keybinding for new function org-babel-remove-result-one-or-many
TINYCHANGE
-rw-r--r-- | lisp/ob-core.el | 9 | ||||
-rw-r--r-- | lisp/ob-keys.el | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 0adfc33..0e8c57f 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2252,6 +2252,15 @@ code ---- the results are extracted in the syntax of the source (if keep-keyword (1+ (match-end 0)) (1- (match-beginning 0))) (progn (forward-line 1) (org-babel-result-end)))))))) +(defun org-babel-remove-result-one-or-many (x) + "Remove the result of the current source block. +If called with a prefix argument, remove all result blocks +in the buffer." + (interactive "P") + (if x + (org-babel-map-src-blocks nil (org-babel-remove-result)) + (org-babel-remove-result))) + (defun org-babel-result-end () "Return the point at the end of the current set of results." (save-excursion diff --git a/lisp/ob-keys.el b/lisp/ob-keys.el index 90b5196..dc1f437 100644 --- a/lisp/ob-keys.el +++ b/lisp/ob-keys.el @@ -89,6 +89,7 @@ functions which are assigned key bindings, and see ("h" . org-babel-describe-bindings) ("\C-x" . org-babel-do-key-sequence-in-edit-buffer) ("x" . org-babel-do-key-sequence-in-edit-buffer) + ("k" . org-babel-remove-result-one-or-many) ("\C-\M-h" . org-babel-mark-block)) "Alist of key bindings and interactive Babel functions. This list associates interactive Babel functions |