0

Since recently, whenever I refresh *ORG Agenda* with the "r" key (org-agenda-redo), the buffer will scroll up by 1 line, even if the buffer has not changed (best shown by hitting "r" repeatedly).

I'm not sure whether this is due to an org-mode update or some configuration modification on my side (notably visual-line-mode), but going back on those changes doesn't help.

Could anybody give me some pointers to what I could investigate?

Alternatively, is there a workaround to reposition the buffer after redo exactly as it was?

uselpa
  • 131
  • 7
  • Try starting emacs with `emacs -q` and see if you can reproduce it. If you cannot, your init file is at fault: bisect it to figure out who the culprit is. If you *can*, submit a bug report: `M-x org-submit-bug-report`. – NickD Aug 07 '21 at 13:37
  • @NickD No I cannot reproduce it w/o my init file. I did submit a bug report but I haven't heard back yet. What does "bisect" refer to in this context? – uselpa Aug 07 '21 at 14:39
  • OK, the culprit is visual-line-mode when active in the agenda buffer. But manually disabling afterwards it doesn't help either. – uselpa Aug 07 '21 at 15:05
  • 1
    "Bisecting" is a systematic process to finger the problematic portion of the init file. You comment out (roughly) half of your init file and see if the problem persists: if it does, the uncommented half is at fault, otherwise the other half is at fault. Lather, rinse, repeat until you have a small enough portion (maybe a single line) that causes the problem. It is a logarithmic process and therefore very fast, but you have to be organized. – NickD Aug 07 '21 at 15:31
  • 1
    Help debugging: https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems – Tyler Aug 07 '21 at 16:26

1 Answers1

1

How do you turn on visual-line-mode? If you turn it on globally, you might want to turn it off in org-agenda buffers, by using the mode hook:

(defun turn-off-visual-line-mode ()
   (visual-line-mode -1))

(add-hook `org-agenda-mode-hook #'turn-off-visual-line-mode)

The idea is that if it is turned off before the agenda buffer is populated, then the incompatibility will not arise.

Untested, so caveat emptor.

NickD
  • 27,023
  • 3
  • 23
  • 42
  • I used `(global-visual-line-mode)` to turn it on globally. Unfortunately your solution didn't work, so I went the other way round, i.e. turning on visual line mode for org buffers only using org-mode-hook, and that works as intended. Thanks for the pointers! – uselpa Aug 07 '21 at 18:45
  • I'll take your word for it but. for the life of me, I don't understand why that doesn't work. OTOH, I cannot reproduce your problem (either with `visual-line-mode` turned off or globally turned on even in agenda), so I'm not sure what's going on. – NickD Aug 07 '21 at 23:56
  • 1
    Sorry I can't pinpoint the problem directly, but your idea helped me solve it so thank you very much for that! I do need to improve my emacs-fu so I'll stick around some more. – uselpa Aug 08 '21 at 07:42