diff options
| author | Juri Linkov | 2019-10-31 01:11:05 +0200 |
|---|---|---|
| committer | Juri Linkov | 2019-10-31 01:11:05 +0200 |
| commit | 390dd2cff9d69b3527229fa5752e42a410d06508 (patch) | |
| tree | 35e04cc923f0c9183a56faab28103b1c23d4ec63 | |
| parent | f2a72bb8ed29223dd1197492d4270c171db5e443 (diff) | |
| download | emacs-390dd2cff9d69b3527229fa5752e42a410d06508.tar.gz emacs-390dd2cff9d69b3527229fa5752e42a410d06508.zip | |
* lisp/tab-bar.el (tab-bar-select-tab): Use set-frame-parameter.
(tab-bar-list-noselect, tab-bar-list-mode): Rearrange buffer-read-only.
| -rw-r--r-- | lisp/tab-bar.el | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index c9829e94ff4..ef58e9060b4 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -538,13 +538,12 @@ to the numeric argument. ARG counts from 1." | |||
| 538 | ;; window-configuration restores point to global point | 538 | ;; window-configuration restores point to global point |
| 539 | ;; in this dired buffer, not to its window point, | 539 | ;; in this dired buffer, not to its window point, |
| 540 | ;; but this is slightly better than 1. | 540 | ;; but this is slightly better than 1. |
| 541 | ;; Maybe better to save dired-filename in each window? | ||
| 541 | (not (eq 1 (marker-position wc-point)))) | 542 | (not (eq 1 (marker-position wc-point)))) |
| 542 | (goto-char wc-point)) | 543 | (goto-char wc-point)) |
| 543 | 544 | ||
| 544 | (when wc-bl (modify-frame-parameters | 545 | (when wc-bl (set-frame-parameter nil 'buffer-list wc-bl)) |
| 545 | nil (list (cons 'buffer-list wc-bl)))) | 546 | (when wc-bbl (set-frame-parameter nil 'buried-buffer-list wc-bbl)) |
| 546 | (when wc-bbl (modify-frame-parameters | ||
| 547 | nil (list (cons 'buried-buffer-list wc-bbl)))) | ||
| 548 | 547 | ||
| 549 | (puthash (selected-frame) | 548 | (puthash (selected-frame) |
| 550 | (and (window-configuration-p (cdr (assq 'wc (car wc-history-back)))) | 549 | (and (window-configuration-p (cdr (assq 'wc (car wc-history-back)))) |
| @@ -562,10 +561,8 @@ to the numeric argument. ARG counts from 1." | |||
| 562 | (mapcar #'get-buffer (cdr (assq 'ws-bl to-tab))))) | 561 | (mapcar #'get-buffer (cdr (assq 'ws-bl to-tab))))) |
| 563 | (ws-bbl (seq-filter #'buffer-live-p | 562 | (ws-bbl (seq-filter #'buffer-live-p |
| 564 | (mapcar #'get-buffer (cdr (assq 'ws-bbl to-tab)))))) | 563 | (mapcar #'get-buffer (cdr (assq 'ws-bbl to-tab)))))) |
| 565 | (when ws-bl (modify-frame-parameters | 564 | (when ws-bl (set-frame-parameter nil 'buffer-list ws-bl)) |
| 566 | nil (list (cons 'buffer-list ws-bl)))) | 565 | (when ws-bbl (set-frame-parameter nil 'buried-buffer-list ws-bbl))))) |
| 567 | (when ws-bbl (modify-frame-parameters | ||
| 568 | nil (list (cons 'buried-buffer-list ws-bbl))))))) | ||
| 569 | 566 | ||
| 570 | (setq tab-bar-history-omit t) | 567 | (setq tab-bar-history-omit t) |
| 571 | 568 | ||
| @@ -1066,9 +1063,9 @@ For more information, see the function `tab-bar-list'." | |||
| 1066 | (with-current-buffer (get-buffer-create | 1063 | (with-current-buffer (get-buffer-create |
| 1067 | (format " *Tabs*<%s>" (or (frame-parameter nil 'window-id) | 1064 | (format " *Tabs*<%s>" (or (frame-parameter nil 'window-id) |
| 1068 | (frame-parameter nil 'name)))) | 1065 | (frame-parameter nil 'name)))) |
| 1066 | (setq buffer-read-only nil) | ||
| 1069 | (erase-buffer) | 1067 | (erase-buffer) |
| 1070 | (tab-bar-list-mode) | 1068 | (tab-bar-list-mode) |
| 1071 | (setq buffer-read-only nil) | ||
| 1072 | ;; Vertical alignment to the center of the frame | 1069 | ;; Vertical alignment to the center of the frame |
| 1073 | (insert-char ?\n (/ (- (frame-height) (length tabs) 1) 2)) | 1070 | (insert-char ?\n (/ (- (frame-height) (length tabs) 1) 2)) |
| 1074 | ;; Horizontal alignment to the center of the frame | 1071 | ;; Horizontal alignment to the center of the frame |
| @@ -1088,6 +1085,7 @@ For more information, see the function `tab-bar-list'." | |||
| 1088 | (tab-bar-list-next-line)) | 1085 | (tab-bar-list-next-line)) |
| 1089 | (move-to-column tab-bar-list-column) | 1086 | (move-to-column tab-bar-list-column) |
| 1090 | (set-buffer-modified-p nil) | 1087 | (set-buffer-modified-p nil) |
| 1088 | (setq buffer-read-only t) | ||
| 1091 | (current-buffer)))) | 1089 | (current-buffer)))) |
| 1092 | 1090 | ||
| 1093 | (defvar tab-bar-list-column 3) | 1091 | (defvar tab-bar-list-column 3) |
| @@ -1127,8 +1125,7 @@ Letters do not insert themselves; instead, they are commands. | |||
| 1127 | \\[tab-bar-list-unmark] -- remove all kinds of marks from current line. | 1125 | \\[tab-bar-list-unmark] -- remove all kinds of marks from current line. |
| 1128 | With prefix argument, also move up one line. | 1126 | With prefix argument, also move up one line. |
| 1129 | \\[tab-bar-list-backup-unmark] -- back up a line and remove marks." | 1127 | \\[tab-bar-list-backup-unmark] -- back up a line and remove marks." |
| 1130 | (setq truncate-lines t) | 1128 | (setq truncate-lines t)) |
| 1131 | (setq buffer-read-only t)) | ||
| 1132 | 1129 | ||
| 1133 | (defun tab-bar-list-current-tab (error-if-non-existent-p) | 1130 | (defun tab-bar-list-current-tab (error-if-non-existent-p) |
| 1134 | "Return window configuration described by this line of the list." | 1131 | "Return window configuration described by this line of the list." |