6

When I change the state of a TODO item in Org-Agenda (i.e., by hitting t), it repositions the buffer so that that item is at the top of the screen.

I don't want it to do that — I'd rather just keep the buffer where it is (so I can see the entire day view, for example).

Is this configurable?

8
  • I can't seem to replicate this behavior. Can you give an example? Oct 26, 2014 at 17:41
  • @SeanAllred Sure. In /tmp/x.org, add a TODO scheduled for today. Start org-agenda and add /tmp/x.org to org-agenda-files with C-c [. Then refresh the agenda with g to see the TODO. Change its state with t and you'll see the buffer reposition. I did this with a minimal .emacs.d/init.el and still see the same behavior.
    – JohnJ
    Oct 26, 2014 at 19:31
  • I do not see it :( dl.dropboxusercontent.com/u/17471132/tmp.mov Oct 26, 2014 at 19:38
  • What's your org-version?
    – Malabarba
    Oct 26, 2014 at 19:47
  • Wow @seanallred, you really don't. Interesting. Here's my version: dropbox.com/s/j2si3x3zb5wq3qv/ScreenFlow.mov?dl=0. Mine is Emacs.app on OS-X, Emacs 24.3, using the pre-installed version of org-mode (haven't been able to determine which version beyond that, yet).
    – JohnJ
    Oct 26, 2014 at 19:50

1 Answer 1

2

This has been fixed as of Org version 8.2.6.

It was changed in this commit:

6ba3b2 2014-03-18 19:54:02
org-agenda.el (org-agenda-todo): Restore the window correctly

* org-agenda.el (org-agenda-todo): Always restore the window
state after `org-agenda-change-all-lines' has been called.

`org-agenda-change-all-lines' is narrowing to the line it needs to
update.  In the narrowed state, `org-agenda-finalize' is called,
which may lead to a change in the way the window is displayed.  We
use `save-window-excursion' to ensure the window state is restored
correctly.

Thanks to Francesco Pizzolante for reporting this with a
detailed recipe.

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 54529d4..e20a55e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8792,7 +8792,7 @@ the same tree node, and the headline of ...
    (org-back-to-heading)
    (move-marker org-last-heading-marker (point))))
       (beginning-of-line 1)
-      (save-excursion
+      (save-window-excursion
  (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
       (when (org-bound-and-true-p org-clock-out-when-done)
          (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))

If you don't want to update, simply apply the patch above. It's only one line.

3
  • Thanks! I suppose I could just live dangerously and try an update....
    – JohnJ
    Oct 26, 2014 at 23:18
  • I, too, like to live dangerously. Go for it—if you don't do anything exceptional with it, you likely won't notice a change. (It now has a fantastic system for exporting, though.) Oct 26, 2014 at 23:43
  • 1
    Took the plunge. So far so good. I did hit the org-with-silent-modifications bug as described here[1], but it was quickly resolved. [1] stackoverflow.com/questions/18291114/…
    – JohnJ
    Oct 29, 2014 at 2:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.