;;; Emacs CCRMA startup file ;;; nando & juan, July 6 1998 (if (not (fboundp 'setf)) (defmacro setf (place value) (list 'setq place value))) ;;; how old is this emacs? (setf old-emacs (not (fboundp 'member))) ;;; figure out which flavor we are running (defvar xemacs-flavor (string-match "XEmacs" emacs-version)) ;;; figure out which OS we're running (setq ostype-next (eq system-type 'next-mach)) (setq ostype-irix (eq system-type 'irix)) (setq ostype-linux (or (eq system-type 'gnu/linux) (eq system-type 'linux))) ;;; get lisp image name and lisp-emacs connection location (if ostype-next (setq acl-home nil)) (if ostype-irix (if xemacs-flavor (setq acl-home "/usr/ccrma/lisp/dist/acl4.3-irix/home/emacs/fi-xemacs") (setq acl-home "/usr/ccrma/lisp/dist/acl4.3-irix/home/emacs/fi"))) (if ostype-linux (if xemacs-flavor (setq acl-home "/usr/ccrma/lisp/dist/acl4.3-linux/home/emacs/fi-xemacs") (setq acl-home "/usr/ccrma/lisp/dist/acl4.3-linux/home/emacs/fi"))) (setq acl-image "/usr/ccrma/lbin/cm2-clm2") ;;; personal preferences (setq bell-volume 0) (set-variable 'inhibit-startup-message 't) (put 'eval-expression 'disabled nil) (put 'downcase-region 'disabled nil) ;;; add CLM/CM/CMN extensions to the lisp-mode list (setq auto-mode-alist (append '( ;; clm and cm extensions ("\\.ats$" . lisp-mode) ("\\.clm$" . lisp-mode) ("\\.cm$" . lisp-mode) ("\\.cmn$" . lisp-mode) ("\\.ins$" . lisp-mode) ("\\.cl$" . lisp-mode) ("\\.lisp$" . lisp-mode) ("\\.c$" . c-mode) ("\\.h$" . c-mode) ("\\.m$" . objc-mode) ("\\.html$" . text-mode) ) auto-mode-alist)) ;;; include common sound-related cases in the completions-ignored list (setq completion-ignored-extensions (append (list ".snd" ".aiff" ".wav" ".lib" ".fas" ".au" ".so" ".o" ".hqx" ".gz" ".tar" ".fusl" ".fisl") completion-ignored-extensions)) (if xemacs-flavor ;;; from hkt (progn (require 'inf-lisp) (setq inferior-lisp-program acl-image) (setq explicit-shell-file-name "/bin/tcsh") (setq common-lisp-buffer-name "*common-lisp*") ;; change some key bindings (global-set-key "\C-c\C-r" 'lisp-eval-region) (global-set-key "\C-c\C-s" 'lisp-eval-last-sexp) (global-set-key "\C-c\C-e" 'lisp-eval-defun) (global-set-key "\C-c\C-m" 'lisp-macroexpand) (global-set-key "\C-c\C-b" 'lisp-eval-current-buffer) (global-set-key "\C-x\l" 'inferior-lisp) (global-set-key "\C-c\C-l" 'lisp-mode) (global-set-key "\C-c\C-o" 'outline-minor-mode) (global-set-key "\M- " 'fixup-whitespace) (global-set-key "\M-s" 'ispell-region) ) (progn (if acl-home (setq load-path (cons acl-home load-path))) (if ostype-next (load "fi/site-init.el")) (if ostype-irix (load "fi-site-init.el")) (if ostype-linux (load "fi-site-init.el")) (setq fi:common-lisp-image-name acl-image) (setq fi:common-lisp-host (system-name)) (setq fi:common-lisp-buffer-name "*common-lisp*") (setq fi:common-lisp-directory nil) (defun run-common-lisp () (interactive) (fi:common-lisp fi:common-lisp-buffer-name fi:common-lisp-directory fi:common-lisp-image-name fi:common-lisp-image-arguments fi:common-lisp-host)) ;; change some key bindings (global-set-key "\C-c\C-r" 'fi:lisp-eval-region) (global-set-key "\C-c\C-s" 'fi:lisp-eval-last-sexp) (global-set-key "\C-c\C-e" 'fi:lisp-eval-defun) (global-set-key "\C-c\C-m" 'fi:lisp-macroexpand) (global-set-key "\C-c\C-b" 'fi:lisp-eval-current-buffer) (global-set-key "\C-xw" 'what-line))) (setq display-time-day-and-date t) (display-time) ;;; ---------------- ;;; NeXT emacs: (if ostype-next (progn (set-variable 'meta-flag 't) (setq explicit-shell-file-name "/bin/csh") (define-key esc-map "?" 'describe-key-briefly) (set-variable 'fi:inferior-common-lisp-mode-super-key-map '(keymap (28 . fi:subprocess-quit) (4 . fi:subprocess-send-eof) (3 . fi:subprocess-interrupt) (23 . fi:subprocess-backward-kill-word) (22 . fi:subprocess-show-output) (19 . fi:re-search-forward-input) (18 . fi:re-search-backward-input) (16 . fi:pop-input) (15 . fi:subprocess-send-flush) (14 . fi:push-input) (13 . fi:subprocess-input-region) (12 . fi:list-input-ring) (11 . fi:subprocess-kill-output) (1 . fi:subprocess-beginning-of-line))) (setq-default fi:subprocess-enable-superkeys nil) (setq fi:common-lisp-image-arguments '("+ipc")) (load-library "server") (server-start) (if (not old-emacs) (require 'lisp-mode)) (global-set-key "\C-x\l" 'fi:common-lisp) (put 'if 'lisp-indent-function 0) (put 'unless 'lisp-indent-function 1) (put 'dolist 'lisp-indent-function 1) (put 'dotimes 'lisp-indent-function 1) (put 'when 'lisp-indent-function 1) (put 'case 'lisp-indent-function 1) (put 'multiple-value-bind 'lisp-indent-function 2) (put 'do 'lisp-indent-function 2) (put 'do* 'lisp-indent-function 2) (put 'defgeneric 'fi:lisp-indent-hook (get 'defun 'fi:lisp-indent-hook)) (put 'defclass 'fi:lisp-indent-hook (get 'defun 'fi:lisp-indent-hook)) (put 'make-instance 'fi:lisp-indent-hook (get 'defun 'fi:lisp-indent-hook)) )) ;;; ------------------- ;;; SGI xemacs or emacs (if ostype-irix (progn (fmakunbound 'c-mode) (makunbound 'c-mode-map) (makunbound 'c-style-alist) (autoload 'c-mode "cc-mode" "C Editing Mode" t) (setq fi:common-lisp-image-arguments nil) (setq fi:check-unbalanced-parentheses-when-saving nil) (global-set-key "\C-x\l" 'inferior-lisp) (global-set-key "\C-c\C-i" 'fi:subprocess-interrupt) (put 'if 'fi:lisp-indent-hook 2) (put 'loop 'fi:lisp-indent-hook 'tagbody) )) ;;; --------------------- ;;; Linux xemacs or emacs ;;; cm indentation (from hkt) ;;; (put 'algorithm 'lisp-indent-hook 'defun) (put 'generator 'lisp-indent-hook 'defun) (put 'mute 'lisp-indent-hook 'defun) (put 'heap 'lisp-indent-hook 'defun) (put 'thread 'lisp-indent-hook 'defun) (put 'merge 'lisp-indent-hook 'defun) (put 'defobject 'lisp-indent-hook 'defun) (put 'unless-chording 'lisp-indent-hook 0) (put 'doitems 'lisp-indent-hook 1) (put 'defscale 'lisp-indent-hook 'defun) (put 'defmultiple-item 'lisp-indent-hook 'defun) (put 'multiple-item-bind 'lisp-indent-hook 2) (put 'formatting-slots 'lisp-indent-hook 1) (put 'with-past-values 'lisp-indent-hook 1) (put 'with-vars-snapshotted 'lisp-indent-hook 1) ;;; ;;; clm indentation ;;; (put 'with-sound 'lisp-indent-hook 'defun) (put 'definstrument 'lisp-indent-hook 'defun) ;; Options Menu Settings ;; ===================== (cond ((and (string-match "XEmacs" emacs-version) (boundp 'emacs-major-version) (or (and (= emacs-major-version 19) (>= emacs-minor-version 14)) (= emacs-major-version 20)) (fboundp 'load-options-file)) (load-options-file "~/.xemacs-options"))) ;; ============================ ;; End of Options Menu Settings ;;; from hkt (setq minibuffer-max-depth nil) ;;; add news stuff (setq gnus-default-nntp-server "nntp.stanford.edu")