emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org.el: Fix indentation in lists after blocks with special env
@ 2017-05-20  3:41 Tim Stewart
  2017-05-20  6:38 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Stewart @ 2017-05-20  3:41 UTC (permalink / raw)
  To: emacs-orgmode

* lisp/org.el (org--get-expected-indentation): Fix indentation within
  lists after blocks that support a special editing environment.

Testing shows that the indentation within lists is incorrect after
`example-block', `export-block', and `source-block'.  The logic falls
through and makes a recursive call to `org-get-indentation' which
results in an indent to the same level as the last line of the block's
contents.

TINYCHANGE
---
 lisp/org.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 59f537b..441597a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22604,6 +22604,13 @@ ELEMENT."
 	  ;; and contents.
 	  ((= (line-beginning-position) post-affiliated)
 	   (org--get-expected-indentation element t))
+	  ;; Line above is a `#+BEGIN_.../#+END_...' structural
+	  ;; element with support for special editing environments.
+	  ;; Make sure we indent to the same level as the element
+	  ;; instead of its contents.
+	  ((member (car (org-element-at-point))
+		   '(example-block export-block src-block))
+	   (org-get-indentation))
 	  ;; POS is after contents in a greater element.  Indent like
 	  ;; the beginning of the element.
 	  ((and (memq type org-element-greater-elements)
--
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-12  1:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-20  3:41 [PATCH] org.el: Fix indentation in lists after blocks with special env Tim Stewart
2017-05-20  6:38 ` Nicolas Goaziou
2017-05-20 15:18   ` Tim Stewart
2017-06-12  1:52     ` Tim Stewart

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).