Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oxalorg/58efd1a9d16baf98d31e81fed09c487c to your computer and use it in GitHub Desktop.
Save oxalorg/58efd1a9d16baf98d31e81fed09c487c to your computer and use it in GitHub Desktop.
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)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment