unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* minor enhancement request - let set-background-color, set-foreground-color take FRAME arg
@ 2005-12-13 21:49 Drew Adams
  2005-12-13 22:21 ` Lennart Borgman
  2005-12-14  4:28 ` Eli Zaretskii
  0 siblings, 2 replies; 3+ messages in thread
From: Drew Adams @ 2005-12-13 21:49 UTC (permalink / 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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: minor enhancement request - let set-background-color, set-foreground-color take FRAME arg
  2005-12-13 21:49 minor enhancement request - let set-background-color, set-foreground-color take FRAME arg Drew Adams
@ 2005-12-13 22:21 ` Lennart Borgman
  2005-12-14  4:28 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2005-12-13 22:21 UTC (permalink / raw)
  Cc: Emacs-Devel

Drew Adams wrote:

>What do others think about the general idea of adding a FRAME parameter,
>regardless of the exact function definition?
>  
>
Quite useful and I believe it would be appreciated by many users. I just 
tested you code on w32 and it seems to work for me.

A similar function (or the same?) for windows would be nice too (in the 
future).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: minor enhancement request - let set-background-color, set-foreground-color take FRAME arg
  2005-12-13 21:49 minor enhancement request - let set-background-color, set-foreground-color take FRAME arg Drew Adams
  2005-12-13 22:21 ` Lennart Borgman
@ 2005-12-14  4:28 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2005-12-14  4:28 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Tue, 13 Dec 2005 13:49:00 -0800
> 
> What do others think about the general idea of adding a FRAME parameter,
> regardless of the exact function definition?

I think now is not the time to suggest such changes.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-12-14  4:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-13 21:49 minor enhancement request - let set-background-color, set-foreground-color take FRAME arg Drew Adams
2005-12-13 22:21 ` Lennart Borgman
2005-12-14  4:28 ` Eli Zaretskii

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).