Mar 022011
 
 
;; default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" (system-name)))
 
;; default to unified diffs
(setq diff-switches "-u")
 
(setq scroll-step 1)
(mouse-wheel-mode t)
 
(setq mouse-wheel-progressive-speed nil)
 
(setq scroll-margin 1
scroll-conservatively 0
scroll-up-aggressively 0.01
scroll-down-aggressively 0.01)
 
(global-set-key '[(f12)]          'call-last-kbd-macro)
(global-set-key '[(shift f12)]    'toggle-kbd-macro-recording-on)
 
    (defun toggle-kbd-macro-recording-on ()
      "One-key keyboard macros: turn recording on."
      (interactive)
      (define-key
        global-map
        (events-to-keys (this-command-keys) t)
        'toggle-kbd-macro-recording-off)
      (start-kbd-macro nil))
 
    (defun toggle-kbd-macro-recording-off ()
      "One-key keyboard macros: turn recording off."
      (interactive)
      (define-key
        global-map
        (events-to-keys (this-command-keys) t)
        'toggle-kbd-macro-recording-on)
      (end-kbd-macro))
 
;; turn on font-lock mode
 (when (fboundp 'global-font-lock-mode)
  (global-font-lock-mode t))
 
;; set TAB width
(setq default-tab-width 4)
 
; change TAB behaviour 
(defvar just-tab-keymap (make-sparse-keymap) "Keymap for just-tab-mode")
(define-minor-mode just-tab-mode
  "Just want the TAB key to be a TAB"
  :global t :lighter " TAB" :init-value 0 :keymap just-tab-keymap
  (define-key just-tab-keymap (kbd "TAB") 'indent-for-tab-command))

Links:
http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/