;;; I like my default width set at 4
(setq default-tab-width 4)
;;; Allow toggling tab-width between 2, 4 and 8
(defvar my-tab-width default-tab-width)
(defun toggle-tab-width ()
  "Toggle the tab width between 2, 4 and 8."
  (interactive)
  (cond
   ((= my-tab-width 2) (setq my-tab-width 4))
   ((= my-tab-width 4) (setq my-tab-width 8))
   ((= my-tab-width 8) (setq my-tab-width 2)))
  (setq tab-width my-tab-width)
  (redraw-display))

(global-unset-key [f1])
(global-set-key [f1] 'toggle-tab-width)