annotate lisp/sunpro/sunpro-init.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 56c54cf7c5b6
children 54cc21c15cbb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; No byte-compiler warnings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;(eval-when-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ; (require 'w3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; Keep these obsolete variables for backward compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 (defconst era-version "0.95" "\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 Version numbers of this version of Era.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; We're (not really anymore) calling this version Sun Era.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 (defconst sun-era t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 (defun era-version ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 "Return (obsolete) string describing the version of Era that is running.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 Era is now known as XEmacs. Use (emacs-version) instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 (if (interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 (message "%s" (era-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (format "%sEra %s of %s %s on %s (%s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 (if sun-era "Sun " "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 era-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 (substring emacs-build-time 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (string-match " *[0-9]*:" emacs-build-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 (substring emacs-build-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 (string-match "[0-9]*$" emacs-build-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 emacs-build-system system-type)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;(defun sunpro-maybe-connect-to-tooltalk ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ; (if (and (not (noninteractive))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ; (fboundp 'command-line-do-tooltalk))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ; (command-line-do-tooltalk nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; sunpro-maybe-connect-to-tooltalk must appear in the hook list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; before any clients that register patterns, like eos-load.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Currently eos-load.el places its functions at the end of the list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;(add-hook 'before-init-hook 'sunpro-maybe-connect-to-tooltalk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (set-glyph-image text-pointer-glyph "xterm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (set-glyph-image nontext-pointer-glyph "xterm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; W3 doesn't know about using pageview, so let's fix that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; There doesn't seem to be any such function `w3-parse-mailcap' - mrb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;(defun sunpro-fix-postscript-viewer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ; (if (not (noninteractive))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ; (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ; (w3-parse-mailcap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ; (expand-file-name "sparcworks/sunpro-mailcap" data-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ; (error nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;(add-hook 'w3-load-hooks 'sunpro-fix-postscript-viewer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; turn on pending delete without messing up its autoloads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;(defun sunpro-pending-delete-on ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ; (if (not (noninteractive))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ; (pending-delete-on nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;(add-hook 'before-init-hook 'sunpro-pending-delete-on)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;;; Decide whether to use workshop.el or eos at runtime, based on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;;; which Sun DevPro products are installed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (defun sunpro-update-paths-for-workshop ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "Update exec-path and load-path to find supporting workshop files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 Returns nil if the required files cannot be found."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ((locate-file "workshop.el" load-path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ((file-exists-p (concat sunpro-dir "lib/workshop.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (setq load-path (append load-path (list (concat sunpro-dir "lib/"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ((locate-file "workshop" exec-path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ((file-exists-p (concat sunpro-dir "bin/workshop"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (setq exec-path (append exec-path (list (concat sunpro-dir "bin/"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defun sunpro-startup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (when (not (noninteractive))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
82 (flet
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
83 ((sunpro-dir-p (dir)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
84 (and dir
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
85 (file-exists-p (concat dir "bin/workshop"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
86 (file-exists-p (concat dir "lib/workshop.el")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (defconst sunpro-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (cond
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
89 ;; Look on the PATH
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ((let ((path exec-path) dir (found nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (while (and path (not found))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
92 (setq dir (or (car path) "."))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (setq path (cdr path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (setq dir (concat dir (if (string-match "/$" dir) "../" "/../")))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
95 (setq found (sunpro-dir-p dir)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (if found
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (expand-file-name dir))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
99 ;; Check for standard Sun DevPro CD Install layout
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
100 ((if (string-match "contrib/[^/]+/[^/]+/[^/]+/[^/]+/$" exec-directory)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
101 (let ((dir (substring exec-directory 0 (match-beginning 0))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
102 (if (sunpro-dir-p dir)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
103 (expand-file-name dir)))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
104
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
105 ;; Default install location
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
106 ("/opt/SUNWspro/"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
107
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
108 "Directory where Sun Developer Products are installed."))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
110 ;; Sunpro ships the mule version as a 2-file addition to the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
111 ;; non-mule distribution - the binary and the doc file.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
112 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
113 ;; This is a quick hack, I know...
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
114 ;; There ought to be a better way to do this.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
115 ;; Perhaps a --xemacs-flavor=mule flag?
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
116 (if (featurep 'mule)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
117 (let ((mule-doc-file-name (concat internal-doc-file-name "-mule")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
118 (if (file-exists-p (concat doc-directory mule-doc-file-name))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
119 (setq internal-doc-file-name mule-doc-file-name))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
48
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents: 2
diff changeset
121 ;; Connect to tooltalk, but only on an X server.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (and (featurep 'tooltalk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (fboundp 'command-line-do-tooltalk)
48
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents: 2
diff changeset
124 (eq 'x (device-type))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (command-line-do-tooltalk nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;; Sun's pending-del default is like textedit's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (require 'pending-del)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (pending-delete-on nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; Bar cursor 2 pixels wide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (setq bar-cursor 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;; Nice CDE compliant icon -- now the default...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;(if (featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ; (set-glyph-image
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ; frame-icon-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ; (format "%s%s" data-directory "xemacs-icon3.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ; 'global 'x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (cond
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
142 ;; Use Sun WorkShop if available
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ((sunpro-update-paths-for-workshop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (require 'workshop))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; Else, use eos package with sparcworks if available
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ((or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (locate-file "sparcworks" exec-path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (prog1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (file-exists-p (concat sunpro-dir "bin/sparcworks"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (setq exec-path (append exec-path (list (concat sunpro-dir "bin/"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (and (fboundp 'eos::start)) (eos::start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (t ; Neither? Complain...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (display-warning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 'sunpro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 "XEmacs was compiled with support for Sun Developer Products,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 but neither `workshop' nor `sparcworks' were found on the PATH.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (add-hook 'before-init-hook 'sunpro-startup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (provide 'sunpro)