From b9584630e3a401dbff0f8f9b3e80012078987109 Mon Sep 17 00:00:00 2001 From: Ulrik Haugen Date: Sun, 17 Dec 2000 00:38:16 +0000 Subject: [PATCH] =?UTF-8?q?applied=20patch=20from=20Per=20Starb=C3=A4ck=20?= =?UTF-8?q?regarding=20definition=20of=20device-class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ChangeLog | 6 ++++++ src/utilities.el | 46 +++++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c52e70a4..89804cf1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2000-12-17 Ulrik Haugen + + * utilities.el: applied patch from Per Starbäck, device-class + isn't defined if it doesn't exist, lyskom-device-class is. Caller + changed. (Se text 5867166 in LysLysKOM.) + 2000-12-12 David Byers * Release av 0.46.1-BETA-4 diff --git a/src/utilities.el b/src/utilities.el index 6b76bbef..d37af0e5 100644 --- a/src/utilities.el +++ b/src/utilities.el @@ -677,30 +677,26 @@ The order of the list a is kept." (lyskom-external-function display-grayscale-p) (eval-and-compile - (if (fboundp 'device-class) - nil - (setq lyskom-compatibility-definitions - (cons 'device-class lyskom-compatibility-definitions)) - (if (and (fboundp 'display-color-p) (fboundp 'display-grayscale-p)) - ;; Emacs 21 can use color even when not running under - ;; X-windows. Note that display-grayscale-p can be false when - ;; using a color display! This happens when running on a - ;; classic Linux tty console. - - (defun device-class (&optional device) - (cond ((display-color-p device) 'color) - ((display-grayscale-p device) 'grayscale) - (t 'mono))) - ;; This works in Emacs 20 and earlier. - (defun device-class (&optional device) - (condition-case nil - (if (x-display-grayscale-p device) - (if (x-display-color-p device) - 'color - 'grayscale) - 'mono) - (error 'mono)))))) - + (cond ((fboundp 'device-class) ; XEmacsism + (defalias 'lyskom-device-class 'device-class)) + ((and (fboundp 'display-color-p) (fboundp 'display-grayscale-p)) + ;; Emacs 21 can use color even when not running under + ;; X-windows. Note that display-grayscale-p can be false when + ;; using a color display! This happens when running on a + ;; classic Linux tty console. + (defun lyskom-device-class (&optional device) + (cond ((display-color-p device) 'color) + ((display-grayscale-p device) 'grayscale) + (t 'mono)))) + (t ;; This works in Emacs 20 and earlier. + (defun lyskom-device-class (&optional device) + (condition-case nil + (if (x-display-grayscale-p device) + (if (x-display-color-p device) + 'color + 'grayscale) + 'mono) + (error 'mono)))))) (lyskom-provide-function frame-property (frame property &optional default) (or (cdr (assq property (frame-parameters frame))) @@ -909,7 +905,7 @@ also reads the proper X resources." (unless kom-default-face-scheme (setq kom-default-face-scheme (condition-case nil - (cond ((eq (device-class) 'mono) 'monochrome) + (cond ((eq (lyskom-device-class) 'mono) 'monochrome) ((eq (lyskom-background-mode) 'dark) 'inverse) (t 'default)) -- GitLab