]> git.eshelyaron.com Git - emacs.git/commitdiff
(mh-display-color-cells): Fix on XEmacs 21.5b28. Thanks to Henrique
authorBill Wohler <wohler@newt.com>
Wed, 11 Jul 2007 05:58:45 +0000 (05:58 +0000)
committerBill Wohler <wohler@newt.com>
Wed, 11 Jul 2007 05:58:45 +0000 (05:58 +0000)
Martins for the help (closes SF #1749774).

lisp/mh-e/ChangeLog
lisp/mh-e/mh-compat.el

index 3d3a08e0528d89962b3c4c53867736850a0be9de..97ccda6e0480eea6541e98a4c78888a707b4a4da 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-11  Bill Wohler  <wohler@newt.com>
+
+       * mh-compat.el (mh-display-color-cells): Fix on XEmacs 21.5b28.
+       Thanks to Henrique Martins for the help (closes SF #1749774).
+
 2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
 
        * mh-mime.el (mh-mh-directive-present-p):
index 2f57e1763ab6f234fd1e911cb7e190b8a1c36ce3..a1382a8298ee34f95549a95d8717c398c2cb150a 100644 (file)
@@ -77,13 +77,17 @@ introduced in Emacs 22."
       'cancel-timer
     'delete-itimer))
 
-(defun-mh mh-display-color-cells display-color-cells (&optional display)
+(defun mh-display-color-cells (&optional display)
   "Return the number of color cells supported by DISPLAY.
-This function is used by XEmacs to return 2 when
-`device-color-cells' returns nil. This happens when compiling or
+This function is used by XEmacs to return 2 when `device-color-cells'
+or `display-color-cells' returns nil. This happens when compiling or
 running on a tty and causes errors since `display-color-cells' is
 expected to return an integer."
-  (or (device-color-cells display) 2))
+  (cond ((fboundp 'display-color-cells) ; GNU Emacs, XEmacs 21.5b28
+         (or (display-color-cells display) 2))
+        ((fboundp 'device-color-cells)  ; XEmacs 21.4
+         (or (device-color-cells display) 2))
+        (t 2)))
 
 (defmacro mh-display-completion-list (completions &optional common-substring)
   "Display the list of COMPLETIONS.