You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is related to #159... whenever I type C-x C-s, point moves to the beginning of buffer. Can this be fixed so that point remains where it was when I run edit-server-save ?
I'm just guessing that the last line of edit-server-done(edit-server-kill-client proc) is the cause? Is it the case that every time I do edit-server-save, the current client is killed, and a fresh connection with the updated content is started? That would explain why point moves to the beginning of the buffer, but don't know if this is the correct explanation.
The text was updated successfully, but these errors were encountered:
Your analysis is correct - this is due to the way edit-server-save is implemented. You are effectively saving the old session and then triggering an immediate second editing session (at which point regenerate the buffer contents and reset point). Ideally we would move to a persistent websocket based approach which would do away with the need for the transactional approach of using a HTTP request with reply that we currently have. However that is a fair amount of work so unlikely to be done anytime soon.
That said we do take care to preserve the buffer for iterative editing (see x-file/edit-server-file). Perhaps the easiest approach would be to save a buffer local value (say edit-server-point-on-save) which we can restore if it exists on a new edit?
Great, thanks for the confirmation! Unfortunately, I have no idea about what needs to be done on the non-emacs-lisp side, so I've just provided my guesses about what will have to be added to edit-server-filter
(defvar edit-server-saved-point nil
"The value gotten from the HTTP `x-saved-point' header.")
(make-variable-buffer-local 'edit-server-saved-point)
(put 'edit-server-saved-point 'permanent-local t)
And finally, some code in edit-server-edit-mode involving posn-set-point, edit-server-saved-point, and possibly a customisable variable like edit-server-restore-point?
Not sure if this is related to #159... whenever I type
C-x C-s
, point moves to the beginning of buffer. Can this be fixed so that point remains where it was when I runedit-server-save
?I'm just guessing that the last line of
edit-server-done
(edit-server-kill-client proc)
is the cause? Is it the case that every time I doedit-server-save
, the current client is killed, and a fresh connection with the updated content is started? That would explain why point moves to the beginning of the buffer, but don't know if this is the correct explanation.The text was updated successfully, but these errors were encountered: