Untabify ASCII image before returning to Org-mode.

When an ASCII image is edited with C-c ', it will in the end be quoted
by prepending colons to each line.  If tabulators are used in the
image, this may mess up the alignment.  Since tabulators are not a
good idea in ASCII images anyway, this patch makes sure that any
tabulators are replaced by spaces.
This commit is contained in:
Carsten Dominik 2008-11-12 11:48:46 +01:00
parent 18f0a1d70e
commit 29c5bfd7b5
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,19 @@
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-edit-src-exit): Untabify ASCII image before
returning.
2008-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-yank): Make any prefix force normal yanking.

View File

@ -5711,6 +5711,7 @@ the language, a switch telling of the content should be in a single line."
(font-lock-unfontify-region (point-min) (point-max)))
(put-text-property (point-min) (point-max) 'font-lock-fontified t))
(when (org-bound-and-true-p org-edit-src-picture)
(untabify (point-min) (point-max))
(goto-char (point-min))
(while (re-search-forward "^" nil t)
(replace-match ": "))