# HG changeset patch # User Bill Wohler # Date 1184133511 0 # Node ID d95a0f76740e2c6b4fc9513f901f2d5c0f69a396 # Parent 509a17eb26be61a62244e75fe09b60c9f0d5ab5f (mh-display-color-cells): Fix on XEmacs 21.5b28. Thanks to Henrique Martins for the help (closes SF #1749774). diff -r 509a17eb26be -r d95a0f76740e lisp/mh-e/mh-compat.el --- a/lisp/mh-e/mh-compat.el Tue Jul 10 23:30:18 2007 +0000 +++ b/lisp/mh-e/mh-compat.el Wed Jul 11 05:58:31 2007 +0000 @@ -77,13 +77,17 @@ '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.