(setq gc-cons-threshold 4000000)
(setq garbage-collection-messages t)
(setq enable-local-variables t)
(fset 'yes-or-no-p 'y-or-n-p)
(setq next-line-add-newlines nil)
(setq vc-command-messages t)
(setq baud-rate 100000000)
(when (>= emacs-major-version 21)
(setq initial-frame-alist '((tool-bar-lines . 0)))
(setq tool-bar-button-relief 1)
(setq tool-bar-button-margin 1)
(set-face-attribute 'tool-bar t :box nil)
(setq-default cursor-in-non-selected-windows nil)
(blink-cursor-mode 0)
(set-face-background 'fringe "#d5d2de"))
(transient-mark-mode 1)
(setq search-highlight t)
(setq inhibit-startup-message t)
(setq visible-bell t)
(global-font-lock-mode 1)
(setq font-lock-maximum-decoration t)
(line-number-mode 1)
(column-number-mode 1)
(autoload 'blank-mode "blank-mode" "Toggle blank visualization." t)
(if window-system
(progn
(if (> emacs-major-version 19)
(set-scroll-bar-mode 'right))
(set-cursor-color "blue")
(set-background-color "#d5d2de")
(set-mouse-color "red")))
(unless window-system
(menu-bar-mode 0))
(global-unset-key [menu-bar buffer ])
(defun make-backup-file-name (file-name)
"Create the non-numeric backup file name for `file-name'."
(if (file-exists-p "~/.emacs-backup")
(concat (expand-file-name "~/.emacs-backup/")
(dired-replace-in-string "/" "|" file-name))
(concat file-name "~")))
(defun ecm-backup-enable-predicate (filename)
(and (not (string= "/tmp/" (substring filename 0 5)))
(not (string-match "/Mail/" filename))
(not (string-match "/News/" filename))))
(setq backup-enable-predicate 'ecm-backup-enable-predicate)
(defun site-lisp-news ()
"show site-lisp news"
(interactive)
(find-file "/usr/local/share/emacs/site-lisp/NEWS"))
(setq dabbrev-case-replace nil)
(setq dabbrev-abbrev-char-regexp nil)
(setq dabbrev-case-fold-search nil)
(require 'find-file)
(setq ff-always-try-to-create nil)
(require 'ffap)
(ffap-bindings)
(remove-hook 'gnus-summary-mode-hook 'ffap-gnus-hook)
(auto-compression-mode 1)
(global-set-key (kbd "RET") 'newline-and-indent)
(define-key text-mode-map (kbd "RET") 'newline)
(defun zonix-text-mode-hook ()
(set-fill-column 70)
(auto-fill-mode 1))
(add-hook 'text-mode-hook 'zonix-text-mode-hook)
(add-hook 'html-mode-hook 'zonix-text-mode-hook)
(defun zonix-insert-period ()
(interactive)
(insert ". "))
(defun zonix-insert-exclamation-mark ()
(interactive)
(insert "! "))
(defun zonix-insert-question-mark ()
(interactive)
(insert "? "))
(require 'iso-insert)
(when (< emacs-major-version 20)
(standard-display-european 1)
(require 'iso-syntax))
(when (= emacs-major-version 20)
(set-language-environment "Latin-1")
(setq unibyte-display-via-language-environment t))
(when (= emacs-major-version 21)
(set-language-environment "Latin-1")
(define-coding-system-alias 'windows-1252 'iso-8859-1)
(unify-8859-on-encoding-mode t)
(unify-8859-on-decoding-mode t)
)
(when (>= emacs-major-version 22)
(set-language-environment "Latin-1")
(unify-8859-on-encoding-mode t)
(unify-8859-on-decoding-mode t)
)
(unless window-system
(progn
(set-terminal-coding-system 'iso-8859-1)
(set-input-mode (car (current-input-mode))
(nth 1 (current-input-mode)) 0)))
(setq whois-server-name "whois.thur.de")
(setq whois-guess-server nil)
(setq-default start-command "")
(setq dm-term-command "xterm")
(defun dischi/shell (command &optional output-buffer)
"Execute string COMMAND in inferior shell. Uses Variable term-command
to show the Program. See shell-command; provide file-name completion
as well."
(interactive (list
(read-from-minibuffer
"Shell-Command: " start-command
cabo:shell-minibuffer-local-map
nil 'shell-command-history)
current-prefix-arg))
(setq start-command command)
(setq mycommand
(concat
(concat
(concat
(concat dm-term-command " -T \"output for ") command)
"\" -e sh -c '" command)
" ; echo ; echo Press ENTER to return to emacs ; read'"))
(shell-command mycommand output-buffer))
(defun cabo:shell-command (command &optional output-buffer)
"Execute string COMMAND in inferior shell; display output, if any.
See shell-command; provide file-name completion as well."
(interactive (list (read-from-minibuffer "Shell command: " nil
cabo:shell-minibuffer-local-map
nil 'shell-command-history)
current-prefix-arg))
(shell-command command output-buffer))
(defun cabo:shell-command-on-region (start end command
&optional output-buffer replace)
"Execute string COMMAND in inferior shell with region as input.
See shell-command-on-region; provide file-name completion as well."
(interactive (let ((string
(read-from-minibuffer "Shell command on region: " nil
cabo:shell-minibuffer-local-map
nil 'shell-command-history)))
(list (region-beginning) (region-end)
string
current-prefix-arg
current-prefix-arg)))
(shell-command-on-region start end command output-buffer replace))
(defun cabo:dired-smart-shell-command (cmd &optional insert)
"Like function `shell-command', but in the current Tree Dired directory."
(interactive (list (read-from-minibuffer "Shell command: " nil
cabo:shell-minibuffer-local-map
nil 'shell-command-history)
current-prefix-arg))
(let ((default-directory (default-directory)))
(cabo:shell-command cmd insert)))
(defun dischi:shell-command-insert (command)
(interactive
(let ((string (read-from-minibuffer "Shell command: " nil
cabo:shell-minibuffer-local-map
nil 'shell-command-history)))
(list string)))
(shell-command command 1 ))
(defun dischi:shell-command-on-region-replace (command)
(interactive
(let ((string (read-from-minibuffer "Shell command on region: " nil
cabo:shell-minibuffer-local-map
nil 'shell-command-history)))
(list string)))
(shell-command-on-region (region-beginning) (region-end) command 1 1))
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
(defun global-change-directory (from to)
"Change directory of all buffers with default-directory FROM to TO."
(interactive "DGlobally change directory from: \nDTo: ")
(let ((bufs (buffer-list))
(from (expand-file-name from)))
(while bufs
(with-current-buffer (car bufs)
(when (equal from (expand-file-name default-directory))
(setq default-directory to)))
(setq bufs (cdr bufs)))))
(defun kai-turn-on-viper (dummy)
(setq viper-mode t)
(require 'viper))
(add-to-list 'command-switch-alist '("-vi" . kai-turn-on-viper))