(require 'cl) (defun pretty-greek () (let ((greek '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta" "theta" "iota" "kappa" "lambda" "mu" "nu" "xi" "omicron" "pi" "rho" "sigma_final" "sigma" "tau" "upsilon" "phi" "chi" "psi" "omega"))) (loop for word in greek for code = 97 then (+ 1 code) do (let ((greek-char (make-char 'greek-iso8859-7 code))) (font-lock-add-keywords nil `((,(concatenate 'string "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[a-zA-Z]") (0 (progn (decompose-region (match-beginning 2) (match-end 2)) nil))))) (font-lock-add-keywords nil `((,(concatenate 'string "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[^a-zA-Z]") (0 (progn (compose-region (match-beginning 2) (match-end 2) ,greek-char) nil))))))))) (add-hook 'lisp-mode-hook 'pretty-greek) (add-hook 'scheme-mode-hook 'pretty-greek) (add-hook 'inferior-scheme-mode-hook 'pretty-greek) (add-hook 'emacs-lisp-mode-hook 'pretty-greek) (add-to-list 'load-path "/home/edw/el") ;(load-library "xscheme") (autoload 'paredit-mode "paredit" "Minor mode for pseudo-structurally editing Lisp code." t) ; (autoload 'gambit-inferior-mode "gambit" "Hook Gambit mode into cmuscheme.") ; (autoload 'gambit-mode "gambit" "Hook Gambit mode into scheme.") ; (add-hook 'inferior-scheme-mode-hook (function gambit-inferior-mode)) ; (add-hook 'scheme-mode-hook (function gambit-mode)) ; (setq scheme-program-name "/usr/local/Gambit-C/current/bin/gsi -:d-") ;(setq scheme-program-name "/usr/local/bin/scheme") ;(setq scheme-program-name "/Users/edw/bin/arc") (setq scheme-program-name "/usr/local/bin/scheme48") (add-hook 'scheme-mode-hook (lambda () (paredit-mode +1))) ; (add-hook 'inferior-scheme-mode-hook (lambda () (paredit-mode +1))) (setq-default indent-tabs-mode nil) ;(setq-default truncate-lines t) (tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1) (setq inhibit-splash-screen t) (transient-mark-mode 1) (cond ((equal window-system 'mac) (global-hl-line-mode 1) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(global-font-lock-mode 1) '(safe-local-variable-values (quote ((Syntax . Scheme) (Package . Scheme)))) '(show-paren-mode t)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 100 :width normal :family "bitstream vera sans mono")))))) ((not window-system) ;; If running in terminal... (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(global-font-lock-mode 1) '(safe-local-variable-values (quote ((Syntax . Scheme) (Package . Scheme)))) '(show-paren-mode t)) )) (put 'keyword-lambda 'scheme-indent-function 2) (put 'let-fluid 'scheme-indent-function 2)