(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(c-basic-offset 4)
 '(c-label-minimum-indentation 4)
 '(c-syntactic-indentation t)
 '(c-tab-always-indent nil)
 '(calendar-week-start-day 1)
 '(case-fold-search t)
 '(column-number-mode t)
 '(current-language-environment "UTF-8")
 '(cursor-in-non-selected-windows nil)
 '(default-input-method "rfc1345")
 '(ecb-options-version "2.32")
 '(global-font-lock-mode t nil (font-lock))
 '(menu-bar-mode nil nil (menu-bar))
 '(org-hide-leading-stars t)
 '(org-todo-keywords (quote ("TODO" "DONE")))
 '(scroll-bar-mode nil nil (scroll-bar))
 '(show-paren-mode t)
 '(standart-indent 2)
 '(tab-width 4)
 '(tool-bar-mode nil nil (tool-bar))
 '(transient-mark-mode t))

;; Supress startup message
(setq inhibit-startup-message t)

;; Conservatively scrolling
(setq scroll-conservatively 50)
(setq scroll-margin 0)

;; c-style code offsets
(c-set-offset 'substatement-open 0)
(c-set-offset 'case-label 0)

;; C++ and C mode...
 (defun my-c++-mode-hook ()
  (setq tab-width 4)
  (setq c++-auto-hungry-initial-state 'none)
  (setq c++-delete-function 'backward-delete-char)
  (setq c++-tab-always-indent t)
  (setq c-indent-level 2)
  (setq c-continued-statement-offset 2)
  (setq c++-empty-arglist-indent 2))
   
(defun my-c-mode-hook ()
  (setq tab-width 4)
  (setq c-auto-hungry-initial-state 'none)
  (setq c-delete-function 'backward-delete-char)
  (setq c-tab-always-indent t)
  (setq c-indent-level 2) ;; BSD-ish indentation style
  (setq c-continued-statement-offset 2)
  (setq c-brace-offset -2)
  (setq c-argdecl-indent 0)
  (setq c-label-offset -2))

(prefer-coding-system 'utf-8)

(defun my-ret-hook()
  "Make new lined indented"
  (local-set-key (kbd "RET") 'newline-and-indent))

(add-hook 'c++-mode-hook 'my-ret-hook)
(add-hook 'c-mode-hook 'my-ret-hook)
(add-hook 'scheme-mode-hook 'my-ret-hook)
(add-hook 'python-mode-hook 'my-ret-hook)
(add-hook 'latex-mode-hook 'my-ret-hook)

;; Enable X clipboard
(setq x-select-enable-clipboard t)

;; I hate tabs!
(setq-default indent-tabs-mode nil)

;; COMMON LISP
(add-to-list 'load-path "/home/dm/.emacs.d/slime")
(add-to-list 'load-path "/home/dm/.emacs.d/emacs-w3m")
(setq inferior-lisp-program "/usr/pkg/bin/sbcl")
(require 'slime)
(slime-setup '(slime-repl))

;; Smalltalk mode
(add-to-list 'load-path "/home/dm/.emacs.d/smalltalk")
(require 'smalltalk-mode)
(add-to-list 'auto-mode-alist '("\\.st$" . smalltalk-mode))

;; C# (I hate it!)
(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
(setq auto-mode-alist
      (append '(("\\.cs$" . csharp-mode)) auto-mode-alist))

;; emacs-jabber
(add-to-list 'load-path "/home/dm/.emacs.d")
(add-to-list 'load-path "/home/dm/.emacs.d/emacs-jabber-0.8.0")
(require 'jabber-autoloads)


;; emms
(add-to-list 'load-path "/home/dm/.emacs.d/emms/lisp")

(require 'emms-setup)
(require 'emms-info-libtag)
(emms-devel)
(emms-default-players)
(push 'emms-player-mplayer emms-player-list)
(push 'emms-player-mplayer-playlist emms-player-list)

(setq
 emms-info-asynchronously t
 later-do-interval 0.0001
 emms-info-functions '(emms-info-libtag)
 emms-source-file-default-directory "~/music/"
 emms-mode-line-format " %s "
 emms-show-format "Now playing: %s")

(global-set-key (kbd "<kp-subtract>") 'emms-previous)
(global-set-key (kbd "<kp-add>") 'emms-next)
(global-set-key (kbd "<insert>") 'de-add-dir)
(global-set-key (kbd "<kp-insert>") 'de-toggle-playing)
(global-set-key (kbd "<f2>") 'emms-smart-browse)
(global-set-key (kbd "<kp-right>") 'emms-seek-forward)
(global-set-key (kbd "<kp-left>") 'emms-seek-backward)

(define-key emms-playlist-mode-map (kbd "/") 'de-search)
(define-key emms-browser-mode-map (kbd "W W") 'emms-browser-lookup-multi)

(add-hook 'emms-playlist-selection-changed-hook 'de-focus-on-track)
(add-hook 'emms-player-started-hook 'emms-show)

;; set up a default cover
(setq emms-browser-default-covers
      (list "/home/dm/misc/cover_small.jpg" nil nil))

;; let compilation tracks be displayed together
(setq emms-browser-get-track-field-function
      'emms-browser-get-track-field-use-directory-name)

;; filters
(emms-browser-make-filter "2005" (emms-browser-filter-only-dir "~/Mp3s/2005"))
(emms-browser-make-filter "2000-2004" (emms-browser-filter-only-dir "~/Mp3s/2000-2004"))
(emms-browser-make-filter "90s" (emms-browser-filter-only-dir "~/Mp3s/90s"))
(emms-browser-make-filter "80s" (emms-browser-filter-only-dir "~/Mp3s/80s"))
(emms-browser-make-filter "70s" (emms-browser-filter-only-dir "~/Mp3s/70s"))
(emms-browser-make-filter "classical" (emms-browser-filter-only-dir "~/Mp3s/classical"))
(emms-browser-make-filter "mp3s" (emms-browser-filter-only-dir "~/Media/mp3s"))
(emms-browser-make-filter "pending" (emms-browser-filter-only-dir "~/Media/pending"))
(emms-browser-make-filter "not-played"
 (lambda (track) (not (funcall (emms-browser-filter-only-recent 365) track))))
(emms-browser-make-filter "last-3months" (emms-browser-filter-only-recent 90))
(emms-browser-make-filter "last-month" (emms-browser-filter-only-recent 30))
(emms-browser-make-filter "last-week" (emms-browser-filter-only-recent 7))
(emms-browser-make-filter
 "all"
 (lambda (track)
   (or
    (funcall (emms-browser-filter-only-type 'file) track)
    ;; ignore the pending directory
    (not (funcall
          (emms-browser-filter-only-dir "~/Media/pending") track)))))

(emms-browser-set-filter (assoc "all" emms-browser-filters))

(add-hook 'emms-browser-filter-changed-hook 'de-filter-changed)
(defun de-filter-changed ()
  (interactive)
  (if (string= emms-browser-current-filter-name "pending")
      (setq emms-browser-get-track-field-function
            'emms-browser-get-track-field-simple)
    (setq emms-browser-get-track-field-function
          'emms-browser-get-track-field-use-directory-name)))

;; recenter based on the current track
(defun de-focus-on-track ()
  (let ((w (get-buffer-window emms-playlist-buffer t)))
    (when w
      (with-selected-window w
        (emms-playlist-mode-center-current)
        (recenter '(4))))))

(defun de-toggle-playing ()
  (interactive)
  (if emms-player-playing-p
      (emms-pause)
    (emms-start)))

(defun de-add-dir ()
  (interactive)
  (call-interactively 'emms-add-directory-tree)
  (emms-playlist-mode-go))

(defun de-search ()
  (interactive)
  (goto-char (point-min))
  (call-interactively 'isearch-forward))

(defun emms-browser-lookup-multi ()
  (interactive)
  (emms-browser-lookup-wikipedia 'info-artist)
  (emms-browser-lookup-wikipedia 'info-album)
  (emms-browser-lookup-pitchfork 'info-artist))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(newsticker-default-face ((((class color) (background dark)) (:family "helvetica"))))
 '(newsticker-treeview-selection-face ((((class color) (background dark)) (:background "#bbbbff" :foreground "black"))))
 '(org-scheduled-previously ((((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))))
 '(org-special-keyword ((((class color) (min-colors 16) (background dark)) (:foreground "palegreen")))))

(setq org-log-done 'time)

(setq tramp-default-method "ssh")

Add a code snippet to your website: www.paste.org