lang/org: clear src block results on TAB

When cursor is inside a src block. e.g.

  #+BEGIN_SRC elisp  <-- not here
  (message "hi")     <-- in here
  #+END_SRC          <-- not here
This commit is contained in:
Henrik Lissner 2019-12-30 00:07:19 -05:00
parent f8ff50565e
commit b9f90b3a1a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 13 additions and 2 deletions

View file

@ -406,6 +406,14 @@ with `org-cycle')."
(org-cycle-internal-local)
t)))))
;;;###autoload
(defun +org-clear-babel-results-h ()
"Remove the results block for the org babel block at point."
(when (and (org-in-src-block-p t)
(org-babel-where-is-src-block-result))
(org-babel-remove-result)
t))
;;;###autoload
(defun +org-unfold-to-2nd-level-or-point-h ()
"My version of the 'overview' #+STARTUP option: expand first-level headings.