Closed brabalan closed 9 years ago
So, it does. As a workaround you could break the #begin_src
using two strings and a concat
. Clearly I need a start-of-line anchor somewhere.
Thank you for the suggestion, I'll give it a try.
I tried this when I got the bug report and, indeed, everything was as you say. Now I get some time to fix and, of course, I find it completely impossible to replicate.
Using the "better to guess than test" approach to development, I have pushed a potential fix up to this branch.
fix/orgel-stringed-delimitor
Could you see if it addresses your issue for me?
Failing that, can you tell me which version of lentic, and send me a complete (but minimal) example please and a set of steps that I need to do to cause the problem.
I'm pleased it's working well on 3000+ of config! Ironically, I haven't done my config yet, but it needs it.
This was tricky to reproduce, but I think I got it. I'm using the current version from Melpa, with your fix installed (I manually added the anchors, byte-compiled the file, and restarted emacs).
Here is an ECM:
;;; lentic_test --- testing it
;;; Code:
;; ** a subsection
;; #+begin_src emacs-lisp
(message "foo")
;; #+end_src
;; ** testing commented code
;; #+begin_src emacs-lisp
(setq org-structure-template-alist
(quote (("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
("e" "#+begin_example\n?\n#+end_example" "<example>\n?\n</example>")
("I" "#+include %file ?" "<include file=%file markup=\"?\">"))))
;; #+end_src
;; # Local Variables:
;; # lentic-init: lentic-orgel-org-init
;; # End:
To trigger the problem, generate the org buffer, go to it, and delete the line with begin_example
in it (using C-k
). Alternatively, you can copy a heading line and paste it (still in the org buffer), or copy a line and paste it.
I found that typing enter
in the second code block trigger the problem, but not in the first code block. However, typing text, or enter outside of code blocks, works fine.
Do you see the same thing?
Yes, I can confirm this works (or rather breaks). It only happens when you change the second block because lentic is doing incremental updates -- so it has to be the same block. Why it is happening at all, I do not know, but now I have a clean test case, I am sure that I can work it out.
It may take a while. Rather work spammed at the moment!
Can you repull fix/orgel-string-delimitor and try again?
Turns out my "find the start/stop" markers logic was a real mess. Once I fixed that, it's a one-character change!
Anyway, let me know.
It's working great, thanks a lot.
Lentic works great with my 3400 lines init.el file, but there are two places where it gets confused:
and another similar place (some code to surround a region with source markers).
By "gets confused", I mean that the org buffer is created correctly, but as soon as I edit the org buffer, the code above gets commented out, as if the "end_src" in the code indicated the end of the code block.