Changeset 3798


Ignore:
Timestamp:
09/15/03 19:05:17 (19 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/examples/init.lisp

    r3045 r3798  
    11;;; init.lisp
    2 ;;; $Id: init.lisp,v 1.11 2003-07-23 05:01:40 piso Exp $
     2;;; $Id: init.lisp,v 1.12 2003-09-15 19:05:17 piso Exp $
    33
    44;;; ~/.j/init.lisp (if it exists) is loaded automatically when j starts up.
     
    2727  (jstatic "getProperty" "java.lang.System" "java.version"))
    2828
    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))
     29(defun adjust-appearance ()
     30  (when (member (subseq (java-version) 0 5) '("1.4.0" "1.4.1" "1.4.2") :test #'string=)
     31    (set-global-property "adjustAscent" -2)
     32    (set-global-property "adjustLeading" -2)
     33    (reset-display)))
     34
     35;; Do it now!
     36(adjust-appearance)
     37
     38;; Turn off the remove-trailing-whitespace preference for files in the
     39;; directory ~/gcl/ansi-tests.
     40(defun my-open-file-hook (buf)
     41  (let ((filename (buffer-pathname buf)))
     42    (when (and filename
     43               (string= (directory-namestring filename)
     44                        "/home/peter/gcl/ansi-tests/"))
     45      (setf (variable-value 'remove-trailing-whitespace :buffer) nil))))
     46
     47(add-hook 'open-file-hook 'my-open-file-hook)
     48
     49;; Call ADJUST-APPEARANCE after saving ~/.j/prefs.
     50(defun my-after-save-hook (buf)
     51  (let ((filename (buffer-pathname buf)))
     52    (when (string= filename "/home/peter/.j/prefs")
     53      (adjust-appearance))))
     54
     55(add-hook 'after-save-hook 'my-after-save-hook)
    3356
    3457(defun reset-incoming-filters ()
Note: See TracChangeset for help on using the changeset viewer.