chiark / gitweb /
clobber annoying default electric indent
[ian-dotfiles.git] / home / emacs / ian.el
index d08f100..e846da6 100644 (file)
@@ -1,10 +1,19 @@
 ; This is my real emacs start-up file (for chiark).
 ; 
+
+(defalias 'perl-mode 'cperl-mode)
+(setq cperl-invalid-face nil
+      cperl-indent-level 4
+      cperl-continued-statement-offset 4)
+
 (make-variable-buffer-local 'indent-line-function)
 ; Un-disable narrow and eval-expression
 (put 'narrow-to-region 'disabled nil)
 (put 'eval-expression 'disabled nil)
-(standard-display-european t)
+;(standard-display-european t)
+;
+(setq browse-url-netscape-program "mozilla")
+(setq common-lisp-hyperspec-root "/usr/share/doc/hyperspec/")
 ;
 ; Make sure we don't disturb links or change ownership, use numbers
 (setq backup-by-copying-when-mismatch t)
 (setq enable-local-variables 'ask-me)
 (setq enable-recursive-minibuffers t)
 (setq compile-command "make")
-(setq compilation-context-lines 0)
-(setq compilation-skip-threshold 0)
-(setq compilation-scroll-output 'first-error)
-(global-set-key "\18\\" 'previous-error)
+(setq next-line-add-newlines t)
 (setq diff-switches "-u")
+(setq line-move-visual nil)
 (display-time)
-(setq next-line-add-newlines t)
 ;
+(set-default 'indent-line-function 'insert-tab)
+(set-default 'electric-indent-mode nil)
 (set-variable 'search-repeat-char 28)
+(set-fringe-mode (cons 0 nil))
 (if (string-match "^19\." emacs-version)
     (progn
-      (setq file-name-handler-alist     ; Disable nasty auto-loading of ange-ftp
-            (delq (rassq 'ange-ftp-completion-hook-function file-name-handler-alist)
-                  file-name-handler-alist))
+;      (setq file-name-handler-alist     ; Disable nasty auto-loading of ange-ftp
+;            (delq (rassq 'ange-ftp-completion-hook-function file-name-handler-alist)
+;                  file-name-handler-alist))
       (require 'find-alternate-18style)
       (defun unset-down-mouse-23 ()
         (local-set-key [mouse-2] 'mouse-yank-at-click)
@@ -60,7 +69,6 @@
       (define-key isearch-mode-map "\1d" 'isearch-quote-char)))
 ;
 (menu-bar-mode -1)
-(tool-bar-mode -1)
 (defun terminal-keybindings ()
   "This function should be called by the term-setup-hook mechanism"
   (interactive)
@@ -69,7 +77,7 @@
   ; Set keybindings generally (including I-search on C-\)
 ;  (global-set-key "   " 'self-insert-command)
   (global-set-key "\1c" 'isearch-forward)
-  (global-set-key "\r" 'newline-and-indent)
+;  (global-set-key "\r" 'newline)
   (global-set-key "\ f" 'set-mark-command)
   (global-set-key "\1d" 'quoted-insert)
   ;
@@ -88,7 +96,7 @@
   (global-set-key "\18\12" 'bury-buffer)
   (global-set-key "\18\v" 'quicker-compile)
   (global-set-key "\18\18" 'exchange-point-and-mark)
-  (global-set-key "\18\1a" 'load-ange-ftp)
+  (global-set-key "\18\1a" 'load-tramp)
   (global-set-key "\184\16" 'scroll-other-window)
   (global-set-key "\184m" 'vm-mail-other-window)
   (global-set-key "\189" 'vm-visit-folder)
 (autoload 'uncompress-while-visiting "uncompress")
 ; (autoload 'c++-mode "c++-mode" "Mode for editing C and C++ programs" t)
 (autoload 'hide-ifdef-mode "hideif" "For editing code with #ifdefs" t)
-(setq-default indent-tabs-mode nil)
+;(setq-default indent-tabs-mode nil)
 (autoload 'dired-find-alternate-file "dired-alternate" "Find alternately" t)
 (autoload 'dired-run-file "dired-alternate" "Run this file" t)
 (autoload 'perl-mode "perl-mode" "Mode for Perl code" t)
 ;(autoload 'vm-submit-bug-report "vm" "Send a bug report about VM." t)
 ;
 ;(require 'vm-autoload)
+
+(vm-legacy-key-bindings)
 ;
 ; (autoload 'info "info-fixed" "Patched info browser" t)
 (setq shell-mode-hook
       '(lambda ()
          (make-variable-buffer-local 'scroll-step)
          (setq scroll-step 1)))
-; (setq inferior-lisp-program "kcl")
+(setq inferior-lisp-program "sbcl")
+;(setq jit-lock-chunk-size 100
+;      jit-lock-stealth-time 1.00)
 (setq dired-mode-hook
       '(lambda ()
         (define-key dired-mode-map "F" 'dired-find-alternate-file)
 ;                ("\\.tar$" . tar-mode)
                 ("\\.pl$" . perl-mode)
                 ("\\.ci$" . tex-mode)
+                ("\\.asm$" . fundamental-mode)
                 ("\\.Z$" . uncompress-while-visiting))
               auto-mode-alist))
 (setq interpreter-mode-alist
                         (local-set-key ";" 'self-insert-command)))
 (setq c++-mode-hook '(lambda ()
                        (hide-ifdef-mode 1)
+                      (local-set-key "," 'self-insert-command)
                        (local-set-key ":" 'electric-c++-terminator)))
 ; c++-electric-colon
 (setq c-mode-hook '(lambda ()
                      (hide-ifdef-mode 1)
                      (c-set-offset 'substatement-open 0 nil)
+                    (local-set-key "," 'self-insert-command)
+                    (local-set-key ";" 'self-insert-command)
+                    (local-set-key "/" 'self-insert-command)
+                    (local-set-key "*" 'self-insert-command)
+                    (local-set-key "#" 'self-insert-command)
                     (local-set-key "(" 'self-insert-command)
                     (local-set-key ")" 'self-insert-command)
-                    (local-set-key ";" 'self-insert-command)
                     (local-set-key "{" 'self-insert-command)
                      (local-set-key "\r" 'newline-and-indent)))
 (setq c-hanging-comment-ender-p nil)
@@ -310,12 +328,12 @@ then call send-and-exit."
   (insert-file (concat vm-folder-directory ",Formletter")))
 ;
 ; This function bound to C-x C-z
-(defun load-ange-ftp ()
-  "Load ange-ftp using require, if it isn't loaded already"
+(defun load-tramp ()
+  "Load tramp using require, if it isn't loaded already"
   (interactive)
-  (message "Loading ange-ftp...")
-  (require 'ange-ftp) ; -extended
-  (message "Loading ange-ftp...done"))
+  (message "Loading tramp...")
+  (require 'tramp) ; -extended
+  (message "Loading tramp...done"))
 ;
 ; This function bound to M-+
 (defun toggle-truncate-lines ()
@@ -350,9 +368,6 @@ then call send-and-exit."
                         (concat "^" item " *\\((.*)\\)?$"))))
                   list)))
 ;
-;
-(setq mail-signature nil)
-;
 ; BBDB
 (setq bbdb-north-american-phone-numbers-p nil
       bbdb/mail-auto-create-p t
@@ -361,7 +376,8 @@ then call send-and-exit."
       bbdb-message-caching-enabled t)      
 ;
 ; VM stuff
-(load-file "~/private/private.el")
+(if (file-exists-p "~/private/private.el")
+  (load-file "~/private/private.el"))
 (if (file-exists-p "~/private/private2.el")
   (load-file "~/private/private2.el"))
 (setq vm-included-text-attribution-format "%F writes (\"%s\"):\n"
@@ -410,19 +426,11 @@ then call send-and-exit."
       mail-archive-file-name "~/mail/Outbound"
 
 
-      vm-spool-files (list
-                      "~/mbox"
-                      "~/mail/Outbound"
-                      "~/mail/Record"
-                      "~/mail/Import"
-                      "~/mail/inbox"
-                      "/var/mail/iwj"
-;                      "imap-ssl:mail.citrix.com:993:inbox:login:ianj:*"
-;                      (concat "imap-ssl:mail.citrix.com:993:inbox:cram-md5:ianj:*" ijackson-pop-password)
-                      "/u/ijackson/mail/INBOX.CRASH"
-                      "~/News/r")
       vm-startup-with-summary t
 
+      user-mail-address "ijackson@chiark.greenend.org.uk"
+
+
       vm-startup-with-summary nil
       vm-summary-format "%3n %a %2d %3m  %-19.19F  %s\n"
       mail-archive-file-name "~/mail/Outbound"
@@ -531,50 +539,37 @@ The citation string is taken from cite-string."
            (> (point-max) (point)))
         (insert cite-string)))))
 ;
-(blink-cursor-mode nil)
-(setq c-basic-offset 4)
-(setq indent-tabs-mode 4)
-;
-(require 'tramp)
-(setq tramp-default-proxies-alist
-      (append '(("names\\.colo\\.xensource\\.com"
-                 "root" "/ssh:names.colo.xensource.com:")
-                ("colo-dns1\\.colo\\.xensource\\.com" "root"
-                 "/ssh:ianj@colo-dns1.colo.xensource.com:"))
-              tramp-default-proxies-alist))
-; /sudo:root@names.colo.xensource.com:/etc/bind/xen.org.zone
-; /sudo:root@colo-dns1.colo.xensource.com:/etc/bind/xensource.com.zone
-
+;
 
 
-(defun hack-dir-local-variables ()
-  "Read per-directory local variables for the current buffer.
-Store the directory-local variables in `dir-local-variables-alist'
-and `file-local-variables-alist', without applying them."
-  (when (and enable-local-variables
-            (buffer-file-name))
-    ;; Find the variables file.
-    (let ((variables-file (dir-locals-find-file (buffer-file-name)))
-         (class nil)
-         (dir-name nil))
-      (cond
-       ((stringp variables-file)
-       (setq dir-name (file-name-directory (buffer-file-name)))
-       (setq class (dir-locals-read-from-file variables-file)))
-       ((consp variables-file)
-       (setq dir-name (nth 0 variables-file))
-       (setq class (nth 1 variables-file))))
-      (when class
-       (let ((variables
-              (dir-locals-collect-variables
-               (dir-locals-get-class-variables class) dir-name nil)))
-         (when variables
-           (dolist (elt variables)
-             (unless (memq (car elt) '(eval mode))
-               (setq dir-local-variables-alist
-                     (assq-delete-all (car elt) dir-local-variables-alist)))
-             (push elt dir-local-variables-alist))
-           (hack-local-variables-filter variables dir-name)))))))
+;; (defun hack-dir-local-variables ()
+;;   "Read per-directory local variables for the current buffer.
+;; Store the directory-local variables in `dir-local-variables-alist'
+;; and `file-local-variables-alist', without applying them."
+;;   (when (and enable-local-variables
+;;          (buffer-file-name))
+;;     ;; Find the variables file.
+;;     (let ((variables-file (dir-locals-find-file (buffer-file-name)))
+;;       (class nil)
+;;       (dir-name nil))
+;;       (cond
+;;        ((stringp variables-file)
+;;     (setq dir-name (file-name-directory (buffer-file-name)))
+;;     (setq class (dir-locals-read-from-file variables-file)))
+;;        ((consp variables-file)
+;;     (setq dir-name (nth 0 variables-file))
+;;     (setq class (nth 1 variables-file))))
+;;       (when class
+;;     (let ((variables
+;;            (dir-locals-collect-variables
+;;             (dir-locals-get-class-variables class) dir-name nil)))
+;;       (when variables
+;;         (dolist (elt variables)
+;;           (unless (memq (car elt) '(eval mode))
+;;             (setq dir-local-variables-alist
+;;                   (assq-delete-all (car elt) dir-local-variables-alist)))
+;;           (push elt dir-local-variables-alist))
+;;         (hack-local-variables-filter variables dir-name)))))))
 
 (delete ".git/" completion-ignored-extensions)