org-src: Unify source editing tools
commit203bf5870f7b27b96fb3e4adbd06cf37a38d7512
authorNicolas Goaziou <mail@nicolasgoaziou.fr>
Sat, 22 Nov 2014 23:31:23 +0000 (23 00:31 +0100)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Sun, 23 Nov 2014 23:07:39 +0000 (24 00:07 +0100)
treebeaa3cf4facfb52b1cfc16d7bb01c65cb8c23250
parent9c06f8cce93f479bff5ef053777c235935717a66
org-src: Unify source editing tools

* lisp/org-src.el (org-src-strip-leading-and-trailing-blanklines,
  org-edit-src-force-single-line, org-edit-src-picture,
  org-edit-src-from-org-mode, org-edit-src-allow-write-back-p,
  org-edit-src-beg-marker, org-edit-src-end-marker,
  org-edit-src-overlay, org-edit-src-block-indentation,
  org-edit-src-saved-temp-window-config, org-edit-src-code-timer):
  Remove variables.
(org-src--allow-write-back-p, org-src--beg-marker,
org-src--block-indentation, org-src--code-timer, org-src--end-marker,
org-src--end-marker, org-src--from-org-mode, org-src--overlay,
org-src--saved-temp-window-config, org-src--type,
org-src--babel-info): New variables.

(org-src--construct-edit-buffer-name, org-src--edit-buffer,
org-src--source-buffer, org-src--get-lang-mode, org-src--coordinates,
org-src--goto-coordinates, org-src--element-contents-area,
org-src--make-source-overlay, org-src--on-element-p,
org-src--contents-for-write-back, org-src--edit-element,
org-edit-table.el, org-edit-export-block): New functions.
(org-edit-src-find-buffer, org-src-construct-edit-buffer-name,
org-src-tangle, org-src-in-org-buffer): Remove functions.

(org-edit-src-code, org-edit-fixed-width-region, org-edit-src-abort,
org-edit-src-save): Use new functions and variables.
(org-edit-src-exit): Use new functions and variables.  Change
signature.

* lisp/org.el (org-edit-special, org-indent-line, org-indent-region):
  Use new functions and variables.

* lisp/ob-core.el (org-babel-do-in-edit-buffer): Remove useless check.
(org-babel-expand-src-block): Apply signature change.

This patches resolves discrepancies between source editing tools and
globally simplifies process (auto-save feature, region
preservation...).  It introduces export block editing.  It also moves
internal variables and functions into an appropriate namespace and
delete some unused functions.
lisp/ob-core.el
lisp/org-src.el
lisp/org.el