From: Nathaniel Nicandro <nathanielnicandro@gmail.com>
To: Daniel Ortmann <daniel.ortmann@oracle.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: clocktable error in org-agenda [9.2.2 (release_9.2.2-245-g9d7b1e @ /home/dortmann/src/git-org-mode/lisp/)]
Date: Sat, 09 Mar 2019 00:17:55 -0600 [thread overview]
Message-ID: <m2ef7go9kc.fsf@gmail.com> (raw)
In-Reply-To: <d8b59474-79d5-cfff-a829-2f7952bcd179@oracle.com> (Daniel Ortmann's message of "Tue, 5 Mar 2019 12:49:36 -0600")
I am also experiencing this issue. I'm assuming =org-agenda-sticky= is set to
=t= in your configuration since that is what I have in mine.
I've tracked the problem down to (1) the handling of =org-agenda-sticky= in
=org-agenda-goto-date=, (2) how this affects what =org-agenda-mode= (called by
=org-agenda-redo=) does with =org-agenda-local-vars=, and (3) the subsequent
modification of variables in =org-agenda-local-vars= before another call to
=org-agenda-redo=.
1. =org-agenda-goto-date= temporarily sets =org-agenda-sticky= to =nil= before
it calls =org-agenda-redo=.
2. None of the variables in =org-agenda-local-vars= are made buffer local when
=org-agenda-redo= calls =org-agenda-mode= during the call to
=org-agenda-goto-date=.
3. Setting one of the variables in =org-agenda-local-vars= after (2) happens
actually sets its global value instead of its local value. So, for example,
calling =org-agenda-log-mode= will set the global value of
=org-agenda-show-log= to =t=. Once =org-agenda-redo= is called, it will
once again be a local variable, but now the default global value is =t=.
The main reason why log mode stays on when you try to toggle it off is because
the =reset-saved= function in =org-agenda-mode= (which restores the saved
values of =org-agenda-local-vars= after all local variables have been killed
and re-made as local variables) does not set the value of any local variable
whose saved value is =nil=.
Since the local value of =org-agenda-show-log= is =nil= when you try to
toggle log mode off, its buffer local value is not reset to =nil= by
=reset-saved=. This means that it keeps the default global value it had
when it was made into a local variable and this value is now =t= due to
(3).
So I think the main issue here is that =org-agenda-goto-date= does not
handle =org-agenda-sticky= correctly since none of the
=org-agenda-local-vars= are turned back into local variables during
=org-agenda-redo= when =org-agenda-sticky= is =t=.
Another possible issue is that the =reset-saved= function in
=org-agenda-mode= does not set the value of variables if they are =nil=, but
this is not an issue if the variables it resets are guaranteed to always
have a global default of =nil=.
I haven't looked into why =org-agenda-goto-date= needs to temporarily
set =org-agenda-sticky= to =nil. Maybe someone can answer that, but a
solution until that gets figured out is to allow =reset-saved= to set
=nil= values.
- Nathaniel
prev parent reply other threads:[~2019-03-09 6:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-04 21:22 Bug: clocktable error in org-agenda [9.2.2 (release_9.2.2-245-g9d7b1e @ /home/dortmann/src/git-org-mode/lisp/)] Daniel Ortmann
2019-03-04 21:40 ` Daniel Ortmann
2019-03-05 1:02 ` Bernt Hansen
2019-03-05 18:49 ` Daniel Ortmann
2019-03-09 6:17 ` Nathaniel Nicandro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2ef7go9kc.fsf@gmail.com \
--to=nathanielnicandro@gmail.com \
--cc=daniel.ortmann@oracle.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).