I saved a buffer name in a variable WORKING_BUFFER
.
I want to perform, interactively, some operation on that WORKING_BUFFER
even if it isn't visible/selected.
I tried:
(with-selected-window (get-buffer-window WORKING_BUFFER))
but I get
Wrong type argument: window-live-p, nil
if the buffer WORKING_BUFFER
is not currently displayed.
How can I force the use of the WORKING_BUFFER
buffer window (ho can I "call" it?), interactively and restore, once finished, the previous windows settings (the windows displayed on the frame before the operation)? (for the second part I guess save-window-excursion
)
Edit. I'll try to better explain the purpose of my request.
I create scripts to assist users in performing various operations on the WORKING_BUFFER
. Occasionally, I use log buffers to provide users with explanations of the purpose of certain operations. In some cases, I include clickable text within these log buffers that allow users to execute functions that manipulate the WORKING_BUFFER
"interactively" (mostly "query-replace*"). Additionally, there may be instances where I need the log buffers to occupy the entire frame, thus rendering the WORKING_BUFFER
invisible.
May be something like;
(save-window-excursion
(with-current-buffer WORKING_BUFFER
;; perform interactive operations on WORKING_BUFFER here
))
but WORKING_BUFFER
should be visible and selected while the interactive operations are performed.