Stick/Lock buffer to window, compatible with tabbar.el. Emacs
;; http://lists.gnu.org/archive/html/help-gnu-emacs/2007-05/msg00975.html
(defvar sticky-buffer-previous-header-line-format)
(define-minor-mode sticky-buffer-mode
"Make the current window always display this buffer."
nil " sticky" nil
(if sticky-buffer-mode
(progn
(set (make-local-variable 'sticky-buffer-previous-header-line-format)
header-line-format)
(set-window-dedicated-p (selected-window) sticky-buffer-mode))
(set-window-dedicated-p (selected-window) sticky-buffer-mode)
(setq header-line-format sticky-buffer-previous-header-line-format)))