aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-07 11:39:07 +0000
committerGerd Moellmann2000-09-07 11:39:07 +0000
commit047bc928e5672963c11cca69e16a586ef570ef29 (patch)
treecfb927b07953846cfe425356d6919f4c1cc917ef
parentdbc968b8ff6136386913fe523dc1710f177c0c77 (diff)
downloademacs-047bc928e5672963c11cca69e16a586ef570ef29.tar.gz
emacs-047bc928e5672963c11cca69e16a586ef570ef29.zip
(filtered-frame-list): Reduce consing.
(frames-on-display-list): Call frame-parameter instead of frame-parameters.
-rw-r--r--lisp/frame.el19
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 9da841f4e1a..e4770cc6be1 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -494,13 +494,13 @@ on `after-make-frame-functions' are run with one arg, the newly created frame."
494 494
495(defun filtered-frame-list (predicate) 495(defun filtered-frame-list (predicate)
496 "Return a list of all live frames which satisfy PREDICATE." 496 "Return a list of all live frames which satisfy PREDICATE."
497 (let ((frames (frame-list)) 497 (let* ((frames (frame-list))
498 good-frames) 498 (list frames))
499 (while (consp frames) 499 (while (consp frames)
500 (if (funcall predicate (car frames)) 500 (unless (funcall predicate (car frames))
501 (setq good-frames (cons (car frames) good-frames))) 501 (setcar frames nil))
502 (setq frames (cdr frames))) 502 (setq frames (cdr frames)))
503 good-frames)) 503 (delq nil list)))
504 504
505(defun minibuffer-frame-list () 505(defun minibuffer-frame-list ()
506 "Return a list of all frames with their own minibuffers." 506 "Return a list of all frames with their own minibuffers."
@@ -512,12 +512,9 @@ on `after-make-frame-functions' are run with one arg, the newly created frame."
512 "Return a list of all frames on DISPLAY. 512 "Return a list of all frames on DISPLAY.
513DISPLAY is a name of a display, a string of the form HOST:SERVER.SCREEN. 513DISPLAY is a name of a display, a string of the form HOST:SERVER.SCREEN.
514If DISPLAY is omitted or nil, it defaults to the selected frame's display." 514If DISPLAY is omitted or nil, it defaults to the selected frame's display."
515 (let* ((display (or display 515 (let* ((display (or display (frame-parameter nil 'display)))
516 (cdr (assoc 'display (frame-parameters))))) 516 (func #'(lambda (frame)
517 (func 517 (eq (frame-parameter frame 'display) display))))
518 (function (lambda (frame)
519 (eq (cdr (assoc 'display (frame-parameters frame)))
520 display)))))
521 (filtered-frame-list func))) 518 (filtered-frame-list func)))
522 519
523(defun framep-on-display (&optional display) 520(defun framep-on-display (&optional display)