Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
lyskom-elisp-client
lyskom-elisp-client
Commits
84eeb7e5
Commit
84eeb7e5
authored
Dec 02, 2000
by
Per Cederqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(device-class): Provide a better version if display-color-p exists.
parent
42300c03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
src/utilities.el
src/utilities.el
+27
-8
No files found.
src/utilities.el
View file @
84eeb7e5
...
...
@@ -673,14 +673,33 @@ The order of the list a is kept."
(
lyskom-provide-function
console-type
(
&optional
console
)
(
or
window-system
'tty
))
(
lyskom-provide-function
device-class
(
&optional
device
)
(
condition-case
nil
(
if
(
x-display-grayscale-p
)
(
if
(
x-display-color-p
)
'color
'grayscale
)
'mono
)
(
error
'mono
)))
(
lyskom-external-function
display-color-p
)
(
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
))))))
(
lyskom-provide-function
frame-property
(
frame
property
&optional
default
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment