Function: viper-remember-current-frame
viper-remember-current-frame is a byte-compiled function defined in
viper-mous.el.gz.
Signature
(viper-remember-current-frame &rest _)
Documentation
Remember the selected frame before the switch-frame event.
Source Code
;; Defined in /usr/src/emacs/lisp/emulation/viper-mous.el.gz
;; Called just before switching frames. Saves the old selected frame.
;; Sets last-command to handle-switch-frame (this is done automatically in
;; Emacs.
;; The semantics of switching frames is different in Emacs and XEmacs.
;; In Emacs, if you select-frame A while mouse is over frame B and then
;; start typing, input goes to frame B, which becomes selected.
;; In XEmacs, input will go to frame A. This may be a bug in one of the
;; Emacsen, but also may be a design decision.
;; Also, in Emacs sending input to frame B generates handle-switch-frame
;; event, while in XEmacs it doesn't.
;; All this accounts for the difference in the behavior of
;; viper-mouse-click-* commands when you click in a frame other than the one
;; that was the last to receive input. In Emacs, focus will be in frame A
;; until you do something other than viper-mouse-click-* command.
;; In XEmacs, you have to manually select frame B (with the mouse click) in
;; order to shift focus to frame B.
(defun viper-remember-current-frame (&rest _)
"Remember the selected frame before the switch-frame event."
(setq last-command #'handle-switch-frame
viper-current-frame-saved (selected-frame)))