aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/proof-config.el4
-rw-r--r--generic/proof-menu.el2
-rw-r--r--generic/proof-splash.el11
-rw-r--r--generic/proof-toolbar.el7
-rw-r--r--generic/proof-x-symbol.el4
-rw-r--r--lib/proof-compat.el53
6 files changed, 61 insertions, 20 deletions
diff --git a/generic/proof-config.el b/generic/proof-config.el
index 4dd81147..0ca0155a 100644
--- a/generic/proof-config.el
+++ b/generic/proof-config.el
@@ -71,6 +71,7 @@
;; ==================================================
(require 'proof-utils) ;; Macros used below
+(require 'proof-compat) ;; For pg-defface-window-systems
;;
@@ -456,7 +457,8 @@ signals to the remote host."
(list (list (list 'type ty) '(class color)
(list 'background 'dark))
(quote ,bd))))
- '(x mswindows gtk mac)))
+ ;; NOTE: see proof-compat.el for possible window-system values
+ pg-defface-window-systems))
(list (list t (quote ,ow)))))
(defface proof-queue-face
diff --git a/generic/proof-menu.el b/generic/proof-menu.el
index 0a7533a6..1ce3c577 100644
--- a/generic/proof-menu.el
+++ b/generic/proof-menu.el
@@ -339,7 +339,7 @@ without adjusting window layout."
;; non-Emacs users. Cf. Gnome usability studies: menus saying
;; "Web Browser" more useful to novices than menus saying "Mozilla"!!
["Multiple Windows" proof-multiple-frames-toggle
- :active (display-graphic-p)
+ :active (pg-window-system)
:style toggle
:selected proof-multiple-frames-enable]
["Delete Empty Panes" proof-delete-empty-windows-toggle
diff --git a/generic/proof-splash.el b/generic/proof-splash.el
index df4c9cbb..fd4ca491 100644
--- a/generic/proof-splash.el
+++ b/generic/proof-splash.el
@@ -108,17 +108,20 @@ DEFAULT gives return value in case image not valid."
(file-readable-p (aref inst 2)))))
img)
(cond
- ((and window-system proof-running-on-XEmacs (featurep 'jpeg) (not nojpeg)
+ ((and proof-running-on-XEmacs (pg-window-system)
+ (featurep 'jpeg) (not nojpeg)
(funcall validfn jpg))
jpg)
- ((and window-system proof-running-on-XEmacs (featurep 'gif) (funcall validfn gif))
+ ((and proof-running-on-XEmacs (pg-window-system)
+ (featurep 'gif) (funcall validfn gif))
gif)
- ((and window-system proof-running-on-XEmacs (featurep 'xpm) (funcall validfn xpm))
+ ((and proof-running-on-XEmacs (pg-window-system)
+ (featurep 'xpm) (funcall validfn xpm))
xpm)
;; Support GNU Emacs 21
((and
proof-running-on-Emacs21
- window-system
+ (pg-window-system)
(setq img
(find-image
(list
diff --git a/generic/proof-toolbar.el b/generic/proof-toolbar.el
index 7d7e7c8e..8825a66f 100644
--- a/generic/proof-toolbar.el
+++ b/generic/proof-toolbar.el
@@ -133,14 +133,13 @@ If `proof-toolbar-enable' is nil, change the current buffer toolbar
to the default toolbar."
(interactive)
(if
- (and ;; Check support in Emacs
+ (and ;; Check toolbar support in Emacs
(or (and (featurep 'tool-bar) ; GNU Emacs tool-bar library
(member 'xpm image-types)) ; and XPM support
(and (featurep 'toolbar) ; or XEmacs toolbar library
(featurep 'xpm))) ; and XPM support
- ;; Check support in Window system
- (memq (if proof-running-on-XEmacs (console-type) window-system)
- '(x mswindows gtk mac)))
+ ;; Check we're running in a windowing system
+ (pg-window-system))
;; Toolbar support is possible.
(progn
diff --git a/generic/proof-x-symbol.el b/generic/proof-x-symbol.el
index ace4ac64..37599116 100644
--- a/generic/proof-x-symbol.el
+++ b/generic/proof-x-symbol.el
@@ -64,7 +64,7 @@
"A test to see whether x-symbol support may be available."
(and
(or (featurep 'x-symbol-hooks)
- (and window-system ; Not on a tty
+ (and (pg-window-system) ; Not on a tty
(progn
;; put bundled version on load path
(setq load-path
@@ -104,7 +104,7 @@ If ERROR is non-nil, give error on failure, otherwise a warning."
(funcall error-or-warn
"Proof General: x-symbol package must be installed for x-symbol-support!
The package is available at http://x-symbol.sourceforge.net/"))
- ((not window-system)
+ ((not (pg-window-system))
(funcall error-or-warn
"Proof General: x-symbol package only runs under a window system!"))
((or (not (fboundp 'x-symbol-initialize))
diff --git a/lib/proof-compat.el b/lib/proof-compat.el
index 4621f58f..5a7af707 100644
--- a/lib/proof-compat.el
+++ b/lib/proof-compat.el
@@ -95,17 +95,54 @@ with `path-separator'."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
+;;; Window systems
+;;;
+
+;; A useful function of GNU Emacs: support it in XEmacs if not already there
+;; NOTE! Unfortunately this is present in some XEmacs versions but
+;; returns the wrong value (e.g. nil on a graphic display).
+; (or (fboundp 'display-graphic-p)
+; (defun display-graphic-p ()
+; "Return non-nil if DISPLAY is a graphic display.
+; Graphical displays are those which are capable of displaying several
+; frames and several different fonts at once. This is true for displays
+; that use a window system such as X, and false for text-only terminals."
+; (not (memq (console-type) '(tty stream dead)))))
+
+;; Let's define our own version based on window-system.
+;; Even though this is deprecated on XEmacs, it seems more likely
+;; that things will go wrong on badly ported Emacs than users
+;; using multiple devices, some of which are ttys...
+(defun pg-window-system ()
+ "Return non-nil if we're on a window system. Simply use `window-system'."
+ (and window-system t))
+
+;; The next constant is used in proof-config for defface calls.
+;; Unfortunately defface uses window-system, which Emacs porters like
+;; to invent new symbols for each time, which is a pain.
+;; This list has the ones I know about so far.
+
+(defconst pg-defface-window-systems
+ '(x ;; bog standard
+ mswindows ;; Windows
+ gtk ;; gtk emacs (obsolete?)
+ mac ;; used by Aquamacs
+ carbon ;; used by Carbon XEmacs
+ ns ;; NeXTstep Emacs (Emacs.app)
+ x-toolkit) ;; possible catch all (but probably not)
+ "A list of possible values for `window-system'.
+If you are on a window system and your value of `window-system' is
+not listed here, you may not get the correct syntax colouring behaviour.")
+
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
;;; XEmacs compatibility with GNU Emacs
;;;
-(or (fboundp 'display-graphic-p)
- (defun display-graphic-p ()
- "Return non-nil if DISPLAY is a graphic display.
-Graphical displays are those which are capable of displaying several
-frames and several different fonts at once. This is true for displays
-that use a window system such as X, and false for text-only terminals."
- (or (eq (console-type) 'x)
- (eq (console-type) 'mswindows))))
(or (fboundp 'subst-char-in-string)
;; Code is taken from Emacs 21.2.1/subr.el