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
When working on #198, I was able to come to a better understanding of the issues I brought up with monkey-patch.el in #153.
live-mp-new-basic-save-buffer calls set-window-buffer to move the buffer that is pending a save to the current window. According to the documentation for set-window-buffer, it will throw an error if called from a dedicated window:
This function throws an error when WINDOW is strongly dedicated to its
buffer (that is `window-dedicated-p' returns t for WINDOW) and does not
already display BUFFER-OR-NAME.
Some modes, such as ediff-mode, use a dedicated window as a control panel for enter commands to be run on buffers in other windows. In ediff-mode for example, the frame is divided into windows for the three buffers involved with the merge (base, current, and merged) and a fourth dedicated window for the *Ediff Control Panel*. When entering commands, including saving the merge, the *Ediff Control Panel* is the current selected window and a call to set-window-buffer will throw an error.
One solution is to replace the call to (set-window-buffer (frame-selected-window) (current-buffer)) with (switch-to-buffer (current-buffer)). If switch-to-buffer will not give you your desired behavior, then I would suggest replacing the call only when in a dedicated buffer:
My apologies, my suggestion above was incorrect (somehow must have pasted the wrong thing while working on debugging this). Here is what I meant to suggest.
When working on #198, I was able to come to a better understanding of the issues I brought up with monkey-patch.el in #153.
live-mp-new-basic-save-buffer
callsset-window-buffer
to move the buffer that is pending a save to the current window. According to the documentation forset-window-buffer
, it will throw an error if called from a dedicated window:Some modes, such as ediff-mode, use a dedicated window as a control panel for enter commands to be run on buffers in other windows. In ediff-mode for example, the frame is divided into windows for the three buffers involved with the merge (base, current, and merged) and a fourth dedicated window for the
*Ediff Control Panel*
. When entering commands, including saving the merge, the*Ediff Control Panel*
is the current selected window and a call toset-window-buffer
will throw an error.One solution is to replace the call to
(set-window-buffer (frame-selected-window) (current-buffer))
with(switch-to-buffer (current-buffer))
. Ifswitch-to-buffer
will not give you your desired behavior, then I would suggest replacing the call only when in a dedicated buffer:If you like one of these solutions, let me know and I'll make a pull request.
The text was updated successfully, but these errors were encountered: