emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor enhancement request - let set-background-color, set-foreground-col


From: Drew Adams
Subject: minor enhancement request - let set-background-color, set-foreground-color take FRAME arg
Date: Tue, 13 Dec 2005 13:49:00 -0800

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 via email to

[Prev in Thread] Current Thread [Next in Thread]