alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.33k stars 107 forks source link

Wrong parent headers #231

Closed haji-ali closed 9 months ago

haji-ali commented 1 year ago

I believe there's a bug in org-super-agenda--when-with-marker-buffer that results in the wrong parent headers (among other issues) when there's a restriction on the org buffer associated with the agenda. The reason is that the buffer is not widen'ed before calling goto-char. To resolve this, consider this patch.

diff --git a/org-super-agenda.el b/org-super-agenda.el
index 9e665cd..fad3436 100644
--- a/org-super-agenda.el
+++ b/org-super-agenda.el
@@ -237,7 +237,7 @@ considerable, depending on the number of items."
     `(let ((,marker ,form))
        (when (markerp ,marker)
          (with-current-buffer (marker-buffer ,marker)
-           (save-excursion
+           (org-with-wide-buffer
              (goto-char ,marker)
              ,@body))))))
alphapapa commented 1 year ago

Thanks for the report. I'll take a look at this when I have time.

alphapapa commented 9 months ago

Finally fixed. Thanks.