X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=home%2Femacs%2Fian.el;h=10acbdd9ee1b934f5b2bf455f0b1020d9872e857;hb=refs%2Fheads%2Fmaster;hp=cfc34945bd9335959267bab2f3ad57571186843c;hpb=0dcf2c0a5f5151e22d8d57680db283c4e9d48646;p=ian-dotfiles.git diff --git a/home/emacs/ian.el b/home/emacs/ian.el index cfc3494..c963fbb 100644 --- a/home/emacs/ian.el +++ b/home/emacs/ian.el @@ -2,16 +2,20 @@ ; (defalias 'perl-mode 'cperl-mode) -(setq cperl-invalid-face nil - cperl-indent-level 4 - cperl-continued-statement-offset 4) +(setq cperl-invalid-face nil) +; cperl-indent-level 4 +; cperl-continued-statement-offset 4) + +(load-library "vm-reply") (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 visible-cursor nil) + (setq browse-url-netscape-program "mozilla") (setq common-lisp-hyperspec-root "/usr/share/doc/hyperspec/") ; @@ -32,7 +36,7 @@ ; (if (string= (getenv "TERM") "bbcb32") (setq term-file-prefix nil)) ; (setq explicit-shell-file-name "/usr/local/bin/tcsh") (setq inhibit-local-variables t) -(setq enable-local-variables 'ask-me) +(setq enable-local-variables :safe) (setq enable-recursive-minibuffers t) (setq compile-command "make") (setq next-line-add-newlines t) @@ -40,6 +44,18 @@ (setq line-move-visual nil) (display-time) ; +(set-default 'indent-line-function 'insert-tab) +(defun defuse-electrocuting-indent () + "Disable electric-indent-mode if indent-line-function is daft" + (and + (eq indent-line-function 'insert-tab) + (electric-indent-local-mode 0))) +(add-hook 'after-change-major-mode-hook 'defuse-electrocuting-indent) + +(eval-after-load "sh-script" + '(add-hook 'sh-mode-hook (lambda () (sh-electric-here-document-mode 0)) + t)) +; (set-variable 'search-repeat-char 28) (set-fringe-mode (cons 0 nil)) (if (string-match "^19\." emacs-version) @@ -95,6 +111,8 @@ (global-set-key " " 'quicker-compile) (global-set-key "" 'exchange-point-and-mark) (global-set-key "" 'load-tramp) + (global-set-key "g" 'magit-status) + (global-set-key "g" 'magit-dispatch-popup) (global-set-key "4" 'scroll-other-window) (global-set-key "4m" 'vm-mail-other-window) (global-set-key "9" 'vm-visit-folder) @@ -189,6 +207,8 @@ ;(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 @@ -454,9 +474,9 @@ then call send-and-exit." ; (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 @@ -466,20 +486,20 @@ instead of just ^X^C." (global-set-key "y" '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 @@ -535,4 +555,49 @@ The citation string is taken from cite-string." (> (point-max) (point))) (insert cite-string))))) ; +; + +(winner-mode t) + +(global-magit-file-mode) + +(magit-wip-after-save-mode) +(magit-wip-after-apply-mode) +(magit-wip-before-change-mode) +(setq magit-no-confirm + (append magit-no-confirm '(safe-with-wip))) + +(setq vc-handled-backends (delq 'Git vc-handled-backends)) + +;; (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.