chiark / gitweb /
found
[ian-dotfiles.git] / home / emacs / ian.el
index eb245b76fb210e599b41dde413048e12536f917e..c963fbb5172ba70385152d1d8bfb7e86b8fead43 100644 (file)
@@ -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)
 (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)
   (global-set-key "\18\v" 'quicker-compile)
   (global-set-key "\18\18" 'exchange-point-and-mark)
   (global-set-key "\18\1a" 'load-tramp)
+  (global-set-key "\18g" 'magit-status)
+  (global-set-key "\18\eg" 'magit-dispatch-popup)
   (global-set-key "\184\16" 'scroll-other-window)
   (global-set-key "\184m" 'vm-mail-other-window)
   (global-set-key "\189" 'vm-visit-folder)
 ;(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
@@ -466,20 +486,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
@@ -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.