Commit 092b3de6 authored by David Byers's avatar David Byers
Browse files

New face selection scheme is now fully in operation.

Detailed changes:
> 2003-01-03  David Byers  <david.byers@swipnet.se>
>
> 	* lyskom-buttons.el (lyskom-default-button): Use default, not
> 	kom-text-face for timestamp buttons since kom-text-face is no
> 	more.
>
> 	Implement face customization:
> 	* option-edit.el (lyskom-face-widget, lyskom-face-widget): New
> 	widget type.
> 	(lyskom-widget-functions): Added face widget to the list.
>
> 	* view-text.el (lyskom-print-text): Get generated faces if the
> 	user hasn't selected any specific faces.
>
> 	* startup.el (lyskom): Get generated faces if the user hasn't
> 	selected any specific faces.
>
> 	* commands2.el (lyskom-send-message): Get generated faces if the
> 	user hasn't selected any specific faces.
>
> 	* async.el (lyskom-format-as-personal-message): Get generated
> 	faces if the user hasn't selected any specific faces.
>
1a25,34
>
> 	Implement face customization:
> 	* faces.el (lyskom-setup-faces-for-buffer): Don't muck with the
> 	user-selectable values.
>
> 	* option-edit.el: Added var parameter to all widget conversion
> 	functions.
>
> 	* utilities.el (lyskom-current-client-time): Removed some
> 	comments.
parent aef90af9
2003-01-03 David Byers <david.byers@swipnet.se>
* lyskom-buttons.el (lyskom-default-button): Use default, not
kom-text-face for timestamp buttons since kom-text-face is no
more.
Implement face customization:
* option-edit.el (lyskom-face-widget, lyskom-face-widget): New
widget type.
(lyskom-widget-functions): Added face widget to the list.
* view-text.el (lyskom-print-text): Get generated faces if the
user hasn't selected any specific faces.
* startup.el (lyskom): Get generated faces if the user hasn't
selected any specific faces.
* commands2.el (lyskom-send-message): Get generated faces if the
user hasn't selected any specific faces.
* async.el (lyskom-format-as-personal-message): Get generated
faces if the user hasn't selected any specific faces.
2003-01-02 David Byers <david.byers@swipnet.se>
Implement face customization:
* faces.el (lyskom-setup-faces-for-buffer): Don't muck with the
user-selectable values.
* option-edit.el: Added var parameter to all widget conversion
functions.
* utilities.el (lyskom-current-client-time): Removed some
comments.
Cosmetics:
* commands2.el (kom-set-unread): Don't include range in prompt. It
will be included by lyskom-read-num-range-or-date.
......
......@@ -533,9 +533,11 @@ Non-nil NOBEEP means don't beep."
message
when
(when kom-async-highlight-dashed-lines
`(face ,kom-async-dashed-lines-face))
`(face ,(or kom-async-dashed-lines-face
lyskom-default-async-dashed-lines-face)))
(when kom-async-highlight-text-body
`(face ,kom-async-text-body-face))))
`(face ,(or kom-async-text-body-face
lyskom-default-async-text-body-face)))))
((= (conf-stat->conf-no recipient) lyskom-pers-no) ; Private
(if (not nobeep) (lyskom-beep kom-ding-on-personal-messages sender))
(lyskom-format (lyskom-get-string-sol 'message-from)
......@@ -546,9 +548,11 @@ Non-nil NOBEEP means don't beep."
message
when
(when kom-async-highlight-dashed-lines
`(face ,kom-async-dashed-lines-face))
`(face ,(or kom-async-dashed-lines-face
lyskom-default-async-dashed-lines-face)))
(when kom-async-highlight-text-body
`(face ,kom-async-text-body-face))))
`(face ,(or kom-async-text-body-face
lyskom-default-async-text-body-face)))))
(t ; Group message
(if (not nobeep) (lyskom-beep kom-ding-on-group-messages recipient))
(lyskom-format (lyskom-get-string-sol 'message-from-to)
......@@ -563,9 +567,11 @@ Non-nil NOBEEP means don't beep."
(t (lyskom-get-string 'unknown)))
when
(when kom-async-highlight-dashed-lines
`(face ,kom-async-dashed-lines-face))
`(face ,(or kom-async-dashed-lines-face
lyskom-default-async-dashed-lines-face)))
(when kom-async-highlight-text-body
`(face ,kom-async-text-body-face)))))))
`(face ,(or kom-async-text-body-face
lyskom-default-async-text-body-face))))))))
......
......@@ -667,9 +667,11 @@ send. If DONTSHOW is non-nil, don't display the sent message."
lyskom-message-string
lyskom-message-recipient
(when kom-async-highlight-dashed-lines
`(face ,kom-async-dashed-lines-face))
`(face ,(or kom-async-dashed-lines-face
lyskom-default-async-dashed-lines-face)))
(when kom-async-highlight-text-body
`(face ,kom-async-text-body-face)))
`(face ,(or kom-async-text-body-face
lyskom-default-async-text-body-face))))
lyskom-pers-no
kom-filter-outgoing-messages))
(lyskom-format-insert-before-prompt
......
......@@ -2762,6 +2762,10 @@ Select whether to execute command or keyboard macro.")
(link-highlight-match . "Highlight group")
(link-fold-case . "Case insensitive")
(generated-face . "Automatic")
(fonts . "Fonts\n")
(other-face . "Other")
;;
;; Misc doc strings
;;
......@@ -3714,6 +3718,64 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
\\N means substitute match for (...) number N,
\\\\ means insert one \\.")
(kom-active-face-doc . "\
Face used for clickable areas other than URLs, conference and person
names, friends, morons and text numbers..")
(kom-url-face-doc . "\
Face used for clickable URLs.")
(kom-me-face-doc . "\
Face used for my own name.")
(kom-highlight-face-doc . "\
Face used for highlighting clickable areas as the mouse is moved
over them.")
(kom-subject-face-doc . "\
Face used for subject lines.")
(kom-text-no-face-doc . "\
Face used for text numbers.")
(kom-friends-face-doc . "\
Face used for names of people listed in \"Friends and other
special people\".")
(kom-morons-face-doc . "\
Face used for names of people listed in \"Morons and other
\"special\" people.")
(kom-presence-face-doc . "\
Face used for presence messages.")
(kom-first-line-face-doc . "\
Face used for first header line. This face is overlayed on other
text. Properties not defined by this face will be retained. For
example, if you only set the weight property, the colors normally
used will not be changed.")
(kom-warning-face-doc . "\
Face used for important warnings.")
(kom-mark-face-doc . "\
Face used for various marks, including the indicator shown when the
client scrolls less than a full page. This face is overlayed on other
text. Properties not defined by this face will be retained. For
example, if you only set the weight property, the colors normally
used will not be changed.")
(kom-dim-face-doc . "\
Face used for various discreet texts.")
(kom-text-body-face-doc . "\
Face used for text bodies. This face is overlayed on other
text. Properties not defined by this face will be retained. For
example, if you only set the weight property, the colors normally
used will not be changed.")
(kom-dashed-lines-face-doc . "\
Face used for dashed lines around texts. This face is overlayed
on other text. Properties not defined by this face will be retained.
For example, if you only set the weight property, the colors
normally used will not be changed.")
(kom-async-text-body-face-doc . "\
Face used for messages. This face is overlayed on other
text. Properties not defined by this face will be retained. For
example, if you only set the weight property, the colors normally
used will not be changed.")
(kom-async-dashed-lines-face-doc . "\
Face used for dashed lines around messages. This face is overlayed
on other text. Properties not defined by this face will be retained.
For example, if you only set the weight property, the colors normally
used will not be changed.")
;;
;; Tags for variables
;;
......@@ -3893,6 +3955,24 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
(kom-mark-read-texts-as-read-in-new-recipient-tag . "Mark read texts read when added to new recipients:")
(kom-url-transformation-rules-tag . "Transformation of URLs:")
(kom-text-links-tag . "Text links:")
(kom-active-face-tag . "Other clickable areas:")
(kom-url-face-tag . "Clickable URLs:")
(kom-me-face-tag . "My own name:")
(kom-highlight-face-tag . "Mouseover highlight:")
(kom-subject-face-tag . "Subject lines:")
(kom-text-no-face-tag . "Text numbers:")
(kom-friends-face-tag . "Friends and other special people:")
(kom-morons-face-tag . "Morons and other \"special\" people:")
(kom-presence-face-tag . "Presence messages:")
(kom-first-line-face-tag . "First header line:")
(kom-warning-face-tag . "Important warnings:")
(kom-mark-face-tag . "Various marks:")
(kom-dim-face-tag . "Various discreet texts:")
(kom-text-body-face-tag . "Text bodies:")
(kom-dashed-lines-face-tag . "Dashed lines around texts:")
(kom-async-text-body-face-tag . "Messages:")
(kom-async-dashed-lines-face-tag . "Dashed lines around messages:")
)
)
......
......@@ -68,130 +68,139 @@
;;; ================================================================
;;; Face variables
;;;
;;; Aye, there are a lot of them.
;;; Here's a list of all face variables. Seems to be useful on occasion.
;;;
(def-kom-var kom-active-face 'kom-face--plain--active-face
;;; kom-active-face
;;; kom-url-face
;;; kom-me-face
;;; kom-highlight-face
;;; kom-text-face
;;; kom-subject-face
;;; kom-text-no-face
;;; kom-friends-face
;;; kom-morons-face
;;; kom-presence-face
;;; kom-first-line-face
;;; kom-warning-face
;;; kom-mark-face
;;; kom-dim-face
;;; kom-text-body-face
;;; kom-dashed-lines-face
;;; kom-async-text-body-face
;;; kom-async-dashed-lines-face
(def-kom-var kom-active-face 'kom-face--default--active-face
"*Face used for most \"clickable\" areas.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--active-face.
The default value is kom-face--default--active-face.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-url-face 'kom-face--plain--url-face
(def-kom-var kom-url-face 'kom-face--default--url-face
"*Face used for URLs.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--url-face.
The default value is kom-face--default--url-face.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-me-face 'kom-face--plain--me-face
(def-kom-var kom-me-face 'kom-face--default--me-face
"*Face used to show your own name.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--me-face.
The default value is kom-face--default--me-face.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-highlight-face 'kom-face--plain--highlight-face
(def-kom-var kom-highlight-face 'kom-face--default--highlight-face
"*Face used for various highlights.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--highlight.
The default value is kom-face--default--highlight.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-text-face 'kom-face--plain--text-face
"*Face used for text bodies.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--text-face.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-subject-face 'kom-face--plain--subject-face
(def-kom-var kom-subject-face 'kom-face--default--subject-face
"*Face used for subject lines.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--subject-fac.
The default value is kom-face--default--subject-fac.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-text-no-face 'kom-face--plain--text-no-face
(def-kom-var kom-text-no-face 'kom-face--default--text-no-face
"*Face used for text numbers.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--text-no-fac.
The default value is kom-face--default--text-no-fac.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-friends-face 'kom-face--plain--friends-face
(def-kom-var kom-friends-face 'kom-face--default--friends-face
"*Face used for people in kom-friends.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--friends-fac.
The default value is kom-face--default--friends-fac.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-morons-face 'kom-face--plain--morons-face
(def-kom-var kom-morons-face 'kom-face--default--morons-face
"*Face used for people in kom-morons.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--morons-face.
The default value is kom-face--default--morons-face.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-presence-face 'kom-face--plain--presence-face
(def-kom-var kom-presence-face 'kom-face--default--presence-face
"*Face used for presence messages.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--presence-f.
The default value is kom-face--default--presence-f.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-first-line-face 'kom-face--plain--first-line-face
(def-kom-var kom-first-line-face 'kom-face--default--first-line-face
"*Face used for the first line header of each text.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--first-li.
The default value is kom-face--default--first-li.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-warning-face 'kom-face--plain--warning-face
(def-kom-var kom-warning-face 'kom-face--default--warning-face
"*Face used to display important warnings.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--warning-fac.
The default value is kom-face--default--warning-fac.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-mark-face 'kom-face--plain--mark-face
(def-kom-var kom-mark-face 'kom-face--default--mark-face
"*Face used for temporary marks.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--mark-face.
The default value is kom-face--default--mark-face.
This is a LysKOM face variable."
server
inherited)
(def-kom-var kom-dim-face 'kom-face--plain--dim-face
(def-kom-var kom-dim-face 'kom-face--default--dim-face
"*Face used to display dimmed items, such as passive memberships.
The value should be either a symbol naming a face or nil.
The default value is kom-face--plain--dim-face.
The default value is kom-face--default--dim-face.
This is a LysKOM face variable."
server
......@@ -249,6 +258,22 @@ This is a LysKOM face variable."
server
inherited)
(def-kom-var lyskom-default-text-body-face nil
"Default text body face."
inherited)
(def-kom-var lyskom-default-async-text-body-face nil
"Default text body face."
inherited)
(def-kom-var lyskom-default-dashed-lines-face nil
"Default text body face."
inherited)
(def-kom-var lyskom-default-async-dashed-lines-face nil
"Default text body face."
inherited)
;;; ================================================================
;;; Main entry points
......@@ -259,17 +284,10 @@ This is a LysKOM face variable."
(or (face-background 'default)
(frame-property (selected-frame) 'background-color)
"#ffffff"))))
;; We've generated default background faces. Now either use them
;; or lose them. If the user has selected specific faces, then
;; don't use the generated faces.
(unless (facep kom-text-body-face)
(setq kom-text-body-face (cdr (assq 'text-body faces))))
(unless (facep kom-dashed-lines-face)
(setq kom-dashed-lines-face (cdr (assq 'dashed-lines faces))))
(unless (facep kom-async-text-body-face)
(setq kom-async-text-body-face (cdr (assq 'async-text-body faces))))
(unless (facep kom-async-dashed-lines-face)
(setq kom-async-dashed-lines-face (cdr (assq 'async-dashed-lines faces))))
(setq lyskom-default-text-body-face (cdr (assq 'text-body faces)))
(setq lyskom-default-dashed-lines-face (cdr (assq 'dashed-lines faces)))
(setq lyskom-default-async-text-body-face (cdr (assq 'async-text-body faces)))
(setq lyskom-default-async-dashed-lines-face (cdr (assq 'async-dashed-lines faces)))
))
......@@ -386,8 +404,10 @@ for `lyskom-background-colors' for more information."
;;; ================================================================
;;; Predefined faces
;;;
;;; There are two sets of predefined faces: the defaults and the
;;; user-defined faces. Users should not muck with the defaults.
(defface kom-face--plain--active-face
(defface kom-face--default--active-face
'((((background light))
(:foreground "blue4")
)
......@@ -395,12 +415,13 @@ for `lyskom-background-colors' for more information."
(:foreground "lightblue")
)
)
"Face used for most \"clickable\" areas."
"Face suitable for most \"clickable\" areas.
Do not alter this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--plain--url-face
(defface kom-face--default--url-face
'((((background light))
(:foreground "blueviolet")
)
......@@ -408,12 +429,13 @@ for `lyskom-background-colors' for more information."
(:foreground "moccasin")
)
)
"Face used for URLs."
"Face suitable for URLs.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--plain--me-face
(defface kom-face--default--me-face
'((((background light))
(:foreground "blue3"
:background "lavender"
......@@ -425,36 +447,193 @@ for `lyskom-background-colors' for more information."
:weight bold)
)
)
"Face used to show your own name."
"Face suitable for showing your own name.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--plain--highlight-face
(defface kom-face--default--highlight-face
'((((background light))
(:background "seagreen")
(:background "darkseagreen2")
)
(((background dark))
(:background "darkblue")
)
)
"Face used for various highlights."
"Face suitable for various highlights.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--plain--text-face
(defface kom-face--default--subject-face
'((t nil))
"Face used for text bodies."
"Face suitable for subject lines.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--text-no-face
'((((background light))
(:foreground "blue4")
)
(((background dark))
(:foreground "lightblue")
)
)
"Face suitable for text numbers.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--friends-face
'((((background light))
(:foreground "blue3"
:background "lavender")
)
(((background dark))
(:foreground "red")
)
)
"Face suitable for people in kom-friends.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--plain--subject-face
(defface kom-face--default--morons-face
'((((background light))
(:foreground "blue3"
:background "yellow")
)
(((background dark))
(:foreground "yellow")
)
)
"Face suitable for people in kom-morons.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--presence-face
'((((background light))
(:foreground "dim gray"
:slant italic)
)
(((background dark))
(:foreground "gray"
:slant italic)
)
)
"Face suitable for presence messages.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--mark-face
'((((background light))
(:foreground "blue3"
:background "lavender")
)
(((background dark))
(:foreground "gold"
:background "black")
)
)
"Face suitable for temporary marks.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--first-line-face
'((t (:weight bold)))
"Face suitable for the first line header of each text.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--warning-face
'((t (:weight bold :foreground "red")))
"Face suitable for displaying important warnings.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
(defface kom-face--default--dim-face
'((t (:foreground "gray")))
"Face suitable for dimmed items, such as passive memberships.
Do not change this face unless you know what you're doing."
:group 'lyskom-faces
)
;;; ----------------------------------------------------------------
;;; Dummy faces (copies of the default faces for uses to muck with.
;;;
(defface kom-face--user-defined--active-face
'((((background light))
(:foreground "blue4")
)
(((background dark))
(:foreground "lightblue")
)
)
"Face suitable for most \"clickable\" areas."
:group 'lyskom-faces
)
(defface kom-face--user-defined--url-face
'((((background light))
(:foreground "blueviolet")
)
(((background dark))
(:foreground "moccasin")
)
)
"Face suitable for URLs."
:group 'lyskom-faces
)
(defface kom-face--user-defined--me-face
'((((background light))
(:foreground "blue3"
:background "lavender"
:weight bold)
)