emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-babel-demarcate-block doesn't respect case preference
@ 2020-05-23 13:32 Vladimir Alexiev
  2020-05-23 13:59 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Alexiev @ 2020-05-23 13:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

org-babel-uppercase-example-markers says whether to insert BEGIN_SRC or
begin_src.

org-babel-demarcate-block doesn't respect this setting:
https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-core.el#L1893
makes this check

(lower-case-p (and block
  (let (case-fold-search)
    (string-match-p "#\\+begin_src" block)))))

which sets  lower-case-p only if it's inside an existing lowercase block
(i.e. when splitting a block).
Otherwise (when demarcating the region) it goes with uppercase.

[-- Attachment #2: Type: text/html, Size: 1050 bytes --]

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

* Re: org-babel-demarcate-block doesn't respect case preference
  2020-05-23 13:32 org-babel-demarcate-block doesn't respect case preference Vladimir Alexiev
@ 2020-05-23 13:59 ` Bastien
  2020-05-25  7:41   ` Vladimir Alexiev
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2020-05-23 13:59 UTC (permalink / raw)
  To: Vladimir Alexiev; +Cc: emacs-orgmode

Hi Vladimir,

Vladimir Alexiev <vladimir.alexiev@ontotext.com> writes:

> org-babel-uppercase-example-markers says whether to insert BEGIN_SRC
> or begin_src.

Not really, it says whether to insert BEGIN_EXAMPLE or begin_example.

FWIW I think we should stick to the convention that Org inserts
lower-case #+begin* keywords as a default, but still matches
upper-case occurrences for backward compatibility when needed.

-- 
 Bastien


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

* Re: org-babel-demarcate-block doesn't respect case preference
  2020-05-23 13:59 ` Bastien
@ 2020-05-25  7:41   ` Vladimir Alexiev
  2020-05-25 10:24     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Alexiev @ 2020-05-25  7:41 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 131 bytes --]

>  Org inserts lower-case #+begin* keywords as a default

But  org-babel-demarcate-block doesn't do that in the case of new block.

[-- Attachment #2: Type: text/html, Size: 192 bytes --]

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

* Re: org-babel-demarcate-block doesn't respect case preference
  2020-05-25  7:41   ` Vladimir Alexiev
@ 2020-05-25 10:24     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2020-05-25 10:24 UTC (permalink / raw)
  To: Vladimir Alexiev; +Cc: emacs-orgmode

Hi Vladimir,

Vladimir Alexiev <vladimir.alexiev@ontotext.com> writes:

>>  Org inserts lower-case #+begin* keywords as a default
>
> But  org-babel-demarcate-block doesn't do that in the case of new
> block.

Indeed, I pushed a fix to master so that org-babel-demarcate-block
insert lower-case keywords, unless upper-case ones are required.

Thanks,

-- 
 Bastien


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

end of thread, other threads:[~2020-05-25 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 13:32 org-babel-demarcate-block doesn't respect case preference Vladimir Alexiev
2020-05-23 13:59 ` Bastien
2020-05-25  7:41   ` Vladimir Alexiev
2020-05-25 10:24     ` Bastien

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