Fork me on GitHub

I'm editing I am editing a codeblock. I popped up a spcial buffer ot edit the codeblock (to get all the right major modes). Now, I want to add an item back to -- is there a way to do this without leaving my "special" buffer [which is editing a code-block region of] ?


if you save your special buffer, it'll save the changes you've made into the parent org file, if that's your question?


or do you want to edit a part of the org file that's not being edited in the "special" buffer?


I should clarify, I want to add TODO item back to, while I'm editing a doe-block of


@qqq what exactly are you trying to achieve? If you popped-up 'edit special' buffer, do you want to “save” the progress or something?


1. I'm in 2. I'm editing a #+begin_src #+end_src block in, in a separate buffer. 3. I think of a new todo item. 4. I want to add this new TODO item to without leaving my current special buffer.


idk if there’s a generic solution to this. your file could be formatted in different ways and even have different TODO/DONE statuses defined. where would the default position to add the item be?


looks like the last element on org-src-babel-info is the position of the source code on the org buffer. maybe you can write a fn to do what you want using this


@qqq (pop-to-buffer (marker-buffer (car (last org-src-babel-info)))) would send you to the org buffer you came from, maybe this helps


it won’t change its pointer position (if you moved it after going to the src buffer, for example) tho, so you’d have to write a function that would insert the TODO on the right position no matter where your pointer is initially


and then pop back to the source buffer


(let ((src-buffer (current-buffer)))
  (pop-to-buffer (marker-buffer (car (last org-src-babel-info))))
  (message "Your fn to add the TODO item here. Will be evaluated on the org buffer")
  (pop-to-buffer src-buffer))