aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-08-10 13:47:18 +0000
committerGerd Moellmann2001-08-10 13:47:18 +0000
commit030f453737bdf08035ebae69b6e1660d47c78f25 (patch)
tree89fb1b2d0e645a03a0ee549d0016b1eec71475a4
parent9d9fd4e88a1c30ea93a408a5f1350c427f63b96b (diff)
downloademacs-030f453737bdf08035ebae69b6e1660d47c78f25.tar.gz
emacs-030f453737bdf08035ebae69b6e1660d47c78f25.zip
(select-frame-set-input-focus): New function
extracted from other-frame. (other-frame): Use it. (next-multiframe-window, previous-multiframe-window): Use it.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/frame.el32
2 files changed, 24 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d23ed6ab2d2..f40dce1749d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12001-08-10 Gerd Moellmann <gerd@gnu.org> 12001-08-10 Gerd Moellmann <gerd@gnu.org>
2 2
3 * frame.el (select-frame-set-input-focus): New function
4 extracted from other-frame.
5 (other-frame): Use it.
6 (next-multiframe-window, previous-multiframe-window): Use it.
7
3 * isearch.el (isearch-other-meta-char): Don't switch to the 8 * isearch.el (isearch-other-meta-char): Don't switch to the
4 buffer of a window clicked on, when the current buffer is 9 buffer of a window clicked on, when the current buffer is
5 in Isearch mode. 10 in Isearch mode.
diff --git a/lisp/frame.el b/lisp/frame.el
index c888334aad4..6c7c16aa98d 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -506,14 +506,16 @@ is not considered (see `next-frame')."
506 (interactive) 506 (interactive)
507 (select-window (next-window (selected-window) 507 (select-window (next-window (selected-window)
508 (> (minibuffer-depth) 0) 508 (> (minibuffer-depth) 0)
509 t))) 509 t))
510 (select-frame-set-input-focus (selected-frame)))
510 511
511(defun previous-multiframe-window () 512(defun previous-multiframe-window ()
512 "Select the previous window, regardless of which frame it is on." 513 "Select the previous window, regardless of which frame it is on."
513 (interactive) 514 (interactive)
514 (select-window (previous-window (selected-window) 515 (select-window (previous-window (selected-window)
515 (> (minibuffer-depth) 0) 516 (> (minibuffer-depth) 0)
516 t))) 517 t))
518 (select-frame-set-input-focus (selected-frame)))
517 519
518(defun make-frame-on-display (display &optional parameters) 520(defun make-frame-on-display (display &optional parameters)
519 "Make a frame on display DISPLAY. 521 "Make a frame on display DISPLAY.
@@ -631,6 +633,20 @@ the user during startup."
631 :group 'frames 633 :group 'frames
632 :version "20.3") 634 :version "20.3")
633 635
636(defun select-frame-set-input-focus (frame)
637 "Select FRAME, raise it, and set input focus, if possible."
638 (select-frame frame)
639 (raise-frame frame)
640 ;; Ensure, if possible, that frame gets input focus.
641 (when (eq window-system 'w32)
642 (w32-focus-frame frame))
643 (cond (focus-follows-mouse
644 (unless (eq window-system 'w32)
645 (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
646 (t
647 (when (eq window-system 'x)
648 (x-focus-frame frame)))))
649
634(defun other-frame (arg) 650(defun other-frame (arg)
635 "Select the ARG'th different visible frame, and raise it. 651 "Select the ARG'th different visible frame, and raise it.
636All frames are arranged in a cyclic order. 652All frames are arranged in a cyclic order.
@@ -648,17 +664,7 @@ A negative ARG moves in the opposite order."
648 (while (not (eq (frame-visible-p frame) t)) 664 (while (not (eq (frame-visible-p frame) t))
649 (setq frame (previous-frame frame))) 665 (setq frame (previous-frame frame)))
650 (setq arg (1+ arg))) 666 (setq arg (1+ arg)))
651 (select-frame frame) 667 (select-frame-set-input-focus frame)))
652 (raise-frame frame)
653 ;; Ensure, if possible, that frame gets input focus.
654 (when (eq window-system 'w32)
655 (w32-focus-frame frame))
656 (cond (focus-follows-mouse
657 (unless (eq window-system 'w32)
658 (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
659 (t
660 (when (eq window-system 'x)
661 (x-focus-frame frame))))))
662 668
663(defun make-frame-names-alist () 669(defun make-frame-names-alist ()
664 (let* ((current-frame (selected-frame)) 670 (let* ((current-frame (selected-frame))