1

Despite I am not a new Emacs user, my elisp is nearly not existent.

I want to present some REST API stuff with epresent and org babel restclient. This is working fine until I want to edit a source block (request) inline during the presentation.

You can reproduce this by using the following org structure

* Testitem
#+begin_src restclient

#Get URL:
GET https://www.bing.com

#+end_src

I tried to disable electric indent mode in my init.el to check if this is the reason, but no luck.

(electric-indent-local-mode -1)

If I call the edit function (I need to change an URL param, due to preceding requests within the presentation) and confirm the edit with C-c ', the code is indented by 2 spaces and the source snippet is not shown/working anymore in epresent hereafter. It changed to:

* Testitem
#+begin_src restclient

  #Get URL:
  GET https://www.bing.com

#+end_src

Which is then not shown anymore and thus also not executable within epresent.

Can anyone point me to the reason for the indentation of the restclient source block and how to disably this?

1 Answer 1

3

Org mode indents code in src blocks by 2 spaces by default. To change this you can set org-edit-src-content-indentation to 0 for no indentation.

Alternatively changing org-src-preserve-indentation to t may also achieve what you want to do.

Some description of indentation behaviour is in this part of the manual.

1
  • ok thx - this fixed the indentation. But somehow there seems to be a screen updating issue. The command block is still disappearing after the edit. I need to press "g" to refresh. epresent uses org-edit-src from org. Standard edits update correctly.
    – Plurax
    Nov 12, 2019 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.