diff options
| author | Juri Linkov | 2010-06-05 22:02:31 +0300 |
|---|---|---|
| committer | Juri Linkov | 2010-06-05 22:02:31 +0300 |
| commit | 157eaca5524d5931c71d84905ad41bd4327d49e1 (patch) | |
| tree | 8cad0adba53be7c8a5e2736f75c326235bd75c1f | |
| parent | 99e38059b2c497e766125060845c45f4a3b92c16 (diff) | |
| download | emacs-x-tabs.tar.gz emacs-x-tabs.zip | |
Save and restore tab-local buffer-lists in frame-local buffer-lists.x-tabs
| -rw-r--r-- | lisp/tab.el | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/lisp/tab.el b/lisp/tab.el index bf2fdf076a1..c3f8c2772a8 100644 --- a/lisp/tab.el +++ b/lisp/tab.el | |||
| @@ -99,8 +99,14 @@ Return a newly created frame displaying the current buffer." | |||
| 99 | ;; set-window-configuration does not restore the value | 99 | ;; set-window-configuration does not restore the value |
| 100 | ;; of point in the current buffer, so record that separately. | 100 | ;; of point in the current buffer, so record that separately. |
| 101 | (point-marker) | 101 | (point-marker) |
| 102 | nil ;; tab-history-back | 102 | nil ;; tab-history-back |
| 103 | nil ;; tab-history-forward | 103 | nil ;; tab-history-forward |
| 104 | (delq nil (mapcar | ||
| 105 | (lambda (b) (and (buffer-live-p b) b)) | ||
| 106 | (frame-parameter frame 'buffer-list))) | ||
| 107 | (delq nil (mapcar | ||
| 108 | (lambda (b) (and (buffer-live-p b) b)) | ||
| 109 | (frame-parameter frame 'buried-buffer-list))) | ||
| 104 | ))) | 110 | ))) |
| 105 | ;; FIXME: use `AFTER'. When nil, use default of custom `tab-after'. | 111 | ;; FIXME: use `AFTER'. When nil, use default of custom `tab-after'. |
| 106 | (modify-frame-parameters | 112 | (modify-frame-parameters |
| @@ -149,10 +155,16 @@ This function returns TAB, or nil if TAB has been deleted." | |||
| 149 | (tab-name (assq 'name (nth 1 tab-param))) | 155 | (tab-name (assq 'name (nth 1 tab-param))) |
| 150 | (tab-new-param (assq tab tab-list))) | 156 | (tab-new-param (assq tab tab-list))) |
| 151 | (when tab-param | 157 | (when tab-param |
| 152 | (setcar (cddr tab-param) (current-window-configuration frame)) | 158 | (setcar (nthcdr 2 tab-param) (current-window-configuration frame)) |
| 153 | (setcar (cdr (cddr tab-param)) (point-marker)) | 159 | (setcar (nthcdr 3 tab-param) (point-marker)) |
| 154 | (setcar (cddr (cddr tab-param)) tab-history-back) | 160 | (setcar (nthcdr 4 tab-param) tab-history-back) |
| 155 | (setcar (cdr (cddr (cddr tab-param))) tab-history-forward) | 161 | (setcar (nthcdr 5 tab-param) tab-history-forward) |
| 162 | (setcar (nthcdr 6 tab-param) | ||
| 163 | (delq nil (mapcar (lambda (b) (and (buffer-live-p b) b)) | ||
| 164 | (frame-parameter frame 'buffer-list)))) | ||
| 165 | (setcar (nthcdr 7 tab-param) | ||
| 166 | (delq nil (mapcar (lambda (b) (and (buffer-live-p b) b)) | ||
| 167 | (frame-parameter frame 'buried-buffer-list)))) | ||
| 156 | (if tab-name (setcdr tab-name (tab-name frame)))) | 168 | (if tab-name (setcdr tab-name (tab-name frame)))) |
| 157 | (modify-frame-parameters frame (list (cons 'selected-tab tab))) | 169 | (modify-frame-parameters frame (list (cons 'selected-tab tab))) |
| 158 | (set-window-configuration (nth 2 tab-new-param)) | 170 | (set-window-configuration (nth 2 tab-new-param)) |
| @@ -163,6 +175,14 @@ This function returns TAB, or nil if TAB has been deleted." | |||
| 163 | (goto-char (nth 3 tab-new-param))) | 175 | (goto-char (nth 3 tab-new-param))) |
| 164 | (setq tab-history-back (nth 4 tab-new-param)) | 176 | (setq tab-history-back (nth 4 tab-new-param)) |
| 165 | (setq tab-history-forward (nth 5 tab-new-param)) | 177 | (setq tab-history-forward (nth 5 tab-new-param)) |
| 178 | (modify-frame-parameters | ||
| 179 | frame (list (cons 'buffer-list | ||
| 180 | (delq nil (mapcar (lambda (b) (and (buffer-live-p b) b)) | ||
| 181 | (nth 6 tab-new-param)))))) | ||
| 182 | (modify-frame-parameters | ||
| 183 | frame (list (cons 'buried-buffer-list | ||
| 184 | (delq nil (mapcar (lambda (b) (and (buffer-live-p b) b)) | ||
| 185 | (nth 7 tab-new-param)))))) | ||
| 166 | (tab-bar-setup frame))) | 186 | (tab-bar-setup frame))) |
| 167 | 187 | ||
| 168 | (defun delete-tab (&optional tab frame) | 188 | (defun delete-tab (&optional tab frame) |