alphapapa / org-super-agenda

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

Wrong parent headers #231

Closed haji-ali closed 1 year ago

haji-ali commented 2 years 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 2 years ago

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

alphapapa commented 1 year ago

Finally fixed. Thanks.