all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: emacs-devel@gnu.org
Subject: Re: Modify parameters on all frames
Date: Mon, 7 Apr 2003 23:39:01 +0300	[thread overview]
Message-ID: <200304072039.h37Kd1qP021985@beta.mvs.co.il> (raw)
In-Reply-To: <E192JEi-00015A-00@fencepost.gnu.org> (message from Richard Stallman on Sun, 06 Apr 2003 19:07:40 -0400)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 06 Apr 2003 19:07:40 -0400, Richard Stallman <rms@gnu.org> 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-----

  reply	other threads:[~2003-04-07 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-06 15:39 Modify parameters on all frames Ehud Karni
2003-04-06 23:07 ` Richard Stallman
2003-04-07 20:39   ` Ehud Karni [this message]
2003-04-08  6:45     ` Richard Stallman
2003-04-08 19:56       ` Ehud Karni
2003-04-09  5:39         ` Richard Stallman
2003-04-09 17:38           ` Ehud Karni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200304072039.h37Kd1qP021985@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.