Commit 29aaeb55 authored by Pontus Freyhult's avatar Pontus Freyhult

Revert to aliases for face-foreground and face-background and related changes:

New function lyskom-safe-color-name and changes in lp--entry-set-background and
lp--entry-set-foreground.
parent 23726fba
2004-10-29 Pontus Freyhult <pont@soua.net>
* mship-edit.el (lp--entry-set-background): Use
lyskom-safe-color-name.
(lp--entry-set-foreground): Dito.
* utilities.el (lyskom-safe-color-name): New function.
* compatibility.el (color-name): New alias.
(color-specifier-p): New alias.
(face-background): Reverted previous change, alias again.
(face-foreground): Reverted previous change, alias again.
2004-10-29 Pontus Freyhult <pont@pontus.its.uu.se>
* lyskom-rest.el (lyskom-format-image): Disabled run time
......@@ -7,7 +20,6 @@
(put-image): New alias.
(create-image): New alias.
2004-10-29 Pontus Freyhult <pont@soua.net>
* lyskom-rest.el (lyskom-format-image): Bugix: Used let instead
......
......@@ -301,24 +301,8 @@ KEYS should be a string in the format used for saving keyboard macros
(lyskom-function-alias frame-property (frame property &optional default)
(or (cdr (assq property (frame-parameters frame))) default))
(defun lyskom-face-background (face)
"Call face-background and return a string with the name or nil."
(let ((f (face-background face nil)))
(cond ((stringp f) f)
((and (fboundp 'color-specifier-p)
(color-specifier-p f))
(color-name f)))))
(defun lyskom-face-foreground (face)
"Call face-foreground and return a string with the name or nil."
(let ((f (face-foreground face nil)))
(cond ((stringp f) f)
((and (fboundp 'color-specifier-p)
(color-specifier-p f))
(color-name f)))))
(lyskom-function-alias face-background (face) nil)
(lyskom-function-alias face-foreground (face) nil)
(lyskom-function-alias find-face (face) (and (facep face) face))
......@@ -355,6 +339,9 @@ See `walk-windows' for the meaning of MINIBUF and FRAME."
;;; ================================================================
;;; Color stuff
(lyskom-function-alias color-specifier-p (obj) nil)
(lyskom-function-alias color-name (obj) nil)
(lyskom-with-external-functions (color-rgb-components
make-specifier
set-specifier)
......
......@@ -170,7 +170,8 @@ This function does not tell the server about the change."
(delq extent (lp--entry->extents entry)))))
(let* ((extent (cdr (assq 'color (lp--entry->extents entry))))
(facename (intern (format "lyskom-%s-background" color)))
(facename (intern (format "lyskom-%s-background"
(lyskom-safe-color-name color))))
(face (or (lyskom-find-face facename) (lyskom-make-face facename t))))
(unless extent
(lyskom-xemacs-or-gnu
......@@ -203,7 +204,8 @@ This function does not tell the server about the change."
(delq extent (lp--entry->extents entry)))))
(let* ((extent (cdr (assq 'fcolor (lp--entry->extents entry))))
(facename (intern (format "lyskom-%s-foreground" color)))
(facename (intern (format "lyskom-%s-foreground"
(lyskom-safe-color-name color))))
(face (or (lyskom-find-face facename) (lyskom-make-face facename t))))
(unless extent
(lyskom-xemacs-or-gnu
......
......@@ -1889,6 +1889,11 @@ has the bug in that algorithm fixed)."
;;; '(face test-default))))))
;;;
(defun lyskom-safe-color-name (c)
"Return a color name as a string or nil."
(cond ((stringp c) c)
((lyskom-color-specifier-p c) (lyskom-color-name c))))
(defun lyskom-is-url (text)
"Return non-nil if TEXT can be interpreted as an URL.
......
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