;; evaluate this file, sexp after sexp, and follow the comments. ;; set a minimal environment (progn (custom-set-faces '(current-tab-face ((t ( :inherit 'default-face :foreground "lightblue" :bold t :underline t)))) '(odd-tab-face ((t ( :background "red" :foreground "white" )))) '(even-tab-face ((t ( :background "green" :foreground "black"))))) (set-frame-parameter (selected-frame) 'tab-bar-lines 4) (set-frame-parameter (selected-frame) 'menu-bar-lines 0)) ;; this is a definition of a tab as a window configuration (defun make-wc-tab (parms) ;; save curent win config (setq sym (make-symbol "winconfig")) (set sym (current-window-configuration)) ;; make a tab that keeps a window configuration. When it is created, ;; it memories the current win config. When it is activated, it ;; restores the memorized win config (make-terminal-frame (list '(tab . t) '(tab:name . "WinC") '(tab:activate . (lambda () (set-window-configuration (eval (cdr (assoc 'tab:env (frame-parameters) ) ) ) ) ) ) ;; save the current win config into the tab environment (cons 'tab:env sym) ) ) ) ;; make a first tab keeping current win config (make-wc-tab nil) ;; alter the window configuration ((lambda nil (split-window-vertically))) ;; make a second tab keeping current win config (make-wc-tab nil) ;; alter the window configuration ((lambda nil (split-window-horizontally))) ;; make a third tab keeping current win config (make-wc-tab nil) ;; keep only the current window (delete-other-windows) ;; now activate the tabs that keep the memorized win config. this ;; function disovered a bug in window configuration . LOL. If you ;; change the tab-bar-lines or menu-bar-lines after creating a tab ;; and before activatin it here, emacs crashes. LOL. ;; activate the second (set-frame-parameter (selected-frame) 'current-tab 1) ;; the third (set-frame-parameter (selected-frame) 'current-tab 2) ;; the first again (set-frame-parameter (selected-frame) 'current-tab 0) ;; dump frame params (progn (setq eval-expression-print-length 5000 eval-expression-print-level 5000 print-level 5000 ) (frame-parameters) ) ;; that's all for now.