emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: org-agenda-overriding-columns-format destroyed on revert [9


From: Allen Li
Subject: Re: [O] Bug: org-agenda-overriding-columns-format destroyed on revert [9.2.1 (9.2.1-2-gc6d37c-elpaplus)]
Date: Wed, 13 Feb 2019 09:11:07 +0000

On Wed, Feb 13, 2019 at 8:37 AM Allen Li <address@hidden> wrote:
>
> I'm suspicious of org-agenda-mode -> kill-all-local-variables=
>
> One oddity is that repeatedly reverting the buffer swaps between the
> "correct" overriding column format and the default.

It seems like what is happening is that the org-agenda-prepare and
org-agenda-finalize calls in org-tags-view are swapping
org-agenda-overriding-columns-format (ocf) on and off.  I added debug
messages around these points, and a cycle looks like:

@@@@@@@ before prepare "%TODO %60ITEM %SCHEDULED"
@@@@@@@ after prepare "%TODO %60ITEM %SCHEDULED"
@@@@@@@ before finalize "%TODO %60ITEM %SCHEDULED"
@@@@@@@ after finalize "%TODO %60ITEM %SCHEDULED"
@@@@@@@ before prepare "%TODO %60ITEM %SCHEDULED"
@@@@@@@ after prepare nil
@@@@@@@ before finalize nil
@@@@@@@ after finalize nil

During the first cycle, prepare doesn't unset the local value for ocf
because it's not set, then in finalize the local value of ocf is set
using the current dynamic value.

During the second cycle, ocf is set locally so prepare wipes the local
value.  It looks like this also wipes the current let-bound dynamic
value for ocf, so during finalize ocf is not (re)set as a local value.

Go back to first cycle.

I don't see an easy good fix due to how Emacs's dynamic variable
binding works with respect to buffer local variables.

One way to fix is redefine:

(defun org-let (list &rest body)
  (eval `(with-temp-buffer ,(cons 'let (cons list body)))))

That way, the let doesn't use the buffer local value for ocf, so the
kill-all-local-variables doesn't wipe it.

I can confirm that this fixes this bug.  However, I have no idea what
effect this may have on all of Org mode.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]