Mercurial > hg > xemacs-beta
comparison lisp/sunpro/sunpro-init.el @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children | ac2d302a0011 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
1 ;;; No byte-compiler warnings | |
2 ;(eval-when-compile | |
3 ; (require 'w3)) | |
4 | |
5 ;;; Keep these obsolete variables for backward compatibility | |
6 (defconst era-version "0.95" "\ | |
7 Version numbers of this version of Era.") | |
8 | |
9 ;; We're (not really anymore) calling this version Sun Era. | |
10 (defconst sun-era t) | |
11 | |
12 (defun era-version () | |
13 "Return (obsolete) string describing the version of Era that is running. | |
14 Era is now known as XEmacs. Use (emacs-version) instead." | |
15 (interactive) | |
16 (if (interactive-p) | |
17 (message "%s" (era-version)) | |
18 (format "%sEra %s of %s %s on %s (%s)" | |
19 (if sun-era "Sun " "") | |
20 era-version | |
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))) | |
26 | |
27 ;(defun sunpro-maybe-connect-to-tooltalk () | |
28 ; (if (and (not (noninteractive)) | |
29 ; (fboundp 'command-line-do-tooltalk)) | |
30 ; (command-line-do-tooltalk nil))) | |
31 | |
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 | |
35 | |
36 ;(add-hook 'before-init-hook 'sunpro-maybe-connect-to-tooltalk) | |
37 | |
38 (set-glyph-image text-pointer-glyph "xterm") | |
39 (set-glyph-image nontext-pointer-glyph "xterm") | |
40 | |
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 | |
43 | |
44 ;(defun sunpro-fix-postscript-viewer () | |
45 ; (if (not (noninteractive)) | |
46 ; (condition-case nil | |
47 ; (w3-parse-mailcap | |
48 ; (expand-file-name "sparcworks/sunpro-mailcap" data-directory)) | |
49 ; (error nil)))) | |
50 | |
51 ;(add-hook 'w3-load-hooks 'sunpro-fix-postscript-viewer) | |
52 | |
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))) | |
57 | |
58 ;(add-hook 'before-init-hook 'sunpro-pending-delete-on) | |
59 | |
60 ;;; Decide whether to use workshop.el or eos at runtime, based on | |
61 ;;; which Sun DevPro products are installed. | |
62 | |
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." | |
66 (and | |
67 (cond | |
68 ((locate-file "workshop.el" load-path)) | |
69 | |
70 ((file-exists-p (concat sunpro-dir "lib/workshop.el")) | |
71 (setq load-path (append load-path (list (concat sunpro-dir "lib/")))))) | |
72 | |
73 (cond | |
74 ((locate-file "workshop" exec-path)) | |
75 | |
76 ((file-exists-p (concat sunpro-dir "bin/workshop")) | |
77 (setq exec-path (append exec-path (list (concat sunpro-dir "bin/")))))))) | |
78 | |
79 (defun sunpro-startup () | |
80 (when (not (noninteractive)) | |
81 | |
82 (let ((sunpro-dir-p | |
83 #'(lambda (dir) | |
84 (and dir | |
85 (file-exists-p (concat dir "bin/workshop")) | |
86 (file-exists-p (concat dir "lib/workshop.el")))))) | |
87 | |
88 (defconst sunpro-dir | |
89 (cond | |
90 ((let ((path exec-path) dir (found nil)) | |
91 (while (and path (not found)) | |
92 (setq dir (car path)) | |
93 (setq path (cdr path)) | |
94 (setq dir (concat dir (if (string-match "/$" dir) "../" "/../"))) | |
95 (setq found (funcall sunpro-dir-p dir))) | |
96 (if found | |
97 (expand-file-name dir)))) | |
98 | |
99 ((let ((dir exec-directory) (i 0) (found nil)) | |
100 (while (and (< i 8) (not found)) | |
101 (setq i (1+ i)) | |
102 (setq dir (concat dir "../")) | |
103 (setq found (funcall sunpro-dir-p dir)) | |
104 ) | |
105 (if found | |
106 (expand-file-name dir)))) | |
107 | |
108 ("/opt/SUNWspro/")) ; Default install location | |
109 | |
110 "Directory where Sunsoft Developer Products are installed.")) | |
111 | |
112 ;; Connect to tooltalk | |
113 (and (featurep 'tooltalk) | |
114 (fboundp 'command-line-do-tooltalk) | |
115 (command-line-do-tooltalk nil)) | |
116 | |
117 ;; Sun's pending-del default is like textedit's | |
118 (require 'pending-del) | |
119 (pending-delete-on nil) | |
120 | |
121 ;; Bar cursor 2 pixels wide | |
122 (setq bar-cursor 2) | |
123 | |
124 ;; Nice CDE compliant icon -- now the default... | |
125 ;(if (featurep 'xpm) | |
126 ; (set-glyph-image | |
127 ; frame-icon-glyph | |
128 ; (format "%s%s" data-directory "xemacs-icon3.xpm") | |
129 ; 'global 'x)) | |
130 | |
131 (cond | |
132 ;; Use Sunsoft WorkShop if available | |
133 ((sunpro-update-paths-for-workshop) | |
134 (require 'workshop)) | |
135 | |
136 ;; Else, use eos package with sparcworks if available | |
137 ((or | |
138 (locate-file "sparcworks" exec-path) | |
139 (prog1 | |
140 (file-exists-p (concat sunpro-dir "bin/sparcworks")) | |
141 (setq exec-path (append exec-path (list (concat sunpro-dir "bin/")))))) | |
142 | |
143 (and (fboundp 'eos::start)) (eos::start)) | |
144 | |
145 (t ; Neither? Complain... | |
146 (display-warning | |
147 'sunpro | |
148 "XEmacs was compiled with support for Sun Developer Products, | |
149 but neither `workshop' nor `sparcworks' were found on the PATH."))) | |
150 )) | |
151 | |
152 (add-hook 'before-init-hook 'sunpro-startup) | |
153 | |
154 (provide 'sunpro) |