emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
@ 2020-05-30  2:03 stardiviner
  2020-05-30 20:57 ` Berry, Charles via General discussions about Org-mode.
  2020-05-31  3:07 ` [PATCH v2] " stardiviner
  0 siblings, 2 replies; 9+ messages in thread
From: stardiviner @ 2020-05-30  2:03 UTC (permalink / raw)
  To: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


When I have a source block (The "|" represents the point):

#+begin_src sh :eval no
chrome --remote-debugging-port
|

#+end_src

Then press =[C-c C-v d]=, it becomes like this:

#+begin_src sh :eval no
chrome --remote-debugging-port
#+end_src

#+begin_src
sh :eval no

#+end_src

- -- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7RvwkUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPWigf+NOP4j0/9U3YvhHhdAmNbrLiNa+My
NsN7msj1uSwwgtyKccaDOmB4mRMoKxhdK3TMn55LmKj+xsJY54EQ35Oq2G4HsJYX
kbypfoj09NNjE4R7Qw7IyAbr7cLkITPbp+9UCDX+lupyNGsKDmkDtrl84JG/Lnxs
jp5FuKBzeG2P7dR8Zs8TFPZOzzPP4jQKnUgfghRcgLNxxJXX2CPge5+cAKiDQFoh
yQCXdd9cFbldnethRjQb6GrlylBcCaHe41AuKrXAdn2gmv1gPLNb1perJ/TCyw3x
ZQy554ZI8dOL1jH4lL5JmGxwWcgMq4qahdhUlfSCEzZKgjKqTtVTdBJYwg==
=qwc/
-----END PGP SIGNATURE-----


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

* Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-05-30  2:03 [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block' stardiviner
@ 2020-05-30 20:57 ` Berry, Charles via General discussions about Org-mode.
  2020-05-31  3:02   ` [PATCH] " stardiviner
  2020-05-31  3:07 ` [PATCH v2] " stardiviner
  1 sibling, 1 reply; 9+ messages in thread
From: Berry, Charles via General discussions about Org-mode. @ 2020-05-30 20:57 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode



> On May 29, 2020, at 7:03 PM, stardiviner <numbchild@gmail.com> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> 
> When I have a source block (The "|" represents the point):
> 
> #+begin_src sh :eval no
> chrome --remote-debugging-port
> |
> 
> #+end_src
> 
> Then press =[C-c C-v d]=, it becomes like this:
> 
> #+begin_src sh :eval no
> chrome --remote-debugging-port
> #+end_src
> 
> #+begin_src
> sh :eval no
> 
> #+end_src
> 
> - --

Exactly. Commit 5f0a9cca3 adds a `\n' in line 1911 that should have been a space. 

Chuck

[snip]


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

* [PATCH] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-05-30 20:57 ` Berry, Charles via General discussions about Org-mode.
@ 2020-05-31  3:02   ` stardiviner
  0 siblings, 0 replies; 9+ messages in thread
From: stardiviner @ 2020-05-31  3:02 UTC (permalink / raw)
  To: Berry, Charles; +Cc: Org Mode


[-- Attachment #1.1: Type: text/plain, Size: 707 bytes --]


Berry, Charles <ccberry@health.ucsd.edu> writes:

>> On May 29, 2020, at 7:03 PM, stardiviner <numbchild@gmail.com> wrote:
>> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>> 
>> 
>> When I have a source block (The "|" represents the point):
>> 
>> #+begin_src sh :eval no
>> chrome --remote-debugging-port
>> |
>> 
>> #+end_src
>> 
>> Then press =[C-c C-v d]=, it becomes like this:
>> 
>> #+begin_src sh :eval no
>> chrome --remote-debugging-port
>> #+end_src
>> 
>> #+begin_src
>> sh :eval no
>> 
>> #+end_src
>> 
>> - --
>
> Exactly. Commit 5f0a9cca3 adds a `\n' in line 1911 that should have been a space. 
>

Thanks! I just did a small patch to fix this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-fix-5f0a9cca3.patch --]
[-- Type: text/x-patch, Size: 811 bytes --]

From af210eeb78d7611aeb7b6d1a99433cee10e53186 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sun, 31 May 2020 10:59:41 +0800
Subject: [PATCH] fix 5f0a9cca3

---
 lisp/ob-core.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e554e3934..79937e517 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
 			(if (looking-at "^") "" "\n")
 			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
 			(if arg stars indent) "\n"
-			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
+			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
 			lang
 			(if (> (length headers) 1)
 			    (concat " " headers) headers)
-- 
2.26.2


[-- Attachment #1.3: Type: text/plain, Size: 281 bytes --]


> Chuck
>
> [snip]


-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

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

* [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-05-30  2:03 [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block' stardiviner
  2020-05-30 20:57 ` Berry, Charles via General discussions about Org-mode.
@ 2020-05-31  3:07 ` stardiviner
  2020-05-31 16:47   ` Matthew Lundin
  1 sibling, 1 reply; 9+ messages in thread
From: stardiviner @ 2020-05-31  3:07 UTC (permalink / raw)
  Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 38 bytes --]


I updated the patch commit message.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-fix-5f0a9cca3-missing-space.patch --]
[-- Type: text/x-patch, Size: 916 bytes --]

