changeset 69186:4eb7009c53f4

* 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.
author Bill Wohler <wohler@newt.com>
date Mon, 27 Feb 2006 22:25:07 +0000
parents ee54b3a792ff
children 280cf586dca0
files lisp/mh-e/ChangeLog lisp/mh-e/mh-compat.el lisp/mh-e/mh-e.el
diffstat 3 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mh-e/ChangeLog	Mon Feb 27 22:10:43 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Mon Feb 27 22:25:07 2006 +0000
@@ -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
--- a/lisp/mh-e/mh-compat.el	Mon Feb 27 22:10:43 2006 +0000
+++ b/lisp/mh-e/mh-compat.el	Mon Feb 27 22:25:07 2006 +0000
@@ -79,11 +79,11 @@
 
 (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.
--- a/lisp/mh-e/mh-e.el	Mon Feb 27 22:10:43 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Mon Feb 27 22:25:07 2006 +0000
@@ -101,12 +101,7 @@
 
 (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))