Here is a new patch. I have addressed your concerns (except not sure how to test narrowing)
1. changed the summary of the patch 2. added tests for BEG END parameters 3. rewrote tests to make sure that all corner cases are tested hopefully this will finally make it, thank you again Ihor On Thu, Aug 7, 2025 at 10:43 AM Ihor Radchenko <yanta...@posteo.net> wrote: > Ihor Radchenko <yanta...@posteo.net> writes: > > dmg <d...@turingmachine.org> writes: > > > I am sorry I wasted your time. Please see attached. > > > > 1. I have reworded and reformatted the commit log > > > > 2. I have added TINYCHANGE > > > > 3. For the test, I have corrected the local function, and instead of > using > > point, I am extracting the first few characters of each headline. It > makes > > it easier to create new tests. Thank you for the suggestion > > Thanks! > > >> + (let > >> + ;; org-map-region does not return anything so we need to > > > > `org-map-region' > > You forgot to address this comment. > > > Subject: [PATCH] org.el: make `org-map-region' properly set point at > first > > heading > > I suggest emphasizing more that it is a bugfix: > org-map-region: Fix not setting point at `bol' at the first visited heading > > > +(ert-deftest test-org/map-region () > > + "Test `org-map-region'." > > Since you are trying to test the whole function, it will make sense to > test BEG end END arguments as well. Not just tests scanning the whole > buffer. > > > + (equal (list "* Lev" "** Le" "* Lev" "** Le") > > + (org-test-with-temp-text " > > +:PROPERTIES: > > +:ID: some-id > > +:END: > > +* Level 1 > > + > > +Some text > > + > > +** Level 2 > > + > > +More text > > + > > +* Level 1 again > > + > > +** Level 2 again > > I do not think that we need that many test cases. > Maybe 1 for mapping the whole buffer and extra for testing BEG/END > arguments and maybe narrowing. > > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at <https://orgmode.org/>. > Support Org development at <https://liberapay.com/org-mode>, > or support my work at <https://liberapay.com/yantar92> > -- --dmg --- D M German http://turingmachine.org
0001-org.el-make-org-map-region-properly-set-point-at-fir.patch
Description: Binary data