chiark / gitweb /
c963fbb5172ba70385152d1d8bfb7e86b8fead43
[ian-dotfiles.git] / home / emacs / ian.el
1 ; This is my real emacs start-up file (for chiark).
2
3
4 (defalias 'perl-mode 'cperl-mode)
5 (setq cperl-invalid-face nil)
6 ;      cperl-indent-level 4
7 ;      cperl-continued-statement-offset 4)
8
9 (load-library "vm-reply")
10
11 (make-variable-buffer-local 'indent-line-function)
12 ; Un-disable narrow and eval-expression
13 (put 'narrow-to-region 'disabled nil)
14 (put 'eval-expression 'disabled nil)
15 ;(standard-display-european t)
16
17 (setq visible-cursor nil)
18
19 (setq browse-url-netscape-program "mozilla")
20 (setq common-lisp-hyperspec-root "/usr/share/doc/hyperspec/")
21 ;
22 ; Make sure we don't disturb links or change ownership, use numbers
23 (setq backup-by-copying-when-mismatch t)
24 (setq backup-by-copying-when-linked t)
25 ;(setq version-control t
26 ;      kept-new-versions 4
27 ;      kept-old-versions 4
28 ;      trim-versions-without-asking t)
29 ;
30 ; Various one-liners
31 (setq require-final-newline "ask")
32 (if (string= window-system 'x) (load-library "ian-x"))
33 (load-library "ian-aliases")
34 ; (load-library "auto-pgp")
35 ; (load-library "debian-changelog-mode")
36 ; (if (string= (getenv "TERM") "bbcb32") (setq term-file-prefix nil))
37 ; (setq explicit-shell-file-name "/usr/local/bin/tcsh")
38 (setq inhibit-local-variables t)
39 (setq enable-local-variables :safe)
40 (setq enable-recursive-minibuffers t)
41 (setq compile-command "make")
42 (setq next-line-add-newlines t)
43 (setq diff-switches "-u")
44 (setq line-move-visual nil)
45 (display-time)
46 ;
47 (set-default 'indent-line-function 'insert-tab)
48 (defun defuse-electrocuting-indent ()
49   "Disable electric-indent-mode if indent-line-function is daft"
50   (and
51    (eq indent-line-function 'insert-tab)
52    (electric-indent-local-mode 0)))
53 (add-hook 'after-change-major-mode-hook 'defuse-electrocuting-indent)
54
55 (eval-after-load "sh-script"
56   '(add-hook 'sh-mode-hook (lambda () (sh-electric-here-document-mode 0))
57              t))
58 ;
59 (set-variable 'search-repeat-char 28)
60 (set-fringe-mode (cons 0 nil))
61 (if (string-match "^19\." emacs-version)
62     (progn
63 ;      (setq file-name-handler-alist     ; Disable nasty auto-loading of ange-ftp
64 ;            (delq (rassq 'ange-ftp-completion-hook-function file-name-handler-alist)
65 ;                  file-name-handler-alist))
66       (require 'find-alternate-18style)
67       (defun unset-down-mouse-23 ()
68         (local-set-key [mouse-2] 'mouse-yank-at-click)
69         (local-unset-key [down-mouse-2])
70         (local-unset-key [down-mouse-3])
71         (local-unset-key [C-down-mouse-3]))
72       (add-hook 'vm-mode-hook 'unset-down-mouse-23)
73       (add-hook 'vm-mail-mode-hook 'unset-down-mouse-23)
74       (add-hook 'text-mode-hook 'unset-down-mouse-23)
75       (add-hook 'Info-mode-hook
76                 (function (lambda ()
77                             (local-set-key " " 'scroll-up)
78                             (local-set-key "\7f" 'scroll-down))))
79       (add-hook 'sh-mode-hook
80                 (function (lambda ()
81                             (local-set-key "<" 'self-insert-command))))
82       (define-key isearch-mode-map "\1c" 'isearch-repeat-forward)
83       (define-key isearch-mode-map "\1d" 'isearch-quote-char)))
84 ;
85 (menu-bar-mode -1)
86 (defun terminal-keybindings ()
87   "This function should be called by the term-setup-hook mechanism"
88   (interactive)
89   ; Set my own keybindings
90   ;
91   ; Set keybindings generally (including I-search on C-\)
92 ;  (global-set-key "    " 'self-insert-command)
93   (global-set-key "\1c" 'isearch-forward)
94 ;  (global-set-key "\r" 'newline)
95   (global-set-key "\ f" 'set-mark-command)
96   (global-set-key "\1d" 'quoted-insert)
97   ;
98   ; Set keybindings on esc-map
99   (global-set-key "\e#" 'query-replace-regexp)
100   (global-set-key "\e+" 'toggle-truncate-lines)
101   (global-set-key "\eg" 'goto-line)
102   (global-set-key "\es" 'isearch-forward-regexp)
103   (global-set-key "\e\e" 'eval-expression)
104   ;
105   ; Set keybindings on ^X-map.
106   (global-set-key "\18m" 'vm-mail)
107   (global-set-key "\18\1c" 'save-buffer)
108   (global-set-key "\18\1d" 'toggle-read-only)
109   (global-set-key "\18#" 'recover-file)
110   (global-set-key "\18\12" 'bury-buffer)
111   (global-set-key "\18\v" 'quicker-compile)
112   (global-set-key "\18\18" 'exchange-point-and-mark)
113   (global-set-key "\18\1a" 'load-tramp)
114   (global-set-key "\18g" 'magit-status)
115   (global-set-key "\18\eg" 'magit-dispatch-popup)
116   (global-set-key "\184\16" 'scroll-other-window)
117   (global-set-key "\184m" 'vm-mail-other-window)
118   (global-set-key "\189" 'vm-visit-folder)
119   (global-set-key "\188" 'rmail-input)
120   (global-set-key "\18p" 'cite-region)
121   (global-set-key "\18F" 'mail-formletter)
122   ;
123   ; Set keybindings for Sun numeric pad.
124   (setq esc-bracket-map (make-keymap))
125   (define-key esc-bracket-map "D" 'backward-char)
126   (define-key esc-bracket-map "C" 'forward-char)
127   (define-key esc-bracket-map "A" 'previous-line)
128   (define-key esc-bracket-map "B" 'next-line)
129   (define-key esc-map "[" esc-bracket-map)
130   (global-set-key "\e[214z" 'beginning-of-buffer)
131   (global-set-key "\e[220z" 'end-of-buffer)
132   (global-set-key "\e[216z" 'scroll-down)
133   (global-set-key "\e[222z" 'scroll-up)
134   (global-set-key "\e[192z" 'save-buffer)
135   (global-set-key "\e[194z" 'save-some-buffers)
136   (global-set-key "\e[195z" 'undo)
137   (global-set-key "\e[193z" 'call-last-kbd-macro)
138   (global-set-key "\e[196z" 'switch-to-buffer-other-window)
139   (global-set-key "\e[197z" 'copy-region-as-kill)
140   (global-set-key "\e[198z" 'find-file)
141   (global-set-key "\e[199z" 'yank)
142   (global-set-key "\e[198z" 'find-alternate-file)
143   (global-set-key "\e[200z" 'find-file)
144   (global-set-key "\e[201z" 'kill-region)
145   (global-set-key "\e[-1z" 'info)
146   ;
147   ; Set keybindings for Chiarks' x11emacs
148   (global-set-key "\e[5~" 'scroll-down)
149   (global-set-key "\e[6~" 'scroll-up)
150   ;
151   ; Set keybindings for knackered vt100-like terminal emulators.
152   (global-set-key "\eOt" 'scroll-down)
153   (global-set-key "\eOu" 'scroll-up)
154   (global-set-key "\eOD" 'backward-char)
155   (global-set-key "\eOC" 'forward-char)
156   (global-set-key "\eOA" 'previous-line)
157   (global-set-key "\eOB" 'next-line))
158 (setq term-setup-hook 'terminal-keybindings)     ; remap keys in due course
159 ;
160 (setq frame-title-format
161       '(multiple-frames
162         (:eval 
163          (let*
164              ((buf (current-buffer))
165               (leaf (buffer-name buf))
166               (dir default-directory))
167            (if dir
168                (let*
169                    ((dir (abbreviate-file-name dir))
170                     (node (replace-regexp-in-string "\\..*" "" system-name)))
171                  (concat leaf "  " node ":" dir))
172              leaf)))
173         ("" invocation-name "@" system-name)))
174 ;(setq frame-title-format
175 ;      '(multiple-frames
176 ;       (:eval 
177 ;        (let*
178 ;            ((buf (current-buffer))
179 ;             (fn (buffer-file-name buf)))
180 ;          (if fn
181 ;              (let*
182 ;                  ((fn (abbreviate-file-name fn))
183 ;                   (dir (file-name-directory fn))
184 ;                   (leaf (file-name-nondirectory fn))
185 ;                   (node (replace-regexp-in-string "\\..*" "" system-name)))
186 ;                (concat leaf "  " node ":" dir))
187 ;            (buffer-name buf))))
188 ;       ("" invocation-name "@" system-name)))
189 ;
190 ; Autoload definitions
191 (autoload 'tar-mode "tar-mode")
192 (autoload 'uncompress-while-visiting "uncompress")
193 ; (autoload 'c++-mode "c++-mode" "Mode for editing C and C++ programs" t)
194 (autoload 'hide-ifdef-mode "hideif" "For editing code with #ifdefs" t)
195 ;(setq-default indent-tabs-mode nil)
196 (autoload 'dired-find-alternate-file "dired-alternate" "Find alternately" t)
197 (autoload 'dired-run-file "dired-alternate" "Run this file" t)
198 (autoload 'perl-mode "perl-mode" "Mode for Perl code" t)
199 ; (autoload 'rmail "rmail-fixed" "Patched mail reader" t)
200 (autoload 'quicker-compile "quicker-compile" "Patched Compile mode" t)
201
202 ;(autoload 'vm "vm" "Start VM on your primary inbox." t)
203 ;(autoload 'vm-visit-folder "vm" "Start VM on an arbitrary folder." t)
204 ;(autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t)
205 ;(autoload 'vm-mode "vm" "Run VM major mode on a buffer" t)
206 ;(autoload 'vm-mail "vm" "Send a mail message using VM." t)
207 ;(autoload 'vm-submit-bug-report "vm" "Send a bug report about VM." t)
208 ;
209 ;(require 'vm-autoload)
210
211 (vm-legacy-key-bindings)
212 ;
213 ; (autoload 'info "info-fixed" "Patched info browser" t)
214 (setq shell-mode-hook
215       '(lambda ()
216          (make-variable-buffer-local 'scroll-step)
217          (setq scroll-step 1)))
218 (setq inferior-lisp-program "sbcl")
219 ;(setq jit-lock-chunk-size 100
220 ;      jit-lock-stealth-time 1.00)
221 (setq dired-mode-hook
222       '(lambda ()
223          (define-key dired-mode-map "F" 'dired-find-alternate-file)
224          (define-key dired-mode-map "X" 'dired-run-file)))
225 ;
226 ; Prevent loading of default init file and do some of the things it did
227 ; (setq inhibit-default-init t)
228 ;
229 ; Additional alist handling function
230 ;(defun alist-remove-elem (s s-list)
231 ;  "Delete the element of the alist S-LIST whose car is S"
232 ;  (if s-list (if (equal s (car (car s-list)))
233 ;                (cdr s-list)
234 ;              (cons (car s-list) (alist-remove-elem s (cdr s-list))))
235 ;    (nil)))
236 ;
237 ; Load C++ mode and edit Perl in perl mode
238 (setq auto-mode-alist
239       (append '(("\\.[ch]$" . c-mode)
240                 ("\\.[CH]$" . c++-mode)
241                 ("\\.cc$" . c++-mode)
242                 ("\\.hh$" . c++-mode)
243 ;                ("\\.tar$" . tar-mode)
244                 ("\\.pl$" . perl-mode)
245                 ("\\.ci$" . tex-mode)
246                 ("\\.asm$" . fundamental-mode)
247                 ("\\.Z$" . uncompress-while-visiting))
248               auto-mode-alist))
249 (setq interpreter-mode-alist
250       (append '(("sh" . fundamental-mode)
251                 ("bash" . fundamental-mode))
252               interpreter-mode-alist))
253 ;
254 ; Use auto-fill when editing text
255 (add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))
256 ; (add-hook 'text-mode-hook '(lambda () (local-set-key "        " 'self-insert-command)))
257 ;
258 ; Set up newline to auto-indent & other stuff for perl, c++ and c modes.
259 (setq perl-mode-hook '(lambda () 
260                         (local-set-key ";" 'self-insert-command)))
261 (setq c++-mode-hook '(lambda ()
262                        (hide-ifdef-mode 1)
263                        (local-set-key "," 'self-insert-command)
264                        (local-set-key ":" 'electric-c++-terminator)))
265 ; c++-electric-colon
266 (setq c-mode-hook '(lambda ()
267                      (hide-ifdef-mode 1)
268                      (c-set-offset 'substatement-open 0 nil)
269                      (local-set-key "," 'self-insert-command)
270                      (local-set-key ";" 'self-insert-command)
271                      (local-set-key "/" 'self-insert-command)
272                      (local-set-key "*" 'self-insert-command)
273                      (local-set-key "#" 'self-insert-command)
274                      (local-set-key "(" 'self-insert-command)
275                      (local-set-key ")" 'self-insert-command)
276                      (local-set-key "{" 'self-insert-command)
277                      (local-set-key "\r" 'newline-and-indent)))
278 (setq c-hanging-comment-ender-p nil)
279 ;
280 (defun vm-mail-other-window ()
281   "Like `vm-mail' command, but display buffer in another window."
282   (interactive)
283   (switch-to-buffer-other-window (current-buffer))
284   (vm-mail))
285 ;
286 ; mail precedences
287 (setq mail-precedence-key-alist
288       '((?0  . "special-delivery")
289         (?1  . "air-mail")
290         (?2  . "first-class")
291         (?3  . "second-class")
292         (?5  . "third-class")
293         (?\  . nil)
294         (?6  . "bulk")
295         (?9  . "junk")))
296 ;
297 (defun mail-precedence-as-key ()
298   "Set precedence by looking up last command char in mail-precedence-key-alist"
299   (interactive)
300   (message "%s" (concat "Precedence ["
301                         (mapconcat '(lambda (c) (char-to-string (car c)))
302                                    mail-precedence-key-alist "")
303                         "] ?"))
304   (let* ((key (read-char))
305          (prec (assoc key mail-precedence-key-alist)))
306     (if prec (mail-precedence (cdr prec))
307       (error "mail-precedence-as-key `%s' not found" key))))
308 ;
309 (defun mail-precedence-as-key-send-and-exit (arg)
310   "Set precedence by looking up last command char in mail-precedence-key-alist,
311 then call send-and-exit."
312   (interactive "P")
313   (mail-precedence-as-key)
314   (execute-kbd-macro "\ 3\ 3"))
315 ;
316 (defun mail-precedence (prec)
317   (save-excursion
318     (mail-position-on-field "Precedence")
319     (let ((p (point)))
320       (beginning-of-line)
321       (delete-region (point) p)
322       (if prec
323           (insert "Precedence: " prec)
324         (delete-char 1)))))
325 ;
326 (defun mail-mode-setup-keys ()
327   (local-set-key "\ 3\10" 'mail-precedence-as-key)
328   (local-set-key "\ 3p" 'mail-precedence-as-key-send-and-exit))
329 (add-hook 'mail-mode-hook 'mail-mode-setup-keys)
330 (add-hook 'vm-mail-mode-hook 'mail-mode-setup-keys)
331 ;
332 (defun vm-mail-other-window ()
333   "Like `vm-mail' command, but display buffer in another window."
334   (interactive)
335   (switch-to-buffer-other-window (current-buffer))
336   (vm-mail))
337 ;
338 (defun mail-formletter ()
339   "Run VM-mail with ,Formletter"
340   (interactive)
341   (vm-mail)
342   (rename-buffer (generate-new-buffer-name "form letter") t)
343   (delete-region (point-min) (point-max))
344   (insert-file (concat vm-folder-directory ",Formletter")))
345 ;
346 ; This function bound to C-x C-z
347 (defun load-tramp ()
348   "Load tramp using require, if it isn't loaded already"
349   (interactive)
350   (message "Loading tramp...")
351   (require 'tramp) ; -extended
352   (message "Loading tramp...done"))
353 ;
354 ; This function bound to M-+
355 (defun toggle-truncate-lines ()
356   "Toggle truncation or folding of long lines"
357   (interactive)
358   (set-variable 'truncate-lines (not truncate-lines))
359   (redraw-display))
360 ;
361 ; RMAIL stuff
362 ;(setq rmail-file-name "~/mail/RMAIL"
363 ;      mail-archive-file-name "~/mail/Outbound"
364 ;      rmail-primary-inbox-list '("~/mbox" "~/mail/Outbound" "~/mail/Record"
365 ;                                 "~/mail/Import" "/var/spool/mail/ian")
366 ;      rmail-delete-after-output t
367 ;      rmail-last-rmail-file ""
368 ;      rmail-ignored-headers (concat
369 ;                             "^Content-Identifier:\\|^X400-[^O][A-Za-z-]+:\\|"
370 ;                             rmail-ignored-headers))
371 ;
372 (defun make-regexps-ignore-non-address (list)
373   (apply 'append (mapcar
374                   '(lambda (item)
375                      (let ((item (mapconcat
376                                   '(lambda (ch)
377                                      (let ((s (char-to-string ch)))
378                                        (if (string-match "[][.*+?^$\\]" s)
379                                            (concat "\\" s)
380                                          s)))
381                                   item "")))
382                        (list
383                         (concat "<" item ">")
384                         (concat "^" item " *\\((.*)\\)?$"))))
385                   list)))
386 ;
387 ; BBDB
388 (setq bbdb-north-american-phone-numbers-p nil
389       bbdb/mail-auto-create-p t
390       bbdb-auto-revert-p t
391       bbdb-notice-auto-save-file-p t
392       bbdb-message-caching-enabled t)      
393 ;
394 ; VM stuff
395 (if (file-exists-p "~/private/private.el")
396   (load-file "~/private/private.el"))
397 (if (file-exists-p "~/private/private2.el")
398   (load-file "~/private/private2.el"))
399 (setq vm-included-text-attribution-format "%F writes (\"%s\"):\n"
400       vm-reply-subject-prefix "Re: "
401       vm-folder-directory "~/mail/"
402       vm-delete-after-saving t
403       vm-delete-empty-folders t
404       vm-mutable-windows t
405       vm-auto-get-new-mail nil
406       vm-auto-next-message nil
407       vm-jump-to-new-messages nil
408       vm-jump-to-unread-messages nil
409       vm-auto-displayed-mime-content-types '("text" "multipart")
410       vm-mime-digest-discard-header-regexp "only-drop-this-header"
411       vm-preview-lines nil
412       vm-included-text-prefix "> "
413       vm-confirm-quit 1
414       vm-auto-center-summary t
415       vm-confirm-new-folders t
416       vm-circular-folders nil
417       vm-visit-when-saving 0
418       vm-move-after-deleting t
419       vm-keep-sent-messages t
420       vm-follow-summary-cursor t
421       vm-frame-per-composition nil
422       vm-frame-per-edit nil
423       vm-frame-per-summary nil
424       vm-frame-per-folder nil
425       vm-tale-is-an-idiot t
426       vm-primary-inbox (concat vm-folder-directory "INBOX")
427       vm-sinbin-inbox (concat vm-folder-directory "SINBOX")
428       vm-uninteresting-senders "ian"
429       vm-reply-ignored-addresses
430       (make-regexps-ignore-non-address
431        '("ian@chiark.chu.cam.ac.uk" "ian" "iwj10@cus.cam.ac.uk"
432          "ian@chiark.greenend.org.uk"
433          "ijackson@nyx.cs.du.edu" "ijackson@gnu.ai.mit.edu"))
434       vm-primary-inbox (concat vm-folder-directory "INBOX")
435
436       vm-uninteresting-senders "ian"
437       vm-reply-ignored-addresses
438       (make-regexps-ignore-non-address
439        '("ijackson@chiark.chu.cam.ac.uk" "ijackson"
440          "iwj10@thor.cam.ac.uk" "iwj10@hermes.cam.ac.uk" "iwj10@cl.cam.ac.uk"
441          "iwj10@cam.ac.uk" "Ian.Jackson@cl.cam.ac.uk"))
442       mail-archive-file-name "~/mail/Outbound"
443
444
445       vm-startup-with-summary t
446
447       user-mail-address "ijackson@chiark.greenend.org.uk"
448
449
450       vm-startup-with-summary nil
451       vm-summary-format "%3n %a %2d %3m  %-19.19F  %s\n"
452       mail-archive-file-name "~/mail/Outbound"
453       vm-mime-8bit-text-transfer-encoding '8bit)
454 ;
455 (add-hook 'vm-mode-hook
456           '(lambda ()
457              (local-set-key "Q" 'vm-quit)
458              (local-set-key "q" "###Q")))
459 ;(add-hook 'mail-mode-hook
460 ;          '(lambda ()
461 ;             (if (and (boundp 'folder-buffer)
462 ;                      folder-buffer
463 ;                      (string= (buffer-file-name folder-buffer)
464 ;                               (file-truename vm-sysadmin-inbox)))
465 ;                 (progn
466 ;                   (make-local-variable 'vm-mail-header-from)
467 ;                   (setq vm-mail-header-from
468 ;                         "sysadmin@chiark.greenend.org.uk (Ian Jackson)")
469 ;                   (make-local-variable 'mail-archive-file-name)
470 ;                   (setq mail-archive-file-name
471 ;                         "~/mail/SOutbound")))))
472 ;
473 ;;(defun vmi ()
474 ;  (interactive)
475 ;  (vm "/u/ijackson/mail/INBOX"))
476 ;;
477 ;(defun vms ()
478 ;  (interactive)
479 ;  (vm vm-sinbin-inbox))
480 ;
481 (defun make-session ()
482   "Makes this emacs hard to kill by requiring ^X^Cy to kill it
483 instead of just ^X^C."
484   (interactive)
485   (global-unset-key "\18\ 3")
486   (global-set-key "\18\ 3y" 'save-buffers-kill-emacs))
487 ;
488 ; Fix problems with M-| setting window title of emacs' parent xterm
489 ;(defun envdelete-term-termcap-windowid (list)
490 ;  (let ((l list))
491 ;    (mapcar '(lambda (x)
492 ;               (if x (delq x l)))
493 ;            (mapcar '(lambda (x)
494 ;                       (if (or (string-match "^TERM=" x)
495 ;                               (string-match "^TERMCAP=" x)
496 ;                               (string-match "^WINDOWID=" x))
497 ;                           x
498 ;                         nil))
499 ;                    l))
500 ;    l))
501 ;(setq process-environment
502 ;      (envdelete-term-termcap-windowid process-environment))
503 ;
504 (defun add-insertion-keys (table)
505   "Adds keybindings according to TABLE.  Each element of
506 TABLE should be a four-element list.
507
508 BINDING should be the key to bind; FUNCTION will be the name of the
509 function defined to do the insertion; DESCRIPTION will be inserted
510 into \"Inserts ... .\", and used as the descriptive string for the
511 generated function; STRING is the string which will actually be
512 inserted into the buffer when the keystroke is pressed."
513   (while table
514     (let* ((head (car table))
515            (key (car head))
516            (func (nth 1 head))
517            (desc (nth 2 head))
518            (string (nth 3 head)))
519       (defalias func
520         (list
521          'lambda () 
522          (concat "Inserts " desc ".")
523          '(interactive)
524          (list 'insert string)))
525       (funcall 'local-set-key key func))
526     (setq table (cdr table))))
527
528 (defun ian-sgml-setup ()
529   (interactive)
530   (add-insertion-keys
531    '(("\ 3\r" sgml-insert-new-para "new paragraph markup" "\n<p>\n")
532      ("\ 3\14" sgml-insert-tt-emph "tt emph markup" "<tt/")
533      ("\ 3\10" sgml-insert-prgn-emph "prgn emph markup" "<prgn/")
534      ("\ 3\ 5" sgml-insert-em-emph "em emfh markup" "<em/")
535      ("\ 3\16" sgml-insert-var-empfh "var emph markup" "<var/"))))
536 (setq sgml-local-catalogs '("/jura:/usr/lib/debiandoc-sgml/sgml/catalog"))
537   
538 (add-hook 'sgml-mode-hook 'ian-sgml-setup)
539 ;
540 (defvar cite-string "> " "String to insert when citing")
541 ;
542 (defun cite-region (start end)
543   "Quote each line in the region with an angle-bracket and space.
544
545 The citation string is taken from cite-string."
546   (interactive "r")
547   (save-excursion
548     (save-restriction
549       (narrow-to-region start end)
550       (goto-char (point-min))
551       (insert cite-string)
552       (while
553           (and
554            (= (forward-line) 0)
555            (> (point-max) (point)))
556         (insert cite-string)))))
557 ;
558 ;
559
560 (winner-mode t)
561
562 (global-magit-file-mode)
563
564 (magit-wip-after-save-mode)
565 (magit-wip-after-apply-mode)
566 (magit-wip-before-change-mode)
567 (setq magit-no-confirm
568       (append magit-no-confirm '(safe-with-wip)))
569
570 (setq vc-handled-backends (delq 'Git vc-handled-backends))
571
572 ;; (defun hack-dir-local-variables ()
573 ;;   "Read per-directory local variables for the current buffer.
574 ;; Store the directory-local variables in `dir-local-variables-alist'
575 ;; and `file-local-variables-alist', without applying them."
576 ;;   (when (and enable-local-variables
577 ;;           (buffer-file-name))
578 ;;     ;; Find the variables file.
579 ;;     (let ((variables-file (dir-locals-find-file (buffer-file-name)))
580 ;;        (class nil)
581 ;;        (dir-name nil))
582 ;;       (cond
583 ;;        ((stringp variables-file)
584 ;;      (setq dir-name (file-name-directory (buffer-file-name)))
585 ;;      (setq class (dir-locals-read-from-file variables-file)))
586 ;;        ((consp variables-file)
587 ;;      (setq dir-name (nth 0 variables-file))
588 ;;      (setq class (nth 1 variables-file))))
589 ;;       (when class
590 ;;      (let ((variables
591 ;;             (dir-locals-collect-variables
592 ;;              (dir-locals-get-class-variables class) dir-name nil)))
593 ;;        (when variables
594 ;;          (dolist (elt variables)
595 ;;            (unless (memq (car elt) '(eval mode))
596 ;;              (setq dir-local-variables-alist
597 ;;                    (assq-delete-all (car elt) dir-local-variables-alist)))
598 ;;            (push elt dir-local-variables-alist))
599 ;;          (hack-local-variables-filter variables dir-name)))))))
600
601 (delete ".git/" completion-ignored-extensions)
602
603 ; End of this file.