diff options
| author | Po Lu | 2023-07-08 08:53:55 +0800 |
|---|---|---|
| committer | Po Lu | 2023-07-08 08:53:55 +0800 |
| commit | dcf0fc2c434e055338b025572c4d06fcd50ca5e2 (patch) | |
| tree | 3f910bb6ff19c40c2f60b4b98f664e46be3647af | |
| parent | e40dca8361dfa8aafbe17bfeb8ad06b6ba5230ad (diff) | |
| parent | 37101780243d083e8773c255242aa26614f22a14 (diff) | |
| download | emacs-dcf0fc2c434e055338b025572c4d06fcd50ca5e2.tar.gz emacs-dcf0fc2c434e055338b025572c4d06fcd50ca5e2.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 3 | ||||
| -rw-r--r-- | lisp/tab-bar.el | 21 |
2 files changed, 14 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 262c658e258..489a9724fc4 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1128,7 +1128,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." | |||
| 1128 | ;; we arguably should add it to b-c-noruntime-functions, | 1128 | ;; we arguably should add it to b-c-noruntime-functions, |
| 1129 | ;; but it's not clear it's worth the trouble | 1129 | ;; but it's not clear it's worth the trouble |
| 1130 | ;; trying to recognize that case. | 1130 | ;; trying to recognize that case. |
| 1131 | (unless (get f 'function-history) | 1131 | (unless (or (get f 'function-history) |
| 1132 | (assq f byte-compile-function-environment)) | ||
| 1132 | (push f byte-compile-noruntime-functions))))))))))))) | 1133 | (push f byte-compile-noruntime-functions))))))))))))) |
| 1133 | 1134 | ||
| 1134 | (defun byte-compile-eval-before-compile (form) | 1135 | (defun byte-compile-eval-before-compile (form) |
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 3180d19052f..044337260ce 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -693,13 +693,18 @@ from all windows in the window configuration." | |||
| 693 | 693 | ||
| 694 | (defun tab-bar-tab-name-current () | 694 | (defun tab-bar-tab-name-current () |
| 695 | "Generate tab name from the buffer of the selected window." | 695 | "Generate tab name from the buffer of the selected window." |
| 696 | (buffer-name (window-buffer (minibuffer-selected-window)))) | 696 | ;; `minibuffer-selected-window' loses its original window |
| 697 | ;; after switching to another tab while the minibuffer was active, | ||
| 698 | ;; so get the most recently used non-minibuffer window. | ||
| 699 | (buffer-name (window-buffer (or (minibuffer-selected-window) | ||
| 700 | (and (window-minibuffer-p) | ||
| 701 | (get-mru-window)))))) | ||
| 697 | 702 | ||
| 698 | (defun tab-bar-tab-name-current-with-count () | 703 | (defun tab-bar-tab-name-current-with-count () |
| 699 | "Generate tab name from the buffer of the selected window. | 704 | "Generate tab name from the buffer of the selected window. |
| 700 | Also add the number of windows in the window configuration." | 705 | Also add the number of windows in the window configuration." |
| 701 | (let ((count (length (window-list-1 nil 'nomini))) | 706 | (let ((count (length (window-list-1 nil 'nomini))) |
| 702 | (name (window-buffer (minibuffer-selected-window)))) | 707 | (name (tab-bar-tab-name-current))) |
| 703 | (if (> count 1) | 708 | (if (> count 1) |
| 704 | (format "%s (%d)" name count) | 709 | (format "%s (%d)" name count) |
| 705 | (format "%s" name)))) | 710 | (format "%s" name)))) |
| @@ -726,7 +731,7 @@ to `tab-bar-tab-name-truncated'." | |||
| 726 | "Generate tab name from the buffer of the selected window. | 731 | "Generate tab name from the buffer of the selected window. |
| 727 | Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. | 732 | Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. |
| 728 | Append ellipsis `tab-bar-tab-name-ellipsis' in this case." | 733 | Append ellipsis `tab-bar-tab-name-ellipsis' in this case." |
| 729 | (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))) | 734 | (let ((tab-name (tab-bar-tab-name-current))) |
| 730 | (if (< (length tab-name) tab-bar-tab-name-truncated-max) | 735 | (if (< (length tab-name) tab-bar-tab-name-truncated-max) |
| 731 | tab-name | 736 | tab-name |
| 732 | (propertize (truncate-string-to-width | 737 | (propertize (truncate-string-to-width |
| @@ -1336,10 +1341,8 @@ inherits the current tab's `explicit-name' parameter." | |||
| 1336 | This is necessary to prepare the same window configuration where | 1341 | This is necessary to prepare the same window configuration where |
| 1337 | original windows were saved and will be restored. This function | 1342 | original windows were saved and will be restored. This function |
| 1338 | is used only when `read-minibuffer-restore-windows' is non-nil." | 1343 | is used only when `read-minibuffer-restore-windows' is non-nil." |
| 1339 | (when (and read-minibuffer-restore-windows | 1344 | (when tab-bar-minibuffer-restore-tab |
| 1340 | tab-bar-minibuffer-restore-tab) | 1345 | (tab-bar-select-tab tab-bar-minibuffer-restore-tab))) |
| 1341 | (tab-bar-select-tab tab-bar-minibuffer-restore-tab) | ||
| 1342 | (setq tab-bar-minibuffer-restore-tab nil))) | ||
| 1343 | 1346 | ||
| 1344 | (defun tab-bar-select-tab (&optional tab-number) | 1347 | (defun tab-bar-select-tab (&optional tab-number) |
| 1345 | "Switch to the tab by its absolute position TAB-NUMBER in the tab bar. | 1348 | "Switch to the tab by its absolute position TAB-NUMBER in the tab bar. |
| @@ -1368,8 +1371,8 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar." | |||
| 1368 | 1371 | ||
| 1369 | (when (and read-minibuffer-restore-windows minibuffer-was-active | 1372 | (when (and read-minibuffer-restore-windows minibuffer-was-active |
| 1370 | (not tab-bar-minibuffer-restore-tab)) | 1373 | (not tab-bar-minibuffer-restore-tab)) |
| 1371 | (setq tab-bar-minibuffer-restore-tab (1+ from-index)) | 1374 | (setq-local tab-bar-minibuffer-restore-tab (1+ from-index)) |
| 1372 | (add-hook 'minibuffer-exit-hook 'tab-bar-minibuffer-restore-tab)) | 1375 | (add-hook 'minibuffer-exit-hook 'tab-bar-minibuffer-restore-tab nil t)) |
| 1373 | 1376 | ||
| 1374 | (unless (eq from-index to-index) | 1377 | (unless (eq from-index to-index) |
| 1375 | (let* ((from-tab (tab-bar--tab)) | 1378 | (let* ((from-tab (tab-bar--tab)) |