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

* Re: [PATCH] org.el: Fix indentation in lists after blocks with special env
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2017-05-20  6:38 UTC (permalink / raw)
  To: Tim Stewart; +Cc: emacs-orgmode

Hello,

Tim Stewart <tim@stoo.org> writes:

> * 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.

Thank you. Could you provide an ECM, however? I'm not able to reproduce
it so far.

Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] org.el: Fix indentation in lists after blocks with special env
  2017-05-20  6:38 ` Nicolas Goaziou
@ 2017-05-20 15:18   ` Tim Stewart
  2017-06-12  1:52     ` Tim Stewart
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Stewart @ 2017-05-20 15:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Tim Stewart <tim@stoo.org> writes:
>
>> * 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.
>
> Thank you. Could you provide an ECM, however? I'm not able to reproduce
> it so far.

Huh.  I just tried to minimally reproduce and was unable to do so.  Then
I tried my standard configuration (without this patch) and was still
unable to reproduce!  To keep my sanity, I'm telling myself this may
have been fixed in the meantime.

There were several others at my workplace experiencing the issue--I will
have them remove the patch and retest in their environments.  I
apologize, I should have tried to provide an ECM from the beginning!

Thank you, and I'll let you know what I find,

-TimS

--
Tim Stewart
-----------
Mail:   tim@stoo.org
Matrix: @tim:stoo.org

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

* Re: [PATCH] org.el: Fix indentation in lists after blocks with special env
  2017-05-20 15:18   ` Tim Stewart
@ 2017-06-12  1:52     ` Tim Stewart
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Stewart @ 2017-06-12  1:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Tim Stewart <tim@stoo.org> writes:

> Hi,
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> Hello,
>>
>> Tim Stewart <tim@stoo.org> writes:
>>
>>> * 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.
>>
>> Thank you. Could you provide an ECM, however? I'm not able to reproduce
>> it so far.
>
> Huh.  I just tried to minimally reproduce and was unable to do so.  Then
> I tried my standard configuration (without this patch) and was still
> unable to reproduce!  To keep my sanity, I'm telling myself this may
> have been fixed in the meantime.
>
> There were several others at my workplace experiencing the issue--I will
> have them remove the patch and retest in their environments.  I
> apologize, I should have tried to provide an ECM from the beginning!
>
> Thank you, and I'll let you know what I find,

I checked and my coworkers checked and it seems this issue was, in fact,
resolved outside of my changes.  I have not tracked down the change that
provided the actual fix.

Thanks,

-TimS

--
Tim Stewart
-----------
Mail:   tim@stoo.org
Matrix: @tim:stoo.org

^ permalink raw reply	[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).