unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: minor enhancement request - let set-background-color, set-foreground-color take FRAME arg
Date: Tue, 13 Dec 2005 13:49:00 -0800	[thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBEEPDCNAA.drew.adams@oracle.com> (raw)

Now is normally not the time for enhancement requests, but perhaps this
minor request could be considered: let commands `set-background-color' and
`set-foreground-color' take an optional FRAME argument. This would make them
more useful for Lisp code. This change should have no effect on existing
code, beyond the definition itself.

The definition could be more or less equivalent to this:

(defun set-background-color (color-name &optional frame)
  "Set the background color of the FRAME to COLOR-NAME.
When called interactively, prompt for the name of the color to use.
To get the frame's current background color, use `frame-parameters'."
  (interactive (list (facemenu-read-color)))
  (modify-frame-parameters (or frame (selected-frame))
			         (list (cons 'background-color color-name)))
  (frame-set-background-mode (or frame (selected-frame))))


For reference, here is the current definition:

(defun set-background-color (color-name)
  "Set the background color of the selected frame to COLOR-NAME.
When called interactively, prompt for the name of the color to use.
To get the frame's current background color, use `frame-parameters'."
  (interactive (list (facemenu-read-color)))
  (modify-frame-parameters (selected-frame)
			   (list (cons 'background-color color-name)))
  (or window-system
      (face-set-after-frame-default (selected-frame))))


I'm not an expert on frames or faces, so perhaps the last line of the
proposed definition is not exactly what is required. Is
`frame-set-background-mode' or `face-set-after-frame-default' more
appropriate here? Perhaps a test for `window-system' is needed?

What do others think about the general idea of adding a FRAME parameter,
regardless of the exact function definition?

             reply	other threads:[~2005-12-13 21:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 21:49 Drew Adams [this message]
2005-12-13 22:21 ` minor enhancement request - let set-background-color, set-foreground-color take FRAME arg Lennart Borgman
2005-12-14  4:28 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=MEEKKIABFKKDFJMPIOEBEEPDCNAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).