Org babel: Add function and keybinding to remove result blocks

* ob-core.el (org-babel-remove-result-one-or-many): New function.

* ob-keys.el (org-babel-key-bindings): Add a keybinding for the
new function `org-babel-remove-result-one-or-many'.

TINYCHANGE
This commit is contained in:
Michael Weylandt 2014-04-13 12:58:31 -04:00 committed by Bastien Guerry
parent 8d20a8419f
commit 255dd41afd
2 changed files with 10 additions and 0 deletions

View File

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

View File

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