;;; vars.el ;;; ;;; Copyright (C) 1996, 1997, 1998, 2000, 2001, ;;; 2002, 2003, 2004, 2006, 2007, 2008 Thien-Thi Nguyen ;;; This file is part of ttn's personal elisp library, released under GNU ;;; GPL with ABSOLUTELY NO WARRANTY. See the file COPYING for details. ;;; Description: Set variables variously for various things. ;;;--------------------------------------------------------------------------- ;;; Garden-variety editing. (setq inhibit-startup-message t ; hehe, no longer a novice default-major-mode 'text-mode ; (see text-mode-hook) default-fill-column 78 ; big enough backup-by-copying-when-linked t ; for symlinks auto-save-interval 600 ; keystrokes NOT seconds version-control nil ; heh, why be like vms?! delete-auto-save-files t ; limited disk space, yasee require-final-newline t ; for other programs scroll-conservatively 999 ; smoother scrolling completion-ignored-extensions ; don't do completion for these files '(".bak" "~" ".lpt" ".bin" ".o" ".lo" ".elc" ".elc.gz" ".err" ".dvi" ".aux" ".otl" ".ckp" ".lst") auto-save-timeout nil ; disable saving based on time window-min-height 1 ; sure, why not? display-time-24hr-format t ; save mode-line space next-line-add-newlines nil ; do not add newlines at EOB vc-keep-workfiles t ; sure, why not? vc-command-messages t ; keep me entertained vc-mistrust-permissions t ; use the SOURCE dammit! vc-make-backup-files nil ; don't need em vc-initial-comment nil ; why bother? visible-bell t ; shut up you infernal machine! inferior-lisp-program "gcl" ; keep the faith, man! split-window-keep-point nil ; less motion is good view-scroll-auto-exit t ; get out! display-time-24hr-format t ; less ambiguity more space *emacs-start-time* (current-time) ; for `emacs-uptime' add-log-always-start-new-record t ; finally, sanity reigns mode-line-in-non-selected-windows nil ; keep things quiet for now diff-switches "-u" ; --unified=1 confuses cvs, sigh font-lock-verbose nil ; yeah, whatever dired-deletion-confirmer 'identity ; no questions asked dired-listing-switches "-alF" ; include file type suffix enable-recursive-minibuffers t ; contemplate crass confusion add-log-time-zone-rule t ; reduce confusion on earth confirm-kill-emacs 'y-or-n-p ; be sure but not too sure ange-ftp-try-passive-mode t ; keep the bits flowing next-error-recenter 2 ; useful for grep, too max-mini-window-height 0.8 ; in case we near the minotaur jit-lock-context-time 1.5 ; a little less eager, thanks ;; add simple var jamming here. Man-width (1- (frame-width)) time-stamp-start "[tT]ime-stamp:[ \t]+\\\\?[\"<]+") ;;;--------------------------------------------------------------------------- ;;; Buffer management. (add-to-list 'same-window-buffer-names "*compilation*") ;;;--------------------------------------------------------------------------- ;;; Mode line customization. (setq-default mode-line-mule-info nil mode-line-frame-identification nil mode-line-buffer-identification '("%5b") mode-line-modified '("-%1*%1* " (-3 "%P") " ") mode-line-position nil mode-line-format (delete '(-3 . "%p") mode-line-format)) ;; old skool: put the time/mail info to the left of "(MODE ...)". (let ((cut (position 'global-mode-string mode-line-format :key (lambda (x) (and (consp x) (car x))))) (jam (position 'mode-line-modes mode-line-format))) (when (and cut jam (< jam cut)) (setq-default mode-line-format (append (subseq mode-line-format 0 jam) (list 'global-mode-string " ") (subseq (delete (nth cut mode-line-format) mode-line-format) jam))))) (let* ((t-cell (last mode-line-format)) (trailing (car t-cell))) (setcar t-cell (concat user-login-name ":" (if (string-match "\\(^[^.]+\\)" system-name) (match-string 1 system-name) system-name) (let ((w (getenv "WINDOW"))) ; set by screen(1) (when w (concat "/" w))) (let ((r (getenv "RATPOISONSERIALID"))) (when r (concat "/" r))))) (setcdr t-cell (list trailing))) ;;;--------------------------------------------------------------------------- ;;; Properties. (mapc (lambda (cmd) (put cmd 'disabled nil)) '(eval-expression upcase-region downcase-region narrow-to-page narrow-to-region erase-buffer image-toggle-display ;; add liberated commands here. )) ;;;--------------------------------------------------------------------------- ;;; Munge `auto-mode-alist'. (mapc (lambda (x) (pushnew (cons (format "\\.%s\\'" (car x)) (cdr x)) auto-mode-alist :test 'equal)) '((pl . perl-mode) (ph . perl-mode) (perl . perl-mode) (thud . scheme-mode) (th . scheme-mode) (v . verilog-mode) (twerp . texinfo-mode) (html-data . scheme-mode) (mms . makefile-mode) (af . scheme-mode) (laml . scheme-mode) ;; Add auto-mode hints here. )) ;;;--------------------------------------------------------------------------- ;;; Hack to use own copy of hideshow. (unless (featurep 'hideshow) (makunbound 'hs-special-modes-alist)) ;;;--------------------------------------------------------------------------- ;;; Indentation specifications. ;;; These are for properties other than `lisp-indent-function'. (dolist (sym '(cron and-let* ;; from Guile's ice-9/testing-lib.scm pass-if pass-if-exception expect-fail expect-fail-exception with-test-prefix ;; from QA qa-do-test qa-do-test-expect-fail)) (put sym 'scheme-indent-function 1)) ;;;--------------------------------------------------------------------------- ;;; Local variables policy (setq safe-local-variable-values '((outline-regexp . "\\([ ][ ]\\)*- ") (outline-regexp . "\\([ ][ ]\\)*[-+] ") (backup-inhibited . t) (fill-prefix . "\t"))) ;;;--------------------------------------------------------------------------- ;;; vars.el ends here