Commit 7cd512f2 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(modify-face): Add compatibility for non-interactive use.

parent c88164fe
2001-04-25 Stefan Monnier <monnier@cs.yale.edu>
* faces.el (modify-face): Add compatibility for non-interactive use.
2001-04-24 John Wiegley <johnw@gnu.org>
 
* eshell/esh-cmd.el (eshell-find-alias-function): Corrected the
......@@ -34,11 +38,9 @@
* eshell/eshell.el (eshell-command): Made a few changes so that
`eshell-command' could be called programmatically.
 
* eshell/esh-mode.el: Moved `eshell-non-interactive-p' to
eshell.el.
* eshell/esh-mode.el (eshell-non-interactive-p): Moved to eshell.el.
 
* eshell/eshell.el (eshell-non-interactive-p): Moved this variable
here.
* eshell/eshell.el (eshell-non-interactive-p): Moved from esh-mode.el.
 
2001-04-23 John Wiegley <johnw@gnu.org>
 
......@@ -59,16 +61,16 @@
2001-04-23 Eli Zaretskii <eliz@is.elta.co.il>
 
* calendar/calendar.el (diary-entry-marker)
(calendar-today-marker, calendar-holiday-marker): Use
display-color-p instead of window-system.
(calendar-today-marker, calendar-holiday-marker):
Use display-color-p instead of window-system.
(calendar-mode-map, calendar-mode): Use display-popup-menus-p
instead of window-system.
(calendar-hide-window): Use display-multi-frame-p instead of
window-system.
 
* calendar/cal-x.el (calendar-two-frame-setup)
(calendar-only-one-frame-setup, calendar-one-frame-setup): Use
display-multi-frame-p instead of window-system.
(calendar-only-one-frame-setup, calendar-one-frame-setup):
Use display-multi-frame-p instead of window-system.
 
2001-04-23 Gerd Moellmann <gerd@gnu.org>
 
......@@ -80,14 +82,12 @@
2001-04-23 Alex Schroeder <alex@gnu.org>
 
* goto-addr.el: Instead of defining line-beginning-position and
line-end-position a defalias is used for point-at-bol and
point-at-eol.
line-end-position a defalias is used for point-at-bol and point-at-eol.
2001-04-23 Alex Schroeder <alex@gnu.org>
 
* goto-addr.el: Added XEmacs compatibility code.
(goto-address-highlight-keymap): Made keybindings XEmacs
compatible.
(goto-address-highlight-keymap): Made keybindings XEmacs compatible.
 
2001-04-22 Eli Zaretskii <eliz@is.elta.co.il>
 
......@@ -96,8 +96,7 @@
2001-04-20 Alex Schroeder <alex@gnu.org>
 
* sql.el (sql-escape-newlines-and-send): New function.
(sql-db2): Set comint-input-sender to
sql-escape-newlines-and-send.
(sql-db2): Set comint-input-sender to sql-escape-newlines-and-send.
 
2001-04-20 Alex Schroeder <alex@gnu.org>
 
......
......@@ -966,22 +966,34 @@ Value is a property list of attribute names and new values."
result))))))
(defun modify-face (&optional frame)
(defun modify-face (&optional face foreground background stipple
bold-p italic-p underline-p inverse-p frame)
"Modify attributes of faces interactively.
If optional argument FRAME is nil or omitted, modify the face used
for newly created frame, i.e. the global face."
for newly created frame, i.e. the global face.
For non-interactive use, `set-face-attribute' is preferred.
When called from elisp, if FACE is nil, all arguments but FRAME are ignored
and the face and its settings are obtained by querying the user."
(interactive)
(let ((face (read-face-name "Modify face")))
(if face
(set-face-attribute face frame
:foreground (or foreground 'unspecified)
:background (or background 'unspecified)
:stipple stipple
:bold bold-p
:italic italic-p
:underline underline-p
:inverse-video inverse-p)
(setq face (read-face-name "Modify face"))
(apply #'set-face-attribute face frame
(read-all-face-attributes face frame))))
(defun read-face-and-attribute (attribute &optional frame)
"Read face name and face attribute value.
ATTRIBUTE is the attribute whose new value is read.
FRAME nil or unspecified means read attribute value of global face.
Value is a list (FACE NEW-VALUE) where FACE is the face read
(a symbol), and NEW-VALUE is value read."
\(a symbol), and NEW-VALUE is value read."
(cond ((eq attribute :font)
(let* ((prompt "Set font-related attributes of face")
(face (read-face-name prompt))
......@@ -1273,7 +1285,7 @@ If there is no default for FACE, return nil."
(defsubst face-user-default-spec (face)
"Return the user's customized face-spec for FACE, or the default if none.
If there is neither a user setting or a default for FACE, return nil."
If there is neither a user setting nor a default for FACE, return nil."
(or (get face 'saved-face)
(face-default-spec face)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment