(setup-8-bit-environment):
[bpt/emacs.git] / lisp / frame.el
index 82b42b0..3266773 100644 (file)
@@ -500,7 +500,8 @@ the user during startup."
 (defcustom focus-follows-mouse t
   "*Non-nil if window system changes focus when you move the mouse."
   :type 'boolean
-  :group 'frames)
+  :group 'frames
+  :version "20.3")
 
 (defun other-frame (arg)
   "Select the ARG'th different visible frame, and raise it.
@@ -524,7 +525,7 @@ A negative ARG moves in the opposite order."
     ;; Ensure, if possible, that frame gets input focus.
     (if (eq window-system 'w32)
        (w32-focus-frame frame)
-      (unless focus-follows-mouse
+      (when focus-follows-mouse
        (set-mouse-position (selected-frame) (1- (frame-width)) 0)))))
 
 (defun make-frame-names-alist ()
@@ -540,24 +541,20 @@ A negative ARG moves in the opposite order."
     falist))
 
 (defvar frame-name-history nil)
-(defvar frame-names-alist nil)
 (defun select-frame-by-name (name)
   "Select the frame whose name is NAME and raise it.
 If there is no frame by that name, signal an error."
   (interactive
-   (let (input default)
-     (setq frame-names-alist (make-frame-names-alist))
-     (setq default (car (car frame-names-alist)))
-     (setq input
-          (completing-read
-           (format "Select Frame (default %s): " default)
-           frame-names-alist nil t nil 'frame-name-history))
+   (let* ((frame-names-alist (make-frame-names-alist))
+          (default (car (car frame-names-alist)))
+          (input (completing-read
+                  (format "Select Frame (default %s): " default)
+                  frame-names-alist nil t nil 'frame-name-history)))
      (if (= (length input) 0)
         (list default)
        (list input))))
-  (or (interactive-p)
-      (setq frame-names-alist (make-frame-names-alist)))
-  (let ((frame (cdr (assoc name frame-names-alist))))
+  (let* ((frame-names-alist (make-frame-names-alist))
+        (frame (cdr (assoc name frame-names-alist))))
     (or frame
        (error "There is no frame named `%s'" name))
     (make-frame-visible frame)