Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global-auto-revert-non-file-buffers may cause unintended buffer reverting #52

Open
manphiz opened this issue Mar 16, 2024 · 6 comments
Open
Assignees
Labels
compatibility discussion documentation Improvements or additions to documentation invalid This doesn't seem right
Milestone

Comments

@manphiz
Copy link

manphiz commented Mar 16, 2024

Activities version: 0.7
Emacs version: 29.2

In certain cases the cursor may jump to previous location when activities is active. This happens most frequently in cases when another window is opened in the same frame from a previous selection of the current window, e.g. in buffer list or Gnus summary page.

For example, I am in the buffer list window, and I select buffer A and A was opened in a new window in the same frame, and I move cursor to buffer B in the buffer list. After a few seconds, the cursor will jump back to the buffer A entry in the buffer list window (which I assume may be a side effect of activities auto save.) Similarly in Gnus summary, if I select a message which opens it in another window in the same frame, and I navigate to another message, if I wait a few seconds, it will jump back to the previous selected message.

Would be great if this doesn't happen.

@alphapapa
Copy link
Owner

alphapapa commented Mar 16, 2024

I guess this might be related to window points, but I haven't experienced this behavior myself. If you can provide a step-by-step recipe to reproduce the problem in a clean Emacs configuration, e.g. using https://github.com/alphapapa/with-emacs.sh, maybe I can fix it. (Without using Gnus, if you can.)

@manphiz
Copy link
Author

manphiz commented Mar 16, 2024

Hmm, this is getting complicated as I cannot seem to reproduce this issue using with-emacs.sh, so it's likely that some other addons causing an incompatibility with activities. I'll try to go over my addons to test, which may take a while as there are quite a few to try.

@alphapapa alphapapa added invalid This doesn't seem right question Further information is requested labels Mar 17, 2024
@alphapapa
Copy link
Owner

Ok, I'll leave the issue open until you figure out what's going on. Thanks.

@manphiz
Copy link
Author

manphiz commented Mar 17, 2024

Looks like somewhat I got lucky to reproduce with a minimal recipe much faster than I expected :P

So it seems with (global-auto-revert-mode t) and (setq global-auto-revert-non-file-buffers t) enabled activities seems to cause the extra unexpected moves. Here is a recipe to reproduce this issue

  • Run with-emacs.sh
  • M-x global-auto-revert-mode
  • M-: (setq global-auto-revert-non-file-buffers t)
  • M-x list-packges
  • Find activities and install
  • M-x activities-new (or M-x activities-tabs-new, can be reproduced in both modes) and give any activities name (I used "test")
  • C-x C-b to open the *Buffer List* and C-x o to move to it
  • Move the cursor to some other row

In a few seconds, the cursor will jump back to the row where the cursor was when the buffer list was opened.

Hope this helps with the debugging, and let me know if more info may help. TIA!

@alphapapa
Copy link
Owner

Thanks for the recipe. Given that the docstring for global-auto-revert-non-file-buffers says, "Use this option with care since it could lead to excessive auto-reverts," I'm inclined to consider this a case of, "Don't do that." Also, given that variables like revert-buffer-function and buffer-stale-function are involved, which are beyond activities's control, it's unclear a) whether the problem could even be worked around, and b) whether activities is really to blame.

So I'd generally suggest disabling that option (does the list-packages buffer really need to be auto-reverted, anyway?). Instead, use mode hooks to enable auto-revert-mode in the buffers where it's necessary (e.g. I enable it in org-mode buffers).

So I think there's probably nothing to do here, except perhaps to mention this issue in the documentation.

@alphapapa alphapapa changed the title Cursor point jumps when using activites global-auto-revert-non-file-buffers may cause unintended buffer reverting Mar 17, 2024
@alphapapa alphapapa added compatibility documentation Improvements or additions to documentation discussion and removed question Further information is requested labels Mar 17, 2024
@manphiz
Copy link
Author

manphiz commented Mar 17, 2024

Makes sense. I use global-auto-revert-non-file-buffers mainly for Dired and Buffer LIst. I guess I can cope with adding a hook with auto-revert-mode when I really need those.

On the other hand, would be great if this incompatibility is documented as you suggested so that people won't get surprised like I did :)

@alphapapa alphapapa added this to the 0.8 milestone Mar 31, 2024
@alphapapa alphapapa self-assigned this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility discussion documentation Improvements or additions to documentation invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants