martin rudalics <rudalics@gmx.at> writes:
'execute-kbd-macro' calls command_loop_1 which sets the current buffer
to the buffer shown in the selected window.
For example:
(with-temp-buffer
(list
;; Returns the temp buffer
(current-buffer)
(execute-kbd-macro "hello")
;; Returns the buffer that was current when evaluation began
(current-buffer)))
Try with
(with-temp-buffer
(let ((restore (window-buffer))
temp)
(setq temp (current-buffer))
(set-window-buffer (selected-window) temp)
(execute-kbd-macro "hello")
(set-window-buffer (selected-window) restore)
(list temp (current-buffer))))
So this seems to work as designed, so I'm closing this bug report. If
there's something to be done here, please respond to the debbugs address
and we'll reopen.