From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Re: Modify parameters on all frames Date: Mon, 7 Apr 2003 23:39:01 +0300 Organization: Mivtach-Simon Insurance agencies Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200304072039.h37Kd1qP021985@beta.mvs.co.il> References: <200304061539.h36Fd2R3007062@beta.mvs.co.il> Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1049748144 20255 80.91.224.249 (7 Apr 2003 20:42:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2003 20:42:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Apr 07 22:42:22 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 192dRe-0005GW-00 for ; Mon, 07 Apr 2003 22:42:22 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 192dVK-0004c4-00 for ; Mon, 07 Apr 2003 22:46:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192dRc-0002s9-06 for emacs-devel@quimby.gnus.org; Mon, 07 Apr 2003 16:42:20 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 192dP1-0000pU-00 for emacs-devel@gnu.org; Mon, 07 Apr 2003 16:39:39 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 192dOp-0000OZ-00 for emacs-devel@gnu.org; Mon, 07 Apr 2003 16:39:29 -0400 Original-Received: from unix.sw.co.il ([192.114.178.12] helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192dOa-00086i-00; Mon, 07 Apr 2003 16:39:12 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.11.6/8.11.6) with ESMTP id h37Kd2s03699; Mon, 7 Apr 2003 23:39:02 +0300 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.5/8.12.5) with ESMTP id h37Kd1tB021992; Mon, 7 Apr 2003 23:39:01 +0300 Original-Received: (from root@localhost) by beta.mvs.co.il (8.12.5/8.12.5/Submit) id h37Kd1qP021985; Mon, 7 Apr 2003 23:39:01 +0300 Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Sun, 06 Apr 2003 19:07:40 -0400) X-Mailer: Emacs 21.3.1 rmail (send-msg 1.108) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12998 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12998 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 06 Apr 2003 19:07:40 -0400, Richard Stallman wrote: > > (defun modify-all-frames-parameters (alist) > > This function seems like a good idea, but it is written rather > inefficiently. It ought to call modify-frame-parameters just once per > frame. Using aput is undesirable since that loads a Lisp file that > you could easily avoid loading. OK, how is this one: (defun modify-all-frames-parameters (alist) "modify all current and future frames parameters. Do this by calling `modify-frame-parameters' on all existing frames with ALIST, and changing `default-frame-alist' (and, when needed, also `initial-frame-alist'). See help of `modify-frame-parameters' for more information." (let* ((frames (frame-list)) ;; all frames (ix (length frames)) ;; list index (keys (mapcar 'car alist)) ;; keys to delete element) ;; temp (while (> ix 0) (setq ix (1- ix)) (modify-frame-parameters (nth ix frames) alist)) (setq ix (length keys)) (while (> ix 0) (setq ix (1- ix)) ;; initial-frame-alist needs setting only when ;; frame-notice-user-settings is true (and frame-notice-user-settings (setq element (assoc (nth ix keys) initial-frame-alist)) (setq initial-frame-alist (delq element initial-frame-alist)))) (and (setq element (assoc (nth ix keys) default-frame-alist)) (setq default-frame-alist (delq element default-frame-alist)))) (and frame-notice-user-settings (setq initial-frame-alist (append initial-frame-alist alist))) (setq default-frame-alist (append default-frame-alist alist))) Ehud. - -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ mailto:ehud@unix.mvs.co.il Better Safe Than Sorry -----BEGIN PGP SIGNATURE----- Comment: use http://www.keyserver.net/ to get my key (and others) iD8DBQE+keHkLFvTvpjqOY0RAlFAAJkB27OyGUdU2kwQXCc8WouvwqpHmACdFwDJ hn6FcuPj/ScnXHJ39pgg/Gs= =Kw0R -----END PGP SIGNATURE-----