commit 10e023c15c03ca32d3c9b1ad54111ef4ede6de73 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Sun May 25 19:45:05 2025 +0300 * lisp/tab-line.el (tab-line-close-other-tabs): New command. (tab-line-tab-context-menu): Bind 'tab-line-close-other-tabs' to the menu item "Close other tabs". Suggested by pinmacs . diff --git a/etc/NEWS b/etc/NEWS index a095048017e..33b042720b5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -389,6 +389,10 @@ Together with the new command 'tab-line-move-tab-backward' ('C-x M-') it can be used to move the current tab on the tab line to a different position. +--- +*** New command 'tab-line-close-other-tabs'. +It's bound to the tab's context menu item "Close other tabs". + ** Project --- diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 411d8cbd70d..0a1918a2427 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -1111,12 +1111,42 @@ sight of the tab line." (funcall tab-line-close-tab-function tab))) (force-mode-line-update))))) +(defun tab-line-close-other-tabs (&optional event) + "Close all tabs on the selected window, except the tab on EVENT. +It preforms the same actions on the closed tabs as in `tab-line-close-tab'." + (interactive (list last-nonmenu-event)) + (when (tab-line-track-tap event) + (let* ((posnp (and (listp event) + (tab-line-event-start event))) + (window (and posnp (posn-window posnp))) + (keep-tab (tab-line--get-tab-property 'tab (car (posn-string posnp))))) + (with-selected-window (or window (selected-window)) + (dolist (tab (delete keep-tab (funcall tab-line-tabs-function))) + (let ((buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))) + (close-function (unless (bufferp tab) (cdr (assq 'close tab))))) + (cond + ((functionp close-function) + (funcall close-function)) + ((eq tab-line-close-tab-function 'kill-buffer) + (kill-buffer buffer)) + ((eq tab-line-close-tab-function 'bury-buffer) + (if (eq buffer (current-buffer)) + (bury-buffer) + (set-window-prev-buffers nil (assq-delete-all buffer (window-prev-buffers))) + (set-window-next-buffers nil (delq buffer (window-next-buffers))))) + ((functionp tab-line-close-tab-function) + (funcall tab-line-close-tab-function tab))))) + (force-mode-line-update))))) + (defun tab-line-tab-context-menu (&optional event) "Pop up the context menu for a tab-line tab." (interactive "e") (let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t)))) (define-key-after menu [close] '(menu-item "Close" tab-line-close-tab :help "Close the tab")) + (define-key-after menu [close-other] + '(menu-item "Close other tabs" tab-line-close-other-tabs + :help "Close all other tabs")) (popup-menu menu event))) (defun tab-line-context-menu (&optional event) commit 48e3d08cf36d5e5ea56c5653bd3410e2dcd3c02b Author: Michael Albinus Date: Sun May 25 15:20:10 2025 +0200 ; Fix last change diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 7ebabf6d0f8..9e2868e6383 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -334,8 +334,7 @@ build-image-tree-sitter: test-tree-sitter: stage: platforms - extends: >- - [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files] + extends: [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files] needs: - job: build-image-tree-sitter optional: true commit 300d7c1ad657d3631a42360bc746d52179075547 Author: Michael Albinus Date: Sun May 25 14:04:09 2025 +0200 Adapt Emba files * test/infra/Dockerfile.emba: * test/infra/gitlab-ci.yml: Add me as maintainer. Format. * test/infra/Makefile.in (tree-sitter-files): Format. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 70bfb076c3c..8078dd77312 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -18,10 +18,10 @@ # GNU Emacs support for the GitLab-specific build of Docker images. # The presence of this file does not imply any FSF/GNU endorsement of -# Docker or any other particular tool. Also, it is intended for -# evaluation purposes, thus possibly temporary. +# Docker or any other particular tool. -# Maintainer: Ted Zlatanov +# Author: Ted Zlatanov +# Maintainer: Michael Albinus # URL: https://emba.gnu.org/emacs/emacs FROM debian:bookworm as emacs-base @@ -123,9 +123,10 @@ RUN make -j `nproc` bootstrap RUN mkdir -p /root/.emacs.d/tree-sitter RUN git config --global http.sslverify "false" # See https://github.com/emacs-tree-sitter/tree-sitter-langs/tree/master/repos -# The recommended versions are generated by 'treesit-admin-verify-major-mode-queries' -# at the beginning of every ts-mode file. Loading a ts-mode file adds its -# grammar source to 'treesit-language-source-alist'. +# The recommended versions are generated by +# 'treesit-admin-verify-major-mode-queries' at the beginning of every +# ts-mode file. Loading a ts-mode file adds its grammar source to +# 'treesit-language-source-alist'. RUN src/emacs -Q --batch \ --eval '(message "library ABI min version %d max version %d" \ (treesit-library-abi-version t) (treesit-library-abi-version))' \ @@ -141,7 +142,7 @@ RUN src/emacs -Q --batch \ --eval '(message "\ntreesit-language-source-alist")' \ --eval '(message "=============================")' \ --eval '(message "%s" (pp-to-string treesit-language-source-alist))' \ - --eval '(message "ABI versions\n===========")' \ + --eval '(message "ABI versions\n============")' \ --eval \ '(dolist (lang (sort (mapcar (quote car) treesit-language-source-alist))) \ (message "%s ABI version %d" lang (treesit-language-abi-version lang)))' \ @@ -193,7 +194,8 @@ COPY . /checkout WORKDIR /checkout RUN ./autogen.sh autoconf RUN ./configure --with-native-compilation -RUN make -j `nproc` bootstrap BYTE_COMPILE_EXTRA_FLAGS='--eval "(setq comp-speed 1)"' +RUN make -j `nproc` bootstrap \ + BYTE_COMPILE_EXTRA_FLAGS='--eval "(setq comp-speed 1)"' FROM emacs-native-comp as emacs-native-comp-speed2 diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index 8347df4e2bf..e92623ba56d 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -124,7 +124,8 @@ tree-sitter-files: @echo '.tree-sitter-files:' >>$(FILE) @echo ' variables:' >>$(FILE) @echo ' tree_sitter_files: >-' >>$(FILE) - @for name in $(TREE-SITTER-FILES) ; do echo " $${name}" >>$(FILE) ; done + @for name in $(TREE-SITTER-FILES) ; \ + do echo " $${name}" >>$(FILE) ; done $(FILE): $(AM_V_GEN) diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 26ea1807457..7ebabf6d0f8 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -18,10 +18,10 @@ # GNU Emacs support for the GitLab protocol for CI. # The presence of this file does not imply any FSF/GNU endorsement of -# any particular service that uses that protocol. Also, it is intended for -# evaluation purposes, thus possibly temporary. +# any particular service that uses that protocol. -# Maintainer: Ted Zlatanov +# Author: Ted Zlatanov +# Maintainer: Michael Albinus # URL: https://emba.gnu.org/emacs/emacs # Never run merge request pipelines, they usually duplicate push pipelines @@ -67,7 +67,8 @@ default: before_script: - docker info - echo "docker registry is ${CI_REGISTRY}" - - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} + - 'docker login + -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}' .job-template: variables: @@ -93,7 +94,8 @@ default: -e http_proxy=${http_proxy} -e https_proxy=${https_proxy} -e no_proxy=${no_proxy} - --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro + --volumes-from + $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -xvc @@ -107,15 +109,20 @@ default: after_script: # - docker ps -a # - pwd; printenv - # - test -n "$(docker ps -aq -f name=${test_name})" && ( docker export ${test_name} | tar -tvf - ) # Prepare test artifacts. - - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name} - - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/configure.log ${test_name} || true - - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/compatibility-report.html ${test_name} || true - - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} - - find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} -o -name compatibility-report.html \) -type f -delete + - 'test -n "$(docker ps -aq -f name=${test_name})" && + docker cp ${test_name}:checkout/test ${test_name}' + - 'test -n "$(docker ps -aq -f name=${test_name})" && + docker cp ${test_name}:checkout/configure.log ${test_name} || true' + - 'test -n "$(docker ps -aq -f name=${test_name})" && + docker cp ${test_name}:checkout/compatibility-report.html ${test_name} || + true' + - 'test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}' + - 'find ${test_name} + ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} -o + -name compatibility-report.html \) -type f -delete' # BusyBox find does not know -empty. - - find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null + - 'find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null' .build-template: needs: [] @@ -147,8 +154,10 @@ default: - src/macfont.{h,m} when: never script: - - docker build --pull --target ${target} -t ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} -f test/infra/Dockerfile.emba . - - docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} + - 'docker build --pull --target ${target} + -t ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} + -f test/infra/Dockerfile.emba .' + - 'docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG}' .test-template: cache: @@ -293,8 +302,8 @@ test-filenotify-gio: # This is needed in order to get a JUnit test report. make_params: >- check-expensive - TEST_HOME=/root - LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log" + TEST_HOME=/root + LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log" build-image-eglot: stage: platform-images @@ -312,10 +321,10 @@ test-eglot: target: emacs-eglot # This is needed in order to get a JUnit test report. make_params: >- - check-expensive - TEST_HOME=/root LOGFILES="lisp/progmodes/eglot-tests.log" - # EMACS_EXTRAOPT="--eval \(use-package\ company\ :ensure\ t\) - # --eval \(use-package\ yasnippet\ :ensure\ t\)" + check-expensive TEST_HOME=/root LOGFILES="lisp/progmodes/eglot-tests.log" + + # EMACS_EXTRAOPT="--eval \(use-package\ company\ :ensure\ t\) + # --eval \(use-package\ yasnippet\ :ensure\ t\)" build-image-tree-sitter: stage: platform-images @@ -325,7 +334,8 @@ build-image-tree-sitter: test-tree-sitter: stage: platforms - extends: [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files] + extends: >- + [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files] needs: - job: build-image-tree-sitter optional: true