]> code.delx.au - gnu-emacs/commitdiff
* mh-compat.el (mh-display-color-cells): Return 2 if
authorBill Wohler <wohler@newt.com>
Mon, 27 Feb 2006 22:25:07 +0000 (22:25 +0000)
committerBill Wohler <wohler@newt.com>
Mon, 27 Feb 2006 22:25:07 +0000 (22:25 +0000)
device-color-cells returns nil (closes SF #1436924).

* mh-e.el (mh-compiling-flag): Delete. No longer needed by
mh-display-color-cells.

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

index a1043c6c6ee29f4028274d4b96056c3e8c1a17b0..5c15d9ef42dba0a59af8a67f0b9a1ca1d18e6612 100644 (file)
@@ -1,3 +1,11 @@
+2006-02-27  Bill Wohler  <wohler@newt.com>
+
+       * mh-compat.el (mh-display-color-cells): Return 2 if
+       device-color-cells returns nil (closes SF #1436924).
+
+       * mh-e.el (mh-compiling-flag): Delete. No longer needed by
+       mh-display-color-cells.
+
 2006-02-21  Eric Ding  <ericding@alum.mit.edu>
 
        * mh-e.el (mh-invisible-header-fields-internal): Added entry
index 4bc5fdf36f75a8a2c326a3c906f6e56e2bf7c315..faa91a3bca2584b18b442d9b4b94b2c2f474fcf1 100644 (file)
@@ -79,11 +79,11 @@ introduced in Emacs 22."
 
 (mh-defun-compat mh-display-color-cells display-color-cells (&optional display)
   "Return the number of color cells supported by DISPLAY.
-This function is used by XEmacs to always return 0 when compiling
-to avoid compiling errors. Otherwise uses `device-color-cells'."
-  (if mh-compiling-flag
-      0
-    (device-color-cells display)))
+This function is used by XEmacs to return 2 when
+`device-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))
 
 (defmacro mh-display-completion-list (completions &optional common-substring)
   "Display the list of COMPLETIONS.
index 5a07524aec404de5c09ba7d41dd528db3bf02efd..bfcc2b316567141daa338740159c8c74a81b6f5d 100644 (file)
 
 (eval-and-compile
   (defvar mh-xemacs-flag (featurep 'xemacs)
-    "Non-nil means the current Emacs is XEmacs.")
-  (defvar mh-compiling-flag nil
-    "Non-nil means we're compiling."))
-
-(eval-when (compile)
-  (setq mh-compiling-flag t))
+    "Non-nil means the current Emacs is XEmacs."))
 
 (mh-do-in-xemacs
   (require 'mh-xemacs))