emacs-diffs
[Top][All Lists]
Advanced

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

master 32d8fc999c 3/3: Avoid using aliases for color functions


From: Stefan Kangas
Subject: master 32d8fc999c 3/3: Avoid using aliases for color functions
Date: Tue, 9 Aug 2022 16:38:21 -0400 (EDT)

branch: master
commit 32d8fc999c070a4fa1539ebba6a6310bca58c5ef
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Avoid using aliases for color functions
    
    * lisp/emulation/viper-init.el (viper-has-face-support-p):
    * lisp/emulation/viper-util.el (viper-save-cursor-color)
    (viper-change-cursor-color):
    * lisp/faces.el (read-color):
    * lisp/net/dictionary.el (dictionary-color-support):
    * lisp/obsolete/gs.el (gs-set-ghostview-colors-window-prop):
    * lisp/progmodes/cperl-mode.el (cperl-choose-color):
    * lisp/woman.el (woman-fontify): Avoid using aliases for
    color-defined-p, display-color-p, and color-values.
---
 lisp/emulation/viper-init.el |  2 +-
 lisp/emulation/viper-util.el | 12 ++++++------
 lisp/faces.el                |  2 +-
 lisp/net/dictionary.el       |  2 +-
 lisp/obsolete/gs.el          |  2 +-
 lisp/progmodes/cperl-mode.el |  2 +-
 lisp/woman.el                |  2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 5430cd700b..df2487a447 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -71,7 +71,7 @@ In all likelihood, you don't need to bother with this 
setting."
 (defun viper-has-face-support-p ()
   (cond ((viper-window-display-p))
        (viper-force-faces)
-        ((x-display-color-p))
+        ((display-color-p))
        (t (memq window-system '(pc)))))
 
 
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index c9e4fa70d0..25c55acf96 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -57,7 +57,7 @@
 (define-obsolete-function-alias 'viper-int-to-char #'identity "27.1")
 (define-obsolete-function-alias 'viper-get-face #'facep "27.1")
 (define-obsolete-function-alias 'viper-color-defined-p
-  #'x-color-defined-p "27.1")
+  #'color-defined-p "27.1")
 (define-obsolete-function-alias 'viper-iconify
   #'iconify-or-deiconify-frame "27.1")
 
@@ -71,7 +71,7 @@
         (= char char1))
        (t nil)))
 
-(define-obsolete-function-alias 'viper-color-display-p #'x-display-color-p 
"29.1")
+(define-obsolete-function-alias 'viper-color-display-p #'display-color-p 
"29.1")
 
 (defun viper-get-cursor-color (&optional _frame)
   (cdr (assoc 'cursor-color (frame-parameters))))
@@ -89,8 +89,8 @@ Otherwise return the normal value."
 
 ;; cursor colors
 (defun viper-change-cursor-color (new-color &optional frame)
-  (if (and (viper-window-display-p) (x-display-color-p)
-          (stringp new-color) (x-color-defined-p new-color)
+  (if (and (viper-window-display-p) (display-color-p)
+           (stringp new-color) (color-defined-p new-color)
           (not (string= new-color (viper-get-cursor-color))))
       (modify-frame-parameters
        (or frame (selected-frame))
@@ -121,9 +121,9 @@ Otherwise return the normal value."
 
 ;; By default, saves current frame cursor color before changing viper state
 (defun viper-save-cursor-color (before-which-mode)
-  (if (and (viper-window-display-p) (x-display-color-p))
+  (if (and (viper-window-display-p) (display-color-p))
       (let ((color (viper-get-cursor-color)))
-       (if (and (stringp color) (x-color-defined-p color)
+        (if (and (stringp color) (color-defined-p color)
                 ;; there is something fishy in that the color is not saved if
                 ;; it is the same as frames default cursor color. need to be
                 ;; checked.
diff --git a/lisp/faces.el b/lisp/faces.el
index d75c66f881..c7acbf5758 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2037,7 +2037,7 @@ as backgrounds."
             (setq color (background-color-at-point))))
       (when (and convert-to-RGB
                 (not (string-equal color "")))
-       (let ((components (x-color-values color)))
+        (let ((components (color-values color)))
          (unless (string-match-p 
"^#\\(?:[[:xdigit:]][[:xdigit:]][[:xdigit:]]\\)+$" color)
            (setq color (format "#%04X%04X%04X"
                                (logand 65535 (nth 0 components))
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 9143c7d111..43dd28ff6d 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -357,7 +357,7 @@ is utf-8"
 
 (defvar dictionary-color-support
   (condition-case nil
-      (x-display-color-p)
+      (display-color-p)
     (error nil))
   "Determines if the Emacs has support to display color.")
 
diff --git a/lisp/obsolete/gs.el b/lisp/obsolete/gs.el
index 7bf324ceec..d5a8713129 100644
--- a/lisp/obsolete/gs.el
+++ b/lisp/obsolete/gs.el
@@ -144,7 +144,7 @@ image in pixels."
 
 (defun gs-set-ghostview-colors-window-prop (frame pixel-colors)
   "Set the `GHOSTVIEW_COLORS' environment variable depending on FRAME."
-  (let ((mode (cond ((x-display-color-p frame) "Color")
+  (let ((mode (cond ((display-color-p frame) "Color")
                    ((x-display-grayscale-p frame) "Grayscale")
                    (t "Monochrome"))))
     (x-change-window-property "GHOSTVIEW_COLORS"
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index c6235d9013..91c00ad048 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -98,7 +98,7 @@
   (let (answer)
     (while list
       (or answer
-         (if (or (x-color-defined-p (car list))
+          (if (or (color-defined-p (car list))
                  (null (cdr list)))
              (setq answer (car list))))
       (setq list (cdr list)))
diff --git a/lisp/woman.el b/lisp/woman.el
index 23ce2218b5..7f494a3b68 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -902,7 +902,7 @@ Troff emulation is experimental and largely untested.
 (defcustom woman-fontify
   (or (display-color-p)
       (display-graphic-p)
-      (x-display-color-p))
+      (display-color-p))
   "If non-nil then WoMan assumes that face support is available.
 It defaults to a non-nil value if the display supports either colors
 or different fonts."



reply via email to

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