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