summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Miquel <sebastien.miquel@posteo.eu>2021-05-18 14:39:33 +0200
committerBastien <bzg@gnu.org>2021-05-18 16:06:27 +0200
commit857ae366b38a557e8a572c6ad36f1db17431c3ca (patch)
tree3e14075491d03e80c6092c9e6cb451753df22853
parenta34d71560bd95b2879b2dd2f0b94d773e0b4e18c (diff)
downloadorg-mode-857ae366b38a557e8a572c6ad36f1db17431c3ca.tar.gz
org.el (org-src--contents-for-write-back): Indent blank lines
* lisp/org.el (org-src--contents-for-write-back): Indent blank lines. * lisp/org-src.el (org-return): Revert part of commit bfda3cc7df.
-rw-r--r--lisp/org-src.el9
-rw-r--r--lisp/org.el6
2 files changed, 5 insertions, 10 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index f7011d1..c5dcf28 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -453,15 +453,14 @@ Assume point is in the corresponding edit buffer."
(insert (org-no-properties contents))
(goto-char (point-min))
(when (functionp write-back) (save-excursion (funcall write-back)))
- ;; Add INDENTATION-OFFSET to every non-empty line in buffer,
+ ;; Add INDENTATION-OFFSET to every line in buffer,
;; unless indentation is meant to be preserved.
(when (> indentation-offset 0)
(while (not (eobp))
(skip-chars-forward " \t")
- (unless (eolp) ;ignore blank lines
- (let ((i (current-column)))
- (delete-region (line-beginning-position) (point))
- (indent-to (+ i indentation-offset))))
+ (let ((i (current-column)))
+ (delete-region (line-beginning-position) (point))
+ (indent-to (+ i indentation-offset)))
(forward-line))))))
(defun org-src--edit-element
diff --git a/lisp/org.el b/lisp/org.el
index 5fe48f6..eb0c808 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17897,10 +17897,6 @@ object (e.g., within a comment). In these case, you need to use
(delete-and-extract-region (point) (line-end-position))))
(org--newline indent arg interactive)
(save-excursion (insert trailing-data))))
- ;; FIXME: In a source block, don't try to indent as it may result
- ;; in weird results due to `electric-indent-mode' being `t'.
- ((eq element-type 'src-block)
- (org--newline nil nil nil))
(t
;; Do not auto-fill when point is in an Org property drawer.
(let ((auto-fill-function (and (not (org-at-property-p))
@@ -19047,7 +19043,7 @@ Also align node properties according to `org-property-format'."
(line-beginning-position 2))))
nil)
((and (eq type 'src-block)
- org-src-tab-acts-natively
+ org-src-tab-acts-natively
(> (line-beginning-position)
(org-element-property :post-affiliated element))
(< (line-beginning-position)