Open danielcmccarthy opened 2 weeks ago
Hi Daniel,
You seem to have found a behavior I've noticed myself but couldn't quite put my finger on. I think this is related to the fact that, while buffers have points, windows also have their own points, and moving one does not necessarily move the other; so if the same buffer is in two windows, there may be some conflict.
It may also be relevant what the buffer's major mode is, and possibly its bookmark make-record function. Have you noticed any pattern related to what mode the buffer is in?
OTOH it may not have anything to do with the mode and bookmark function. It might be simply that, when the activities are automatically saved, and the other activity is switched to (which happens invisibly), and the other window showing that buffer becomes visible, the window point is moved, or something like that. So maybe we could solve that by preserving the original window point, or something like that.
Thanks for reporting this.
I stumbled on this with a work journal in diary-mode. But I was able to reproduce it just now with /etc/NEWS in fundamental-mode, too.
I was curious about window points, so I tried a new test. After moving to the beginning of the buffer, but before the activity timer went off, I evaluated:
(set-window-point (selected-window) 1)
But that didn't help.
On Thu, Sep 26, 2024 at 11:32 AM Adam Porter @.***> wrote:
Hi Daniel,
You seem to have found a behavior I've noticed myself but couldn't quite put my finger on. I think this is related to the fact that, while buffers have points, windows also have their own points, and moving one does not necessarily move the other; so if the same buffer is in two windows, there may be some conflict.
It may also be relevant what the buffer's major mode is, and possibly its bookmark make-record function. Have you noticed any pattern related to what mode the buffer is in?
OTOH it may not have anything to do with the mode and bookmark function. It might be simply that, when the activities are automatically saved, and the other activity is switched to (which happens invisibly), and the other window showing that buffer becomes visible, the window point is moved, or something like that. So maybe we could solve that by preserving the original window point, or something like that.
Thanks for reporting this.
— Reply to this email directly, view it on GitHub https://github.com/alphapapa/activities.el/issues/120#issuecomment-2377304607, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIXLZODSAAFDAHQBSWAOQLZYQSKNAVCNFSM6AAAAABO436OGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZXGMYDINRQG4 . You are receiving this because you authored the thread.Message ID: @.***>
@danielcmccarthy Please install from this branch and let me know if it fixes the problem for you: https://github.com/alphapapa/activities.el/compare/wip/fix-120-window-point
That fixes the sudden jumping after M-<
. But now point moves when I switch from thing 1 to thing 2, then back. It looks like that happens on master, too; I don't think I noticed that before.
But now point moves when I switch from thing 1 to thing 2, then back. It looks like that happens on master, too; I don't think I noticed that before.
Sorry, I don't understand what you mean.
Sorry, let me try again. With two activity tabs viewing the same buffer:
Let me know if you'd like me to try anything else.
It would help to have a bit more detail. I feel like step 3 there omits some information. For example, after each switch, please say where the point is. And please say how much time elapsed between each step (i.e. whether the activity-save timer would have activated between the steps).
In step 1, before switching away from A1, point was at the end of the buffer. But I also tried the steps starting with a random place picked with the mouse and got the same behavior. I didn't wait long before switching, maybe a second or two.
Step 2: after moving to the buffer beginning I waited about 5 seconds, long enough to confirm that the original problem wasn't happening anymore.
Step 3: when switching to A1, A2's point was at the beginning of the buffer; A1's point was wherever I left it in step 1. When switching back to A2, A1's point is unchanged, but A2 now has the point value from A1.
I see now that activities-mode-idle-frequency
is 5s, so I tried again waiting 20s between step 2 and 3. No change.
I'm sorry if I seem demanding, but would you mind writing out those steps with all of the details in a single list? Having to reconcile the steps from one comment and the details from another is a bit confusing, and these details are vital.
No problem:
M->
.M-<
. Wait 10 seconds.If A2's point is anywhere other than buffer-beginning, the test behaves as expected. The buffer doesn't seem to matter; I've reproduced this with *scratch*
, etc/NEWS
, and a text file in fundamental-mode.
I switched between activities by clicking on the the tab bar, rather than a key sequence, in case that matters.
When I have a buffer visible in multiple activity tabs, I've noticed that if I jump to the beginning of the buffer in one tab and wait a second, point will move to where it was in the previous activity. I was able to reproduce it with
emacs -q
:etc/NEWS
M->
M-<
, and wait a second. Point will jump to the position you left it at in thing 2.It doesn't happen if
activities-tabs-mode
is disabled, and it doesn't happen unless point is at the beginning of the buffer.Thanks for making this package!