From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sun, 31 May 2020 10:59:41 +0800
Subject: [PATCH] fix 5f0a9cca3 missing space

* lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
with missing space.
---
 lisp/ob-core.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e554e3934..79937e517 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
 			(if (looking-at "^") "" "\n")
 			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
 			(if arg stars indent) "\n"
-			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
+			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
 			lang
 			(if (> (length headers) 1)
 			    (concat " " headers) headers)
-- 
2.26.2


[-- Attachment #1.3: Type: text/plain, Size: 1510 bytes --]


stardiviner <numbchild@gmail.com> writes:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
> When I have a source block (The "|" represents the point):
>
> #+begin_src sh :eval no
> chrome --remote-debugging-port
> |
>
> #+end_src
>
> Then press =[C-c C-v d]=, it becomes like this:
>
> #+begin_src sh :eval no
> chrome --remote-debugging-port
> #+end_src
>
> #+begin_src
> sh :eval no
>
> #+end_src
>
> - -- 
> [ stardiviner ]
>        I try to make every word tell the meaning that I want to express.
>
>        Blog: https://stardiviner.github.io/
>        IRC(freenode): stardiviner, Matrix: stardiviner
>        GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
> -----BEGIN PGP SIGNATURE-----
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7RvwkUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsPWigf+NOP4j0/9U3YvhHhdAmNbrLiNa+My
> NsN7msj1uSwwgtyKccaDOmB4mRMoKxhdK3TMn55LmKj+xsJY54EQ35Oq2G4HsJYX
> kbypfoj09NNjE4R7Qw7IyAbr7cLkITPbp+9UCDX+lupyNGsKDmkDtrl84JG/Lnxs
> jp5FuKBzeG2P7dR8Zs8TFPZOzzPP4jQKnUgfghRcgLNxxJXX2CPge5+cAKiDQFoh
> yQCXdd9cFbldnethRjQb6GrlylBcCaHe41AuKrXAdn2gmv1gPLNb1perJ/TCyw3x
> ZQy554ZI8dOL1jH4lL5JmGxwWcgMq4qahdhUlfSCEzZKgjKqTtVTdBJYwg==
> =qwc/
> -----END PGP SIGNATURE-----


-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

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

* Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-05-31  3:07 ` [PATCH v2] " stardiviner
@ 2020-05-31 16:47   ` Matthew Lundin
  2020-06-01  0:43     ` stardiviner
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Lundin @ 2020-05-31 16:47 UTC (permalink / raw)
  To: numbchild; +Cc: emacs-orgmode

stardiviner <numbchild@gmail.com> writes:

> I updated the patch commit message.
>
> From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
> From: stardiviner <numbchild@gmail.com>
> Date: Sun, 31 May 2020 10:59:41 +0800
> Subject: [PATCH] fix 5f0a9cca3 missing space
>
> * lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
> with missing space.
> ---
>  lisp/ob-core.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
> index e554e3934..79937e517 100644
> --- a/lisp/ob-core.el
> +++ b/lisp/ob-core.el
> @@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
>  			(if (looking-at "^") "" "\n")
>  			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
>  			(if arg stars indent) "\n"
> -			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
> +			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
>  			lang
>  			(if (> (length headers) 1)
>  			    (concat " " headers) headers)
> -- 
> 2.26.2
>

I think you also need to replace the newline with a space in the upper
case version.

Matt


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

* Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-05-31 16:47   ` Matthew Lundin
@ 2020-06-01  0:43     ` stardiviner
  2020-06-01  1:12       ` Matthew Lundin
  0 siblings, 1 reply; 9+ messages in thread
From: stardiviner @ 2020-06-01  0:43 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Matthew Lundin <mdl@imapmail.org> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> I updated the patch commit message.
>>
>> From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
>> From: stardiviner <numbchild@gmail.com>
>> Date: Sun, 31 May 2020 10:59:41 +0800
>> Subject: [PATCH] fix 5f0a9cca3 missing space
>>
>> * lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
>> with missing space.
>> ---
>>  lisp/ob-core.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
>> index e554e3934..79937e517 100644
>> --- a/lisp/ob-core.el
>> +++ b/lisp/ob-core.el
>> @@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
>>  			(if (looking-at "^") "" "\n")
>>  			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
>>  			(if arg stars indent) "\n"
>> -			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
>> +			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
>>  			lang
>>  			(if (> (length headers) 1)
>>  			    (concat " " headers) headers)
>> -- 
>> 2.26.2
>>
>
> I think you also need to replace the newline with a space in the upper
> case version.
>

Supposed there is \n after #+end_src. I also checked the original version before
that change commit. The original has an newline. I write patch by comparing
before and after (side by side).

- -- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7UT0kUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOt0ggAtPk/dBaarsrRZOLJaN3SUtMeeIUM
BVdY5194hxKVYSxGtvAZDEi4MimfUgBzuXfaytYlVDeBxd1ShBbaoRNecqzlvaLm
qUAvI3S1ALJKfE4NKZrGwmZAbYdSE1OlJrhNz5IZ5xuJRWIz/ssJyVNhXbwwXy5o
QIbKxdzFdQ1g1iEYJOJS6U7yv2glmLkjgqmosMmFoJCA9Qrup898drdeOqwtUM9n
dmy5uehZonZ0bQpyr6Y09jrWj9fsDD53noZH2K1J2LeHYtf5TMrL+mxMRBSuK8SP
BgfwPqz9mYh1/YQzgYfB0s+J/zT1oBzD08WHHmqxbtM0sOc4ixkv7xszIg==
=r+5b
-----END PGP SIGNATURE-----


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

* Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-06-01  0:43     ` stardiviner
@ 2020-06-01  1:12       ` Matthew Lundin
  2020-06-01  7:32         ` [PATCH v3] " stardiviner
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Lundin @ 2020-06-01  1:12 UTC (permalink / raw)
  To: numbchild; +Cc: emacs-orgmode

stardiviner <numbchild@gmail.com> writes:

> Matthew Lundin <mdl@imapmail.org> writes:
>
>>
>> I think you also need to replace the newline with a space in the upper
>> case version.
>>
> Supposed there is \n after #+end_src. I also checked the original version before
> that change commit. The original has an newline. I write patch by comparing
> before and after (side by side).

I'm referring to this line in the patch:

                        indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
                                                             ^

The newline that needs to be removed is indicated by "^".

You can see a correct similar version of this line on line 1932 of
ob-core.el.

The original line the problematic commit replaced would also have had a
space in both, since it called either downcase or upcase on the string
"#+begin_src ".

Best,

Matt


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

* [PATCH v3] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-06-01  1:12       ` Matthew Lundin
@ 2020-06-01  7:32         ` stardiviner
  2020-06-01 13:50           ` Bastien
  0 siblings, 1 reply; 9+ messages in thread
From: stardiviner @ 2020-06-01  7:32 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1019 bytes --]


Matthew Lundin <mdl@imapmail.org> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> Matthew Lundin <mdl@imapmail.org> writes:
>>
>>>
>>> I think you also need to replace the newline with a space in the upper
>>> case version.
>>>
>> Supposed there is \n after #+end_src. I also checked the original version before
>> that change commit. The original has an newline. I write patch by comparing
>> before and after (side by side).
>
> I'm referring to this line in the patch:
>
>                         indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
>                                                              ^
>
> The newline that needs to be removed is indicated by "^".
>
> You can see a correct similar version of this line on line 1932 of
> ob-core.el.
>
> The original line the problematic commit replaced would also have had a
> space in both, since it called either downcase or upcase on the string
> "#+begin_src ".

You're right, I updated the patch now. I really missed seeing that. :)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-PATCH-fix-5f0a9cca3-missing-space.patch --]
[-- Type: text/x-patch, Size: 922 bytes --]

From 67b11b793d4ce45c75f5874571434c8a769ed7f3 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Mon, 1 Jun 2020 08:44:22 +0800
Subject: [PATCH] [PATCH] fix 5f0a9cca3 missing space

* lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
with missing space.
---
 lisp/ob-core.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e554e3934..e798595bd 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
 			(if (looking-at "^") "" "\n")
 			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
 			(if arg stars indent) "\n"
-			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
+			indent (if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
 			lang
 			(if (> (length headers) 1)
 			    (concat " " headers) headers)
-- 
2.26.2


[-- Attachment #1.3: Type: text/plain, Size: 282 bytes --]


>
> Best,
>
> Matt


-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

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

* Re: [PATCH v3] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'
  2020-06-01  7:32         ` [PATCH v3] " stardiviner
@ 2020-06-01 13:50           ` Bastien
  0 siblings, 0 replies; 9+ messages in thread
From: Bastien @ 2020-06-01 13:50 UTC (permalink / raw)
  To: stardiviner; +Cc: Matthew Lundin, emacs-orgmode

stardiviner <numbchild@gmail.com> writes:

> You're right, I updated the patch now. I really missed seeing
> that. :)

Applied, thanks!

-- 
 Bastien


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

end of thread, other threads:[~2020-06-01 13:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30  2:03 [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block' stardiviner
2020-05-30 20:57 ` Berry, Charles via General discussions about Org-mode.
2020-05-31  3:02   ` [PATCH] " stardiviner
2020-05-31  3:07 ` [PATCH v2] " stardiviner
2020-05-31 16:47   ` Matthew Lundin
2020-06-01  0:43     ` stardiviner
2020-06-01  1:12       ` Matthew Lundin
2020-06-01  7:32         ` [PATCH v3] " stardiviner
2020-06-01 13:50           ` Bastien

Code repositories for project(s) associated with this 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).