;;; Hey, Emacs, this file is -*- Emacs-Lisp -*- ... got that? ;;; ;;; make sure this file is included from your personal `~/.emacs', e.g. put the ;;; following towards the end of `~/.emacs' (and uncomment these, of course): ;;; ;;; (if (getenv "LOGONROOT") ;;; (let ((root (substitute-in-file-name "$LOGONROOT"))) ;;; (if (file-exists-p (format "%s/dot.emacs" root)) ;;; (load (format "%s/dot.emacs" root) nil t t)))) ;;; ;;; if you decide to keep your LOGON source tree in a different location, say ;;; `~/src/logon', instead, then adjust the above accordingly. it should not ;;; be necessary to make changes to _this_ file, however. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; file: dot.emacs ;;; module: LOGON initialization file for emacs(1) ;;; version: 0.0 -- 21-nov-03 ;;; written by: oe, uio ;;; last update: ;;; updated by: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; author | date | modification ;;; ------------------|-------------|------------------------------------------ ;;; | | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmacro when (condition &rest body) (list 'and condition (cons 'progn body))) (defmacro unless (condition &rest body) (list 'or condition (cons 'progn body))) (if (getenv "LOGONROOT") (defconst logon-root (substitute-in-file-name "$LOGONROOT")) (error "Global environment variable `LOGONROOT' not set; check `~/.bashrc'")) (defun logon:system-binaries () (cond ((string-match "solaris" system-configuration) "solaris") ((string-match "darwin" system-configuration) "macos.ppc.32") ((string-match "linux" system-configuration) (if (string-match "x86_64" system-configuration) "linux.x86.64" "linux.x86.32")) ((or (string-match "windows" system-configuration) (string-match "mingw-nt" system-configuration) (string-match "msvc" system-configuration)) "windows"))) (defun logon:allegro (&optional prefix) (interactive "P") ;; ;; set up .load-path., load and configure emacs -- lisp interface ;; (let ((eli (format "%s/franz/eli" logon-root)) (lkb (format "%s/lingo/lkb/src" logon-root))) (unless (member eli load-path) (setq load-path (cons eli load-path))) (unless (member lkb load-path) (setq load-path (cons lkb load-path)))) (load "fi-site-init" nil t) (fset 'lisp-mode (symbol-function 'common-lisp-mode)) (load "tdl-mode" nil t) (load "lkb" nil t) (setq fi:common-lisp-image-name (format "%s/franz/%s/alisp%s" logon-root (logon:system-binaries) (if (or (string-match "windows" system-configuration) (string-match "mingw-nt" system-configuration) (string-match "msvc" system-configuration)) ".exe" ""))) (setq fi:common-lisp-image-file (format "%s/franz/%s/base.dxl" logon-root (logon:system-binaries))) (setq fi:common-lisp-image-arguments (list "-L" (format "%s/dot.clinit.cl" logon-root) "-locale" "no_NO.UTF-8")) (setq fi:lisp-evals-always-compile nil) (setq fi:lisp-mode-hook (function (lambda () (modify-syntax-entry ?\[ "(] " fi:lisp-mode-syntax-table) (modify-syntax-entry ?\] ")[ " fi:lisp-mode-syntax-table) (modify-syntax-entry ?\{ "(} " fi:lisp-mode-syntax-table) (modify-syntax-entry ?\} "){ " fi:lisp-mode-syntax-table)))) ;; ;; finally, on MacOS the LOGON `dot.bashrc' may not affect the environment of ;; emacs(1) and its child processes; thus, set up LD_LIBRARY_PATH et al. for ;; our current process environment. (22-may-06; oe) ;; (when (string-match "darwin" system-configuration) (let* ((old (getenv "LD_LIBRARY_PATH")) (new (format "LD_LIBRARY_PATH=%s/lingo/lkb/lib/%s" logon-root (logon:system-binaries))) (new (format "%s:%s/parc/xle/lib/%s" new logon-root (logon:system-binaries)))) (setq process-environment (cons (if old (format "%s:%s" new old) new) process-environment))))) (defun logon (&optional prefix) (interactive "P") (logon:allegro) (setq fi:common-lisp-image-name (format "%s/lingo/lkb/%s/logon%s" logon-root (logon:system-binaries) (if (or (string-match "windows" system-configuration) (string-match "mingw-nt" system-configuration) (string-match "msvc" system-configuration)) ".exe" ""))) ;; ;; make sure that emacs(1) will use the appropriate encoding on all buffers ;; connected to Lisp (aka the LKB), which for latest versions include more ;; than just the main `*common-lisp*' buffer. also, we need to force the ;; Lisp into using a locale with corresponding encoding. ;; (let ((encoding 'utf-8)) (set-language-environment 'utf-8) (setq default-buffer-file-coding-system encoding) (setq default-process-coding-system (cons encoding encoding))) (setq fi:common-lisp-image-file (format "%s/lingo/lkb/%s/logon.dxl" logon-root (logon:system-binaries))) (let ((process-connection-type nil)) (fi:common-lisp))) (defun lisp (&optional prefix) (interactive "P") (logon:allegro) (setq fi:common-lisp-image-name (format "%s/franz/%s/alisp" logon-root (logon:system-binaries) (if (or (string-match "windows" system-configuration) (string-match "mingw-nt" system-configuration) (string-match "msvc" system-configuration)) ".exe" ""))) (setq fi:common-lisp-image-file (format "%s/franz/%s/base.dxl" logon-root (logon:system-binaries))) ;; ;; make sure that emacs(1) will use the appropriate encoding on all buffers ;; connected to Lisp (aka the LKB), which for latest versions include more ;; than just the main `*common-lisp*' buffer. also, we need to force the ;; Lisp into using a locale with corresponding encoding. ;; (let ((encoding 'utf-8)) (set-language-environment 'utf-8) (setq default-buffer-file-coding-system encoding) (setq default-process-coding-system (cons encoding encoding))) (let ((process-connection-type nil)) (fi:common-lisp))) (defun norwegian (&optional prefix) (interactive "P") (let ((encoding 'iso-8859-1)) (set-language-environment 'latin-1) (setq default-buffer-file-coding-system encoding) (setq default-process-coding-system (cons encoding encoding))) (logon:allegro) (setq fi:common-lisp-image-name (format "%s/franz/%s/alisp" logon-root (logon:system-binaries) (if (or (string-match "windows" system-configuration) (string-match "mingw-nt" system-configuration) (string-match "msvc" system-configuration)) ".exe" ""))) (setq fi:common-lisp-image-file (format "%s/franz/%s/xle.dxl" logon-root (logon:system-binaries))) (setq fi:common-lisp-image-arguments (list "-L" (format "%s/dot.clinit.cl" logon-root) "-locale" "no_NO.ISO-8859-1")) (let ((process-connection-type nil)) (fi:common-lisp))) (defconst dot-emacs t)