Skip to main content

Timeline for `fill-paragraph` prevent breaking

Current License: CC BY-SA 4.0

7 events
when toggle format what by license comment
Aug 22, 2023 at 11:24 history edited dalanicolai CC BY-SA 4.0
Add comment about 'faulty solution'
Aug 22, 2023 at 6:22 comment added Tobias @Josh Please try your test with my-in-dd-display from my answer. I did it and it worked for me.
Aug 21, 2023 at 11:04 comment added Tobias @dalanicolai Don't mess up current point though the first search for >>. The version in my comment above solves two problems: 1st it accepts partial input, i.e., it does not insert line breaks if the user has already typed in <<dd_display: before point without closing the tag yet. 2nd: Your code also avoids filling when there is a complete tag behind point, i.e., xPoint here <<dd_display: complete tag here>>.
Aug 21, 2023 at 7:31 comment added dalanicolai @Josh I am not sure what you mean, because to me, it looks like my code works fine on your example. Maybe you can add the example to your question, including the expected result? Thanks!
Aug 20, 2023 at 18:39 comment added Josh These are great - but they fail if I have multiple <<dd_display: ... >> in a single paragraph. Can this be modified to search forward for >> before <<dd_display and search backwards for <<dd_display: before >>? E.g., if I have this string: dfksfksf fskdfdklsfkdskf akfksalk akd akldka sjdkj kljdaksjk dla <<dd_display: abc def>> fdsjkfljds fjdksljflsd <<dd_display: fdskfds>> fsdjkflsd with fill-column set to 80.
Aug 20, 2023 at 6:20 comment added Tobias Consider: (defun fillp () "Don't break lines in Inline Stata Dynamic Tags." (save-excursion (save-match-data (and (re-search-backward ">>\\|\\(<<dd_display:\\)" (line-beginning-position) t) (match-beginning 1)))))
Aug 19, 2023 at 20:47 history answered dalanicolai CC BY-SA 4.0