changeset 21730:efa1c31f068c

(frame-name-alist): Remove this variable. (select-frame-by-name): Recompute the list of frames instead of saving it in a global variable.
author Richard M. Stallman <rms@gnu.org>
date Thu, 23 Apr 1998 22:15:47 +0000
parents 67d43c178919
children 4a0a3ae173d0
files lisp/frame.el
diffstat 1 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/frame.el	Thu Apr 23 22:07:20 1998 +0000
+++ b/lisp/frame.el	Thu Apr 23 22:15:47 1998 +0000
@@ -541,24 +541,20 @@
     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)