source: trunk/j/examples/init.lisp @ 3045

Last change on this file since 3045 was 3045, checked in by piso, 19 years ago

LOAD-THEME: work in progress.

File size: 1.6 KB
Line 
1;;; init.lisp
2;;; $Id: init.lisp,v 1.11 2003-07-23 05:01:40 piso Exp $
3
4;;; ~/.j/init.lisp (if it exists) is loaded automatically when j starts up.
5
6(defun load-theme (name)
7  (let ((filename (concatenate 'string "/home/peter/depot/j/themes/" name ".lisp")))
8    (unless (probe-file filename)
9      (error "file not found: ~A" filename))
10    (kill-theme)
11    (load filename)
12    (reset-display)
13    t))
14
15(defun hostname ()
16  (when (probe-file "/etc/hostname")
17    (with-open-file (f "/etc/hostname")
18      (read-line f))))
19
20;; Use Kodiak on prufrock, AnokhaClassic on the laptops.
21(let ((hostname (hostname)))
22  (if (and hostname (search "prufrock" hostname))
23      (load-theme "Kodiak")
24      (load-theme "AnokhaClassic")))
25
26(defun java-version ()
27  (jstatic "getProperty" "java.lang.System" "java.version"))
28
29(when (member (subseq (java-version) 0 5) '("1.4.0" "1.4.1" "1.4.2") :test #'string=)
30  (set-global-property "adjustAscent" -2)
31  (set-global-property "adjustLeading" -2)
32  (reset-display))
33
34(defun reset-incoming-filters ()
35  (jstatic "resetIncomingFilters" "org.armedbear.j.mail.IncomingFilter"))
36
37(defun add-incoming-filter (mailbox pattern action parameter)
38  (jstatic "addIncomingFilter" "org.armedbear.j.mail.IncomingFilter"
39           mailbox pattern action parameter))
40
41(add-hook 'mailbox-mode-hook
42          (lambda ()
43            (reset-incoming-filters)
44            (add-incoming-filter "inbox"
45                                 "~C linux-kernel"
46                                 "move"
47                                 "{annie}mail/linux-kernel")))
48
49(when (probe-file "/home/peter/.j/key-pressed.lisp")
50  (load "/home/peter/.j/key-pressed.lisp"))
Note: See TracBrowser for help on using the repository browser.