dot/emacs: Arrange that view-mode kills the buffer on exit by default.
[profile] / dot / emacs
index 6cf5b6e..2979786 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
     (apply #'set-input-mode
           (nconc (list (nth 0 im) (nth 1 im) 0) (nthcdr 3 im)))))
 
+;; Some unpleasant terminal hackery.  Screen prefixes the current terminal
+;; name with `screen.', and Emacs is too dim to split the name at the `.'.
+;; Help it out.
+
+(defun terminal-init-screen.xterm ()
+  (tty-run-terminal-initialization (selected-frame) "screen"))
+(defun terminal-init-screen.putty ()
+  (tty-run-terminal-initialization (selected-frame) "screen"))
+
 ;; Don't disable any commands.
 
 (mapatoms #'(lambda (sym) (put sym 'disabled nil)))
       ido-default-file-method 'selected-window
       ido-default-buffer-method 'selected-window)
 (setq ido-enable-flex-matching t
+      ido-everywhere t
       ido-confirm-unique-completion t
-      ido-use-filename-at-point nil)
+      ido-use-filename-at-point nil
+      ido-auto-merge-work-directories-length -1)
 (setq dired-deletion-confirmer         ;Make deletion easier in dired
       (symbol-function 'y-or-n-p)
       dired-listing-switches "-alF"    ;Do `ls -F' things in dired windows
 (setq read-quoted-char-radix 16)       ;C-q HEX-STUFF [RET]
 (setq case-fold-file-names nil)                ;Don't translate file names (grr...)
 (setq scroll-step 5)                   ;Don't scroll too much at a time
+(setq blink-cursor-blinks 0)           ;Keep blinking the cursor
 (setq-default fill-column mdw-text-width) ;I use rather narrow windows
 (setq-default comment-column 40)       ;Set a standard comment column
 (setq-default truncate-partial-width-windows nil
              truncate-lines t)
 (setq default-indicate-empty-lines t)
 (setq view-read-only t)
+(setq-default view-exit-action #'kill-buffer)
 (setq whitespace-style '(trailing empty indentation face lines-tail
                         space-before-tab space-after-tab)
       whitespace-line-column mdw-text-width)
 (setq windmove-wrap-around t)
 (trap (require 'ido) (ido-mode 1)
       (require 'ido-ubiquitous) (ido-ubiquitous-mode 1)
+      (setq ido-cr+-max-items nil
+           ido-ubiquitous-command-overrides
+           (append ido-ubiquitous-command-overrides
+                   `((enable-old regexp ,(concat "\\`"
+                                                 "gtags-find-"
+                                                 "\\("    "tag"
+                                                       "\\|file"
+                                                       "\\|rtag"
+                                                       "\\|symbol"
+                                                 "\\)"
+                                                 "\\(" "\\|-other-window"
+                                                 "\\)"
+                                                 "\\'")))))
       (setq magit-completing-read-function 'magit-ido-completing-read)
       (require 'smex) (smex-initialize) (global-set-key [?\M-x] 'smex))
+
 (progn
   (global-set-key [?\C-c ?\M-x] 'execute-extended-command)
   (global-set-key [?\e ?\e] 'mdw-wrong)