comparison lisp/frame.el @ 280:7df0dd720c89 r21-0b38

Import from CVS: tag r21-0b38
author cvs
date Mon, 13 Aug 2007 10:32:22 +0200
parents 90d73dddcdc4
children c42ec1d1cded
comparison
equal deleted inserted replaced
279:c20b2fb5bb0a 280:7df0dd720c89
515 515
516 (defun other-frame (arg) 516 (defun other-frame (arg)
517 "Select the ARG'th different visible frame, and raise it. 517 "Select the ARG'th different visible frame, and raise it.
518 All frames are arranged in a cyclic order. 518 All frames are arranged in a cyclic order.
519 This command selects the frame ARG steps away in that order. 519 This command selects the frame ARG steps away in that order.
520 A negative ARG moves in the opposite order." 520 A negative ARG moves in the opposite order.
521
522 This command ignores the value of `focus-follows-mouse'."
521 (interactive "p") 523 (interactive "p")
522 (let ((frame (selected-frame))) 524 (let ((frame (selected-frame))
525 (old-focus-follows-mouse focus-follows-mouse)
526 ;; Allow selecting another frame even when
527 ;; focus-follows-mouse is true.
528 (focus-follows-mouse nil))
523 (while (> arg 0) 529 (while (> arg 0)
524 (setq frame (next-frame frame 'visible-nomini)) 530 (setq frame (next-frame frame 'visible-nomini))
525 (setq arg (1- arg))) 531 (setq arg (1- arg)))
526 (while (< arg 0) 532 (while (< arg 0)
527 (setq frame (previous-frame frame 'visible-nomini)) 533 (setq frame (previous-frame frame 'visible-nomini))
528 (setq arg (1+ arg))) 534 (setq arg (1+ arg)))
529 (raise-frame frame) 535 (raise-frame frame)
530 (select-frame frame) 536 (select-frame frame)
537 ;; Allow the focus change to be processed while
538 ;; focus-follows-mouse is nil.
539 (and old-focus-follows-mouse
540 (sit-for 0))
531 ;this is a bad idea; you should in general never warp the 541 ;this is a bad idea; you should in general never warp the
532 ;pointer unless the user asks for this. Furthermore, 542 ;pointer unless the user asks for this. Furthermore,
533 ;our version of `set-mouse-position' takes a window, 543 ;our version of `set-mouse-position' takes a window,
534 ;not a frame. 544 ;not a frame.
535 ;(set-mouse-position (selected-frame) (1- (frame-width)) 0) 545 ;(set-mouse-position (selected-frame) (1- (frame-width)) 0)