]> git.donarmstrong.com Git - emacs.git/blob - .emacs
use ssh controlmaster options in config
[emacs.git] / .emacs
1 (custom-set-variables
2  ;; custom-set-variables was added by Custom.
3  ;; If you edit it by hand, you could mess it up, so be careful.
4  ;; Your init file should contain only one such instance.
5  ;; If there is more than one, they won't work right.
6  '(bibtex-user-optional-fields (quote (("annote" "Personal annotation (ignored)") ("abstract" "") ("pmid" "") ("doi" ""))))
7  '(calendar-latitude [33 57 north])
8  '(calendar-longitude [117 24 west])
9  '(case-fold-search t)
10  '(confirm-kill-emacs (quote y-or-n-p))
11  '(cperl-lazy-help-time nil)
12  '(debian-changelog-mailing-address "don@debian.org" t)
13  '(display-time t)
14  '(display-time-24hr-format t)
15  '(display-time-day-and-date t)
16  '(display-time-mode t)
17  '(font-latex-fontify-script nil)
18  '(font-latex-fontify-sectioning (quote color))
19  '(font-latex-script-display (quote (nil)))
20  '(global-auto-revert-mode t)
21  '(global-font-lock-mode t nil (font-lock))
22  '(global-set-key "\347" t)
23  '(icomplete-mode t)
24  '(log-edit-keep-buffer t)
25  '(mail-user-agent (quote sendmail-user-agent))
26  '(markdown-enable-math t)
27  '(markdown-follow-wiki-link-on-enter nil)
28  '(mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
29  '(post-email-address "don@donarmstrong.com")
30  '(post-kill-quoted-sig nil)
31  '(post-mail-message "mutt\\(ng\\|\\)-[a-z0-9]+-[0-9]+-.*")
32  '(post-uses-fill-mode nil)
33  '(ps-footer-font-size (quote (8 . 10)))
34  '(ps-header-font-size (quote (8 . 10)))
35  '(ps-header-title-font-size (quote (10 . 10)))
36  '(ps-line-number-color "blue")
37  '(ps-print-footer t)
38  '(ps-print-footer-frame nil)
39  '(ps-print-only-one-header t)
40  '(safe-local-variable-values (quote ((auto-save-default) (make-backup-files))))
41  '(sentence-end "[.?!][]\"')]*\\($\\|   \\| \\)[        
42 ]*")
43  '(sentence-end-double-space nil)
44  '(show-paren-mode t)
45  '(tool-bar-mode nil nil (tool-bar))
46  '(user-mail-address "don@donarmstrong.com")
47  '(vc-delete-logbuf-window nil)
48  '(vc-follow-symlinks t))
49
50 ;; use git before SVN; use CVS earlier, because I have CVS
51 ;; repositories inside of git directories
52 (setq vc-handled-backends (quote (CVS Git RCS SVN SCCS Bzr Hg Mtn Arch)))
53
54 ;; switch back to the old primary selection method
55 (setq x-select-enable-clipboard nil)
56 (setq x-select-enable-primary t)
57 ; (setq mouse-drag-copy-region t)
58
59 (fset 'perl-mode 'cperl-mode)
60 ;;(load-file "cperl-mode.el")
61 (add-to-list 'load-path '"~/lib/emacs_el/configuration/")
62 (require 'don-configuration)
63
64 (require 'vcl-mode)
65
66 (require 'tex-site)
67 ;;(require 'psvn)
68 ;;(require 'ecasound)
69 ;;(require 'emacs-wiki)
70 (require 'bibtex)
71 (require 'post)
72 ;;(require 'fixme)
73 ; (require 'google-weather)
74 ; (require 'org-google-weather)
75 ; (setq-default org-google-weather-format "%i %c, [%l,%h] %s %C")
76
77 ; http://julien.danjou.info/projects/emacs-packages#rainbow-mode
78 ; this colorizes color strings
79 (require 'rainbow-mode)
80 ; add ess to the x major mode
81 (add-to-list 'rainbow-x-colors-major-mode-list 'ESS[S])
82 (add-to-list 'rainbow-x-colors-major-mode-list 'ESS[R])
83
84 (global-set-key "\C-xp" 'server-edit)
85
86 (setq-default auto-mode-alist (cons '("\.wml$" . 
87                               (lambda () (html-mode) (auto-fill-mode)))
88                             auto-mode-alist))
89
90
91 ; use markdown mode for mdwn files
92 (add-to-list 'auto-mode-alist '("\\.mdwn$" . markdown-mode))
93
94
95 ;; tramp configuration
96 (setq tramp-use-ssh-controlmaster-options nil)
97
98 ; mail configuration
99 (add-to-list 'auto-mode-alist '("muttng-[a-z0-9]+-[0-9]+-" . message-mode))
100 (add-to-list 'auto-mode-alist '("muttngrc" . muttrc-mode))
101
102 (add-to-list 'auto-mode-alist '("mutt-[a-z0-9]+-[0-9]+-" . message-mode))
103 (add-to-list 'auto-mode-alist '("muttrc" . muttrc-mode))
104 (defun my-message-mode-settings ()
105   (font-lock-add-keywords nil
106                           '(("^[ \t]*>[ \t]*>[ \t]*>.*$"
107                              (0 'message-multiply-quoted-text-face))
108                             ("^[ \t]*>[ \t]*>.*$"
109                              (0 'message-double-quoted-text-face))))
110   (local-set-key (kbd "C-c C-a") 'my-post-attach-file)
111   )
112 (add-hook 'message-mode-hook 'my-message-mode-settings)
113
114 (defun my-post-attach-file ()
115   "Prompt for an attachment."
116   (interactive)
117   (let ((file (read-file-name "Attach file: " nil nil t nil))
118         (description (string-read "Description: ")))
119     (my-header-attach-file file description)))
120
121 (symbol-function 'my-post-attach-file)
122
123 (defun my-header-attach-file (file description)
124   "Attach a FILE to the current message (works with Mutt).
125 Argument DESCRIPTION MIME description."
126   (interactive "fAttach file: \nsDescription: ")
127   (when (> (length file) 0)
128     (save-excursion
129       (save-match-data
130         (save-restriction
131           (widen)
132           (goto-char (point-min))
133           (search-forward-regexp "^$")
134           (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " "
135                           description "\n"))
136           (message (concat "Attached '" file "'."))
137           (setq post-has-attachment t))))))
138
139
140
141 (setq mail-yank-prefix "> ")
142
143 (global-unset-key "\M-g")
144 (global-set-key "\M-g" 'goto-line)
145
146 ;; self-insert-command hack.
147 ;;   Without this, "if<SP>" expands to
148 ;;   if ( -!-) {
149 ;;   }
150 ;;   which really should be,
151 ;;   if (-!-) {
152 ;;   }
153
154
155
156 ;(load-library "php-mode")
157
158 (setq-default c-indent-level 4)
159 (setq-default c-brace-imaginary-offset 0)
160 (setq-default c-brace-offset -4)
161 (setq-default c-argdecl-indent 4)
162 (setq-default c-label-offset -4)
163 (setq-default c-continued-statement-offset 4)
164 ; tabs are annoying
165 (setq-default indent-tabs-mode nil)
166 (setq-default tab-width 4)
167
168
169 ;; (autoload 'php-mode "php-mode" "PHP editing mode" t)
170 ;; (add-to-list 'auto-mode-alist '("\\.php3?\\'" . php-mode))
171 ;; (add-to-list 'auto-mode-alist '("\\.phtml?\\'" . php-mode))
172 ;; (add-to-list 'auto-mode-alist '("\\.php?\\'" . php-mode))
173 ;; (add-to-list 'auto-mode-alist '("\\.php4?\\'" . php-mode))
174
175 ;; REFTEX (much enhanced management of cross-ref, labels, etc)
176 ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
177 (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
178 (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
179 (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
180 (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
181 (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
182 (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
183 (add-hook 'LaTeX-mode-hook 'outline-minor-mode)   ; with AUCTeX LaTeX mode
184 (add-hook 'latex-mode-hook 'outline-minor-mode)   ; with Emacs latex mode
185
186 ; use smart quotes by default instead of `` and ''
187 ; taken from http://kieranhealy.org/esk/kjhealy.html
188 (setq TeX-open-quote "“")
189 (setq TeX-close-quote "”")
190
191 ;; (TeX-add-style-hook
192 ;;  "latex"
193 ;;  (lambda ()
194 ;;    (TeX-add-symbols
195 ;;     '("DLA" 1))))
196 ;; (custom-set-variables
197 ;;  '(font-latex-user-keyword-classes 
198 ;;    '(("fixme" 
199 ;;       ("DLA" "RZ")
200 ;;       font-lock-function-name-face 2 (command 1 t))))
201 ;; ) 
202
203 (require 'font-latex)
204 (setq font-latex-match-reference-keywords
205       '(
206         ("fref" "{")
207         ("Fref" "{")
208         ("citep" "{")
209         ("citet" "{")
210         ("acs" "{")
211         ("acsp" "{")
212         ("ac" "{")
213         ("acp" "{")
214         ("acl" "{")
215         ("aclp" "{")
216         ("acsu" "{")
217         ("aclu" "{")
218         ("acused" "{")
219 ;         ))
220 ; (setq font-latex-match-warning-keywords
221 ;       '(
222         ("DLA" "{")
223         ("RZ" "{")
224         ("OM" "{")
225         ("DL" "{")
226         ("fixme" "{")))
227       
228 (setq-default TeX-parse-self t)
229 (setq-default TeX-auto-save t)
230 (setq-default TeX-master nil)
231
232 ;; this doesn't seem to work; not currently sure why
233 ; (setq font-latex-user-keyword-classes
234 ;       '(("my-warning-commands"
235 ;          (("DLA" "{")
236 ;           ("RZ" "{")
237 ;           ("OM" "{")
238 ;           ("DL" "{")
239 ;           ("fixme" "{")
240 ;           )
241 ;          (:foreground "red" :weight bold :underline (:color foreground-color :style line)))
242 ;         ))
243
244
245 (defun insert-date ()
246   "Insert date at point."
247   (interactive)
248   (insert (format-time-string "%A, %B %e, %Y %k:%M:%S %Z")))
249 (global-set-key "\C-[d" 'insert-date)
250
251 (defun unfill-paragraph (arg)
252   "Pull this whole paragraph up onto one line."
253   (interactive "*p")
254   (let ((fill-column 10000))
255     (fill-paragraph arg))
256   )
257
258 (column-number-mode t)
259 (setq-default reftex-plug-into-AUCTeX t)
260
261 (server-start)
262
263 (require 'mode-compile)
264
265 (setq-default reftex-default-bibliography
266       '("~/projects/research/references.bib"))
267
268 (defadvice server-process-filter (after post-mode-message first activate)
269   "If the buffer is in post mode, overwrite the server-edit
270     message with a post-save-current-buffer-and-exit message."
271   (if (eq major-mode 'post-mode)
272       (message
273        (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done."))))
274                                         ; This is also needed to see the magic message.  Set to a higher
275                                         ; number if you have a faster computer or read slower than me.
276 '(font-lock-verbose 1000)
277 ;(setq-default server-temp-file-regexp "mutt\(-\|ng-\)")
278 ; (add-hook 'server-switch-hook 
279 ;         (function (lambda()
280 ;                     (cond ((string-match "Post" mode-name)
281 ;                            (post-goto-body)))
282 ;                     set-buffer-file-coding-system 'utf-8
283 ;                     )))
284
285
286 (add-hook 'post-mode-hook
287           (auto-fill-mode nil)
288           )
289 ; abbrev mode settings
290 ; load abbreviations from 
291 (setq abbrev-file-name       
292       "~/.emacs_abbrev_def")
293
294 ; read the abbrev file if it exists
295 (if (file-exists-p abbrev-file-name)
296     (quietly-read-abbrev-file))
297
298 ; for now, use abbrev mode everywhere
299 (setq default-abbrev-mode t)
300
301
302 (defun insert-function-documentation ()
303   "Insert function documentation"
304   (interactive)
305   (insert-file-contents "/home/don/lib/templates/perl_function_documentation" nil))
306 (global-set-key "\M-f" 'insert-function-documentation)
307
308 (eval-after-load "lilypond-mode" 
309   '(progn
310      (load-library "lyqi-mode")
311      (define-key LilyPond-mode-map "\C-cq" 'lyqi-mode)))
312
313 (autoload 'spamassassin-mode "spamassassin-mode" nil t)
314
315 (desktop-load-default)
316 (desktop-read)
317 '(icomplete-mode on)
318 (custom-set-faces
319  ;; custom-set-faces was added by Custom.
320  ;; If you edit it by hand, you could mess it up, so be careful.
321  ;; Your init file should contain only one such instance.
322  ;; If there is more than one, they won't work right.
323  '(menu ((((type x-toolkit)) (:background "black" :foreground "grey90")))))
324
325
326 (put 'upcase-region 'disabled nil)
327 (put 'downcase-region 'disabled nil)
328 (put 'narrow-to-region 'disabled nil)
329
330
331 (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
332 (add-hook 'message-mode-hook 'turn-on-flyspell)
333 (add-hook 'text-mode-hook 'turn-on-flyspell)
334 (add-hook 'c-mode-common-hook 'flyspell-prog-mode)
335 (add-hook 'cperl-mode-hook 'flyspell-prog-mode)
336 (add-hook 'tcl-mode-hook 'flyspell-prog-mode)
337 (defun turn-on-flyspell ()
338    "Force flyspell-mode on using a positive arg.  For use in hooks."
339    (interactive)
340    (flyspell-mode 1))
341
342
343  ; Outline-minor-mode key map
344  (define-prefix-command 'cm-map nil "Outline-")
345  ; HIDE
346  (define-key cm-map "q" 'hide-sublevels)    ; Hide everything but the top-level headings
347  (define-key cm-map "t" 'hide-body)         ; Hide everything but headings (all body lines)
348  (define-key cm-map "o" 'hide-other)        ; Hide other branches
349  (define-key cm-map "c" 'hide-entry)        ; Hide this entry's body
350  (define-key cm-map "l" 'hide-leaves)       ; Hide body lines in this entry and sub-entries
351  (define-key cm-map "d" 'hide-subtree)      ; Hide everything in this entry and sub-entries
352  ; SHOW
353  (define-key cm-map "a" 'show-all)          ; Show (expand) everything
354  (define-key cm-map "e" 'show-entry)        ; Show this heading's body
355  (define-key cm-map "i" 'show-children)     ; Show this heading's immediate child sub-headings
356  (define-key cm-map "k" 'show-branches)     ; Show all sub-headings under this heading
357  (define-key cm-map "s" 'show-subtree)      ; Show (expand) everything in this heading & below
358  ; MOVE
359  (define-key cm-map "u" 'outline-up-heading)                ; Up
360  (define-key cm-map "n" 'outline-next-visible-heading)      ; Next
361  (define-key cm-map "p" 'outline-previous-visible-heading)  ; Previous
362  (define-key cm-map "f" 'outline-forward-same-level)        ; Forward - same level
363  (define-key cm-map "b" 'outline-backward-same-level)       ; Backward - same level
364  (global-set-key "\M-o" cm-map)
365
366
367 ; debian stuff
368 (setq-default debian-changelog-mailing-address "don@debian.org")
369 (setq-default debian-changelog-full-name "Don Armstrong")
370
371 ; ediff configuration
372 ; don't use the multi-window configuration
373 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
374
375 ; use iedit
376 (require 'iedit)
377 (define-key global-map (kbd "C-;") 'iedit-mode)
378 (global-set-key  (kbd "C-;") 'iedit-mode)
379
380 ; fix up css mode to not be silly
381 ; from http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/
382 (setq cssm-indent-level 4)
383 (setq cssm-newline-before-closing-bracket t)
384 (setq cssm-indent-function #'cssm-c-style-indenter)
385 (setq cssm-mirror-mode nil)
386
387 (require 'multi-web-mode)
388 (setq mweb-default-major-mode 'html-mode)
389 (setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
390                   (js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
391                   (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
392 (setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))
393 (multi-web-global-mode 1)
394
395 ;;; alias the new `flymake-report-status-slim' to
396 ;;; `flymake-report-status'
397 (defalias 'flymake-report-status 'flymake-report-status-slim)
398 (defun flymake-report-status-slim (e-w &optional status)
399   "Show \"slim\" flymake status in mode line."
400   (when e-w
401     (setq flymake-mode-line-e-w e-w))
402   (when status
403     (setq flymake-mode-line-status status))
404   (let* ((mode-line " Φ"))
405     (when (> (length flymake-mode-line-e-w) 0)
406       (setq mode-line (concat mode-line ":" flymake-mode-line-e-w)))
407     (setq mode-line (concat mode-line flymake-mode-line-status))
408     (setq flymake-mode-line mode-line)
409     (force-mode-line-update)))
410
411 ; load sql-indent when sql is loaded
412 (eval-after-load "sql"
413   '(load-library "sql-indent"))
414
415 ; fix up tmux xterm keys
416 ; stolen from http://unix.stackexchange.com/questions/24414/shift-arrow-not-working-in-emacs-within-tmux
417 (if (getenv "TMUX")
418     (progn
419       (let ((x 2) (tkey ""))
420         (while (<= x 8)
421           ;; shift
422           (if (= x 2)
423               (setq tkey "S-"))
424           ;; alt
425           (if (= x 3)
426               (setq tkey "M-"))
427           ;; alt + shift
428           (if (= x 4)
429               (setq tkey "M-S-"))
430           ;; ctrl
431           (if (= x 5)
432               (setq tkey "C-"))
433           ;; ctrl + shift
434           (if (= x 6)
435               (setq tkey "C-S-"))
436           ;; ctrl + alt
437           (if (= x 7)
438               (setq tkey "C-M-"))
439           ;; ctrl + alt + shift
440           (if (= x 8)
441               (setq tkey "C-M-S-"))
442           
443           ;; arrows
444           (define-key key-translation-map (kbd (format "M-[ 1 ; %d A" x)) (kbd (format "%s<up>" tkey)))
445           (define-key key-translation-map (kbd (format "M-[ 1 ; %d B" x)) (kbd (format "%s<down>" tkey)))
446           (define-key key-translation-map (kbd (format "M-[ 1 ; %d C" x)) (kbd (format "%s<right>" tkey)))
447           (define-key key-translation-map (kbd (format "M-[ 1 ; %d D" x)) (kbd (format "%s<left>" tkey)))
448           ;; home
449           (define-key key-translation-map (kbd (format "M-[ 1 ; %d H" x)) (kbd (format "%s<home>" tkey)))
450           ;; end
451           (define-key key-translation-map (kbd (format "M-[ 1 ; %d F" x)) (kbd (format "%s<end>" tkey)))
452           ;; page up
453           (define-key key-translation-map (kbd (format "M-[ 5 ; %d ~" x)) (kbd (format "%s<prior>" tkey)))
454           ;; page down
455           (define-key key-translation-map (kbd (format "M-[ 6 ; %d ~" x)) (kbd (format "%s<next>" tkey)))
456           ;; insert
457           (define-key key-translation-map (kbd (format "M-[ 2 ; %d ~" x)) (kbd (format "%s<delete>" tkey)))
458           ;; delete
459           (define-key key-translation-map (kbd (format "M-[ 3 ; %d ~" x)) (kbd (format "%s<delete>" tkey)))
460           ;; f1
461           (define-key key-translation-map (kbd (format "M-[ 1 ; %d P" x)) (kbd (format "%s<f1>" tkey)))
462           ;; f2
463           (define-key key-translation-map (kbd (format "M-[ 1 ; %d Q" x)) (kbd (format "%s<f2>" tkey)))
464           ;; f3
465           (define-key key-translation-map (kbd (format "M-[ 1 ; %d R" x)) (kbd (format "%s<f3>" tkey)))
466           ;; f4
467           (define-key key-translation-map (kbd (format "M-[ 1 ; %d S" x)) (kbd (format "%s<f4>" tkey)))
468           ;; f5
469           (define-key key-translation-map (kbd (format "M-[ 15 ; %d ~" x)) (kbd (format "%s<f5>" tkey)))
470           ;; f6
471           (define-key key-translation-map (kbd (format "M-[ 17 ; %d ~" x)) (kbd (format "%s<f6>" tkey)))
472           ;; f7
473           (define-key key-translation-map (kbd (format "M-[ 18 ; %d ~" x)) (kbd (format "%s<f7>" tkey)))
474           ;; f8
475           (define-key key-translation-map (kbd (format "M-[ 19 ; %d ~" x)) (kbd (format "%s<f8>" tkey)))
476           ;; f9
477           (define-key key-translation-map (kbd (format "M-[ 20 ; %d ~" x)) (kbd (format "%s<f9>" tkey)))
478           ;; f10
479           (define-key key-translation-map (kbd (format "M-[ 21 ; %d ~" x)) (kbd (format "%s<f10>" tkey)))
480           ;; f11
481           (define-key key-translation-map (kbd (format "M-[ 23 ; %d ~" x)) (kbd (format "%s<f11>" tkey)))
482           ;; f12
483           (define-key key-translation-map (kbd (format "M-[ 24 ; %d ~" x)) (kbd (format "%s<f12>" tkey)))
484           ;; f13
485           (define-key key-translation-map (kbd (format "M-[ 25 ; %d ~" x)) (kbd (format "%s<f13>" tkey)))
486           ;; f14
487           (define-key key-translation-map (kbd (format "M-[ 26 ; %d ~" x)) (kbd (format "%s<f14>" tkey)))
488           ;; f15
489           (define-key key-translation-map (kbd (format "M-[ 28 ; %d ~" x)) (kbd (format "%s<f15>" tkey)))
490           ;; f16
491           (define-key key-translation-map (kbd (format "M-[ 29 ; %d ~" x)) (kbd (format "%s<f16>" tkey)))
492           ;; f17
493           (define-key key-translation-map (kbd (format "M-[ 31 ; %d ~" x)) (kbd (format "%s<f17>" tkey)))
494           ;; f18
495           (define-key key-translation-map (kbd (format "M-[ 32 ; %d ~" x)) (kbd (format "%s<f18>" tkey)))
496           ;; f19
497           (define-key key-translation-map (kbd (format "M-[ 33 ; %d ~" x)) (kbd (format "%s<f19>" tkey)))
498           ;; f20
499           (define-key key-translation-map (kbd (format "M-[ 34 ; %d ~" x)) (kbd (format "%s<f20>" tkey)))
500
501           (setq x (+ x 1))
502           ))
503       )
504   )
505
506 ; require org mode
507 (load "org-mode-configuration")
508 ; ess configuration
509 (load "ess_remote_eval")
510 (load "ess_configuration")
511 ; procmailmode configuration
512 (load "procmail_mode")
513
514 (load "mode-line-cleaner")
515
516 (defadvice ask-user-about-supersession-threat (around ask-user-about-supersession-threat-if-necessary)
517   "Call ask-user-about-supersession-threat only if the buffer is actually obsolete."
518   (if (or (buffer-modified-p)
519           (verify-visited-file-modtime)
520           (< (* 8 1024 1024) (buffer-size))
521           (/= 0 (call-process-region 1 (+ 1 (buffer-size)) "diff" nil nil nil "-q" (buffer-file-name) "-")))
522       ad-do-it
523     (clear-visited-file-modtime)
524     (not-modified)))
525 (ad-activate 'ask-user-about-supersession-threat)
526
527 ; apparently things like to step on C-;, so we'll use a hack from
528 ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
529
530 (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
531
532 ; use iedit everywhere
533 (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
534
535 (define-minor-mode my-keys-minor-mode
536   "A minor mode so that my key settings override annoying major modes."
537   t " my-keys" 'my-keys-minor-mode-map)
538
539 (my-keys-minor-mode 1)
540 (defun my-minibuffer-setup-hook ()
541   (my-keys-minor-mode 0))
542
543 (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
544 (defadvice load (after give-my-keybindings-priority)
545   "Try to ensure that my keybindings always have priority."
546   (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
547       (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
548         (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
549         (add-to-list 'minor-mode-map-alist mykeys))))
550 (ad-activate 'load)
551 (global-set-key "\M- " 'hippie-expand)