From a425dc3d19516999acd278d6276cf8fde777cbed Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 27 Feb 2006 22:25:07 +0000 Subject: [PATCH] * 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. --- lisp/mh-e/ChangeLog | 8 ++++++++ lisp/mh-e/mh-compat.el | 10 +++++----- lisp/mh-e/mh-e.el | 7 +------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index a1043c6c6ee..5c15d9ef42d 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,11 @@ +2006-02-27 Bill Wohler + + * 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 * mh-e.el (mh-invisible-header-fields-internal): Added entry diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 4bc5fdf36f7..faa91a3bca2 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -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. diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 5a07524aec4..bfcc2b31656 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -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)) -- 2.39.2