chiark / gitweb /
clobber annoying default electric indent
[ian-dotfiles.git] / home / emacs / ian.el
index 689d6db..e846da6 100644 (file)
@@ -10,7 +10,7 @@
 ; 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/")
@@ -40,6 +40,8 @@
 (setq line-move-visual nil)
 (display-time)
 ;
+(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)
   (global-set-key "\eOB" 'next-line))
 (setq term-setup-hook 'terminal-keybindings)     ; remap keys in due course
 ;
+(setq frame-title-format
+      '(multiple-frames
+       (:eval 
+        (let*
+            ((buf (current-buffer))
+             (leaf (buffer-name buf))
+             (dir default-directory))
+          (if dir
+              (let*
+                  ((dir (abbreviate-file-name dir))
+                   (node (replace-regexp-in-string "\\..*" "" system-name)))
+                (concat leaf "  " node ":" dir))
+            leaf)))
+       ("" invocation-name "@" system-name)))
+;(setq frame-title-format
+;      '(multiple-frames
+;      (:eval 
+;       (let*
+;           ((buf (current-buffer))
+;            (fn (buffer-file-name buf)))
+;         (if fn
+;             (let*
+;                 ((fn (abbreviate-file-name fn))
+;                  (dir (file-name-directory fn))
+;                  (leaf (file-name-nondirectory fn))
+;                  (node (replace-regexp-in-string "\\..*" "" system-name)))
+;               (concat leaf "  " node ":" dir))
+;           (buffer-name buf))))
+;      ("" invocation-name "@" system-name)))
+;
 ; Autoload definitions
 (autoload 'tar-mode "tar-mode")
 (autoload 'uncompress-while-visiting "uncompress")
 ; (autoload 'rmail "rmail-fixed" "Patched mail reader" t)
 (autoload 'quicker-compile "quicker-compile" "Patched Compile mode" t)
 
-(autoload 'vm "vm" "Start VM on your primary inbox." t)
-(autoload 'vm-visit-folder "vm" "Start VM on an arbitrary folder." t)
-(autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t)
-(autoload 'vm-mode "vm" "Run VM major mode on a buffer" t)
-(autoload 'vm-mail "vm" "Send a mail message using VM." t)
-(autoload 'vm-submit-bug-report "vm" "Send a bug report about VM." t)
+;(autoload 'vm "vm" "Start VM on your primary inbox." t)
+;(autoload 'vm-visit-folder "vm" "Start VM on an arbitrary folder." t)
+;(autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t)
+;(autoload 'vm-mode "vm" "Run VM major mode on a buffer" t)
+;(autoload 'vm-mail "vm" "Send a mail message using VM." 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
@@ -340,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"
@@ -353,6 +390,7 @@ then call send-and-exit."
       vm-auto-next-message nil
       vm-jump-to-new-messages nil
       vm-jump-to-unread-messages nil
+      vm-auto-displayed-mime-content-types '("text" "multipart")
       vm-mime-digest-discard-header-regexp "only-drop-this-header"
       vm-preview-lines nil
       vm-included-text-prefix "> "
@@ -388,40 +426,11 @@ then call send-and-exit."
       mail-archive-file-name "~/mail/Outbound"
 
 
-      vm-spool-files
-      '((vm-primary-inbox "/var/spool/mail/ian"
-                         "~/mail/INBOX.CRASH")
-        (vm-primary-inbox "~/News/r" "~/mail/INBOX.CRASH")
-       (vm-primary-inbox "~/mbox" "~/mail/INBOX.CRASH")
-       (vm-primary-inbox "~/mail/Outbound" "~/mail/INBOX.CRASH")
-       (vm-primary-inbox "~/mail/Import" "~/mail/INBOX.CRASH")
-       (vm-primary-inbox "~/mail/Record" "~/mail/INBOX.CRASH")
-       (vm-sinbin-inbox "/var/spool/mail/ian" "~/mail/SINBOX.CRASH"))
       vm-startup-with-summary t
 
       user-mail-address "ijackson@chiark.greenend.org.uk"
 
 
-;      vm-spool-files
-;      (list
-;       (list vm-primary-inbox "~/mbox" "~/mail/INBOX.CRASH")
-;       (list vm-primary-inbox "~/mail/Outbound" "~/mail/INBOX.CRASH")
-;       (list vm-primary-inbox "~/mail/Record" "~/mail/INBOX.CRASH")
-;       (list vm-primary-inbox "~/mail/Import" "~/mail/INBOX.CRASH")
-;       (list vm-primary-inbox "/var/spool/mail/ian" "~/mail/INBOX.CRASH")
-;       (list vm-primary-inbox "~/News/r" "~/mail/INBOX.CRASH")
-;       (list vm-sysadmin-inbox "~/mbox" "~/mail/SINBOX.CRASH")
-;       (list vm-sysadmin-inbox "~/mail/SOutbound" "~/mail/SINBOX.CRASH")
-;       (list vm-sysadmin-inbox "~/mail/Import" "~/mail/SINBOX.CRASH")
-;       (list vm-sysadmin-inbox "/var/spool/mail/sysadmin" "~/mail/SINBOX.CRASH")
-; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mbox" "/u/ijackson/mail/INBOX.CRASH")
-; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mail/Outbound"
-;       "/u/ijackson/mail/INBOX.CRASH")
-; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mail/Record" "/u/ijackson/mail/INBOX.CRASH")
-; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mail/Import" "/u/ijackson/mail/INBOX.CRASH")
-;        (list "/u/ijackson/mail/INBOX"
-;         (concat "localhost:110:pass:ijackson:" ijackson-pop-password)
-;         "/u/ijackson/mail/INBOX.CRASH"))
       vm-startup-with-summary nil
       vm-summary-format "%3n %a %2d %3m  %-19.19F  %s\n"
       mail-archive-file-name "~/mail/Outbound"
@@ -431,27 +440,27 @@ then call send-and-exit."
           '(lambda ()
              (local-set-key "Q" 'vm-quit)
              (local-set-key "q" "###Q")))
-(add-hook 'mail-mode-hook
-          '(lambda ()
-             (if (and (boundp 'folder-buffer)
-                      folder-buffer
-                      (string= (buffer-file-name folder-buffer)
-                               (file-truename vm-sysadmin-inbox)))
-                 (progn
-                   (make-local-variable 'vm-mail-header-from)
-                   (setq vm-mail-header-from
-                         "sysadmin@chiark.greenend.org.uk (Ian Jackson)")
-                   (make-local-variable 'mail-archive-file-name)
-                   (setq mail-archive-file-name
-                         "~/mail/SOutbound")))))
-;
-;(defun vmi ()
+;(add-hook 'mail-mode-hook
+;          '(lambda ()
+;             (if (and (boundp 'folder-buffer)
+;                      folder-buffer
+;                      (string= (buffer-file-name folder-buffer)
+;                               (file-truename vm-sysadmin-inbox)))
+;                 (progn
+;                   (make-local-variable 'vm-mail-header-from)
+;                   (setq vm-mail-header-from
+;                         "sysadmin@chiark.greenend.org.uk (Ian Jackson)")
+;                   (make-local-variable 'mail-archive-file-name)
+;                   (setq mail-archive-file-name
+;                         "~/mail/SOutbound")))))
+;
+;;(defun vmi ()
 ;  (interactive)
 ;  (vm "/u/ijackson/mail/INBOX"))
 ;;
-(defun vms ()
-  (interactive)
-  (vm vm-sinbin-inbox))
+;(defun vms ()
+;  (interactive)
+;  (vm vm-sinbin-inbox))
 ;
 (defun make-session ()
   "Makes this emacs hard to kill by requiring ^X^Cy to kill it
@@ -461,20 +470,20 @@ instead of just ^X^C."
   (global-set-key "\18\ 3y" 'save-buffers-kill-emacs))
 ;
 ; Fix problems with M-| setting window title of emacs' parent xterm
-(defun envdelete-term-termcap-windowid (list)
-  (let ((l list))
-    (mapcar '(lambda (x)
-               (if x (delq x l)))
-            (mapcar '(lambda (x)
-                       (if (or (string-match "^TERM=" x)
-                               (string-match "^TERMCAP=" x)
-                               (string-match "^WINDOWID=" x))
-                           x
-                         nil))
-                    l))
-    l))
-(setq process-environment
-      (envdelete-term-termcap-windowid process-environment))
+;(defun envdelete-term-termcap-windowid (list)
+;  (let ((l list))
+;    (mapcar '(lambda (x)
+;               (if x (delq x l)))
+;            (mapcar '(lambda (x)
+;                       (if (or (string-match "^TERM=" x)
+;                               (string-match "^TERMCAP=" x)
+;                               (string-match "^WINDOWID=" x))
+;                           x
+;                         nil))
+;                    l))
+;    l))
+;(setq process-environment
+;      (envdelete-term-termcap-windowid process-environment))
 ;
 (defun add-insertion-keys (table)
   "Adds keybindings according to TABLE.  Each element of
@@ -530,4 +539,38 @@ The citation string is taken from cite-string."
            (> (point-max) (point)))
         (insert cite-string)))))
 ;
+;
+
+
+;; (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)
+
 ; End of this file.