1 ;;; No byte-compiler warnings
5 ;;; Keep these obsolete variables for backward compatibility
6 (defconst era-version "0.95" "\
7 Version numbers of this version of Era.")
9 ;; We're (not really anymore) calling this version Sun Era.
13 "Return (obsolete) string describing the version of Era that is running.
14 Era is now known as XEmacs. Use (emacs-version) instead."
17 (message "%s" (era-version))
18 (format "%sEra %s of %s %s on %s (%s)"
19 (if sun-era "Sun " "")
21 (substring emacs-build-time 0
22 (string-match " *[0-9]*:" emacs-build-time))
23 (substring emacs-build-time
24 (string-match "[0-9]*$" emacs-build-time))
25 emacs-build-system system-type)))
27 ;(defun sunpro-maybe-connect-to-tooltalk ()
28 ; (if (and (not (noninteractive))
29 ; (fboundp 'command-line-do-tooltalk))
30 ; (command-line-do-tooltalk nil)))
32 ;; sunpro-maybe-connect-to-tooltalk must appear in the hook list
33 ;; before any clients that register patterns, like eos-load.el.
34 ;; Currently eos-load.el places its functions at the end of the list
36 ;(add-hook 'before-init-hook 'sunpro-maybe-connect-to-tooltalk)
38 (set-glyph-image text-pointer-glyph "xterm")
39 (set-glyph-image nontext-pointer-glyph "xterm")
41 ;; W3 doesn't know about using pageview, so let's fix that.
42 ;; There doesn't seem to be any such function `w3-parse-mailcap' - mrb
44 ;(defun sunpro-fix-postscript-viewer ()
45 ; (if (not (noninteractive))
48 ; (expand-file-name "sparcworks/sunpro-mailcap" data-directory))
51 ;(add-hook 'w3-load-hooks 'sunpro-fix-postscript-viewer)
53 ;; turn on pending delete without messing up its autoloads
54 ;(defun sunpro-pending-delete-on ()
55 ; (if (not (noninteractive))
56 ; (pending-delete-on nil)))
58 ;(add-hook 'before-init-hook 'sunpro-pending-delete-on)
60 ;;; Decide whether to use workshop.el or eos at runtime, based on
61 ;;; which Sun DevPro products are installed.
63 (defun sunpro-update-paths-for-workshop ()
64 "Update exec-path and load-path to find supporting workshop files.
65 Returns nil if the required files cannot be found."
68 ((locate-file "workshop.el" load-path))
70 ((file-exists-p (concat sunpro-dir "lib/workshop.el"))
71 (setq load-path (append load-path (list (concat sunpro-dir "lib/"))))))
74 ((locate-file "workshop" exec-path))
76 ((file-exists-p (concat sunpro-dir "bin/workshop"))
77 (setq exec-path (append exec-path (list (concat sunpro-dir "bin/"))))))))
79 (defun sunpro-startup ()
80 "Runs at startup if support for Sun Workshop is compiled in. Don't run this."
82 ;; Sun distribution censors yow, among other things...
83 (unless (locate-file "yow.el" load-path)
85 (delete-menu-item '("Apps" "Games" "Quote from Zippy"))
86 (delete-menu-item '("Apps" "Games" "Psychoanalyze Zippy!")))
88 (when (not (noninteractive))
93 (file-exists-p (concat dir "bin/workshop"))
94 (file-exists-p (concat dir "lib/workshop.el")))))
98 ((let ((path exec-path) dir (found nil))
99 (while (and path (not found))
100 (setq dir (or (car path) "."))
101 (setq path (cdr path))
102 (setq dir (concat dir (if (string-match "/$" dir) "../" "/../")))
103 (setq found (sunpro-dir-p dir)))
105 (expand-file-name dir))))
107 ;; Check for standard Sun DevPro CD Install layout
108 ((if (string-match "contrib/[^/]+/[^/]+/[^/]+/[^/]+/$" exec-directory)
109 (let ((dir (substring exec-directory 0 (match-beginning 0))))
110 (if (sunpro-dir-p dir)
111 (expand-file-name dir)))))
113 ;; Default install location
116 "Directory where Sun Developer Products are installed."))
118 ;; Sunpro ships the mule version as a 2-file addition to the
119 ;; non-mule distribution - the binary and the doc file.
121 ;; This is a quick hack, I know...
122 ;; There ought to be a better way to do this.
123 ;; Perhaps a --xemacs-flavor=mule flag?
125 (let ((mule-doc-file-name (concat internal-doc-file-name "-mule")))
126 (if (file-exists-p (concat doc-directory mule-doc-file-name))
127 (setq internal-doc-file-name mule-doc-file-name))))
129 ;; Connect to tooltalk, but only on an X server.
130 (when (and (featurep 'tooltalk)
131 (fboundp 'command-line-do-tooltalk)
132 (eq 'x (device-type)))
133 (command-line-do-tooltalk nil))
135 ;; Sun's pending-del default is like textedit's
136 (require 'pending-del)
137 (turn-on-pending-delete)
139 ;; Bar cursor 2 pixels wide
142 ;; Nice CDE compliant icon -- now the default...
143 ;;(if (featurep 'xpm)
146 ;; (format "%s%s" data-directory "xemacs-icon3.xpm")
150 ;; Use Sun WorkShop if available
151 ((sunpro-update-paths-for-workshop)
152 ;; Unfortunately, changes to the default toolbar in 20.3 b21
153 ;; have broken workshop-frob-toolbar in workshop.el. Since new
154 ;; XEmacsen have to work with older WorkShops, this must be
155 ;; fixed both in workshop.el (distributed on the Sun WorkShop CD)
156 ;; and worked-around here.
157 (set-specifier default-toolbar
158 (append (specifier-instance default-toolbar)
159 `([,(toolbar-make-button-list nil)
160 workshop-bugfix nil nil])))
162 (set-specifier default-toolbar
163 (delete-if (lambda (b) (eq (aref b 1) 'workshop-bugfix))
164 (specifier-instance default-toolbar))))
166 ;; Else, use eos package with sparcworks if available
168 (locate-file "sparcworks" exec-path)
170 (file-exists-p (concat sunpro-dir "bin/sparcworks"))
171 (setq exec-path (append exec-path (list (concat sunpro-dir "bin/"))))))
173 (load "sun-eos-init")
174 (load "sun-eos-common")
175 (load "sun-eos-editor")
176 (load "sun-eos-browser")
177 (load "sun-eos-debugger")
178 (load "sun-eos-debugger-extra")
179 (load "sun-eos-menubar")
182 (t ; Neither? Complain...
185 "XEmacs was compiled with support for Sun Developer Products,
186 but neither `workshop' nor `sparcworks' were found on the PATH.")))
189 (add-hook 'before-init-hook 'sunpro-startup)