blob: defb1b515b0ed38811012f2555924a67ad1dfc95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
;; proof-comapt.el Operating system and Emacs version compatibility
;;
;; Copyright (C) 2000 LFCS Edinburgh.
;;
;; Author: David Aspinall <da@dcs.ed.ac.uk> and others
;; Maintainer: Proof General maintainer <proofgen@dcs.ed.ac.uk>
;;
;; $Id$
;;
;; This file collects together compatibility hacks for different
;; operating systems and Emacs versions. This is to help keep
;; track of them.
;;
;; The development policy for Proof General is for the main codebase
;; to be written for the latest stable version of XEmacs. We follow
;; XEmacs advice on removing obsolete function calls.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Architecture flags
;;;
(eval-and-compile
(defvar proof-running-on-XEmacs (string-match "XEmacs" emacs-version)
"Non-nil if Proof General is running on XEmacs.")
;; rough test for XEmacs on win32, anyone't know about FSF there?
(defvar proof-running-on-win32 (fboundp 'win32-long-file-name)
"Non-nil if Proof General is running on a win32 system."))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; XEmacs compatibility
;;;
;; browse-url function isn't autoloaded in XEmacs 20.4
(or (fboundp 'browse-url)
(autoload 'browse-url "browse-url"
"Ask a WWW browser to load URL." t))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; FSF compatibility
;;;
;; These days cl is dumped with XEmacs (20.4,21.1) but not FSF Emacs
;; 20.2. Would rather it was autoloaded but the autoloads are broken
;; in FSF so we load it now.
(require 'cl)
;; Give a warning,
(or (fboundp 'warn)
(defun warn (str &rest args)
"Issue a warning STR. Defined by PG for FSF compatibility."
(apply 'message str args)
(sit-for 2)))
;; Modeline redrawing (actually force-mode-line-update is alias on XEmacs)
(or (fboundp 'redraw-modeline)
(defun redraw-modeline (&rest args)
"Dummy function for Proof General on FSF Emacs."
(force-mode-line-update)))
;; Interactive flag
(or (fboundp 'noninteractive)
(defun noninteractive ()
"Dummy function for Proof General on FSF Emacs."
nil)) ;; pretend always interactive.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Old Emacs version compatibility
;;;
;; Create a menu from a customize group, for older/non-existent customize
(or (fboundp 'customize-menu-create)
(defun customize-menu-create (&rest args)
"Dummy function for PG; please upgrade your Emacs."
nil))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; General Emacs version compatibility
;;;
;; These are internal functions of font-lock, autoload policy
;; differs between Emacs versions
(or (fboundp 'font-lock-set-defaults)
(autoload 'font-lock-set-defaults "font-lock"))
(or (fboundp 'font-lock-fontify-region)
(autoload 'font-lock-fontify-region "font-lock"))
(or (fboundp 'font-lock-append-text-property)
(autoload 'font-lock-append-text-property "font-lock"))
;; FIXME: todo: keybinding compat here, esp for mouse.
;; See Isamode and emu.el for ideas.
;; End of proof-compat.el
(provide 'proof-compat)
|