From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] tab-bar.el: add defcustoms for functions to call after opening and before closing Date: Wed, 11 Dec 2019 10:32:26 -0800 Message-ID: <87y2viiuh1.fsf@cochranmail.com> References: <87h83egmzy.fsf@cochranmail.com> <87r22fzhag.fsf@mail.linkov.net> <87zhgawdk9.fsf@cochranmail.com> <87o8wpm15x.fsf@mail.linkov.net> <87immvzvf8.fsf@cochranmail.com> <87lfrrn20p.fsf@mail.linkov.net> <8736dyfk63.fsf@cochranmail.com> <87muc3ixj4.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4856"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Robert Cochran , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 11 19:36:45 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1if6qr-00017j-LT for ged-emacs-devel@m.gmane.org; Wed, 11 Dec 2019 19:36:45 +0100 Original-Received: from localhost ([::1]:47814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1if6qq-0003a4-GP for ged-emacs-devel@m.gmane.org; Wed, 11 Dec 2019 13:36:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37933) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1if6ml-0002FW-QW for emacs-devel@gnu.org; Wed, 11 Dec 2019 13:32:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1if6mk-0001MA-O8 for emacs-devel@gnu.org; Wed, 11 Dec 2019 13:32:31 -0500 Original-Received: from mail.cochranmail.com ([64.140.150.170]:41826) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1if6mk-0001Ig-Gq for emacs-devel@gnu.org; Wed, 11 Dec 2019 13:32:30 -0500 Original-Received: from SoraLaptop (unknown [71.212.134.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.cochranmail.com (Postfix) with ESMTPSA id 369A879B; Wed, 11 Dec 2019 10:32:27 -0800 (PST) In-Reply-To: <87muc3ixj4.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 08 Dec 2019 00:25:03 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.140.150.170 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243308 Archived-At: --=-=-= Content-Type: text/plain Juri Linkov writes: >> I've fixed it in this version of the patch. > > Thanks, now your patch is pushed to master. Thanks. Just realized though that I forgot to change tab-bar-close-other-tabs to also use the new custom variables, so here's a patch for that. Cheers, -- ~Robert Cochran --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-tab-bar.el-tab-bar-close-other-tabs-Use-tab-clo.patch Content-Description: Have tab-bar-close-other-tabs use tab close customs >From b777800d60c02745b20ea31ce4b10cf010168889 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Wed, 11 Dec 2019 10:29:00 -0800 Subject: [PATCH] * lisp/tab-bar.el (tab-bar-close-other-tabs): Use tab close customs --- lisp/tab-bar.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index ba4bc0afcd..59cba2c877 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -896,11 +896,18 @@ tab-bar-close-other-tabs (current-index (tab-bar--current-tab-index tabs))) (when current-index (dotimes (index (length tabs)) - (unless (eq index current-index) + (unless (or (eq index current-index) + (run-hook-with-args-until-success + 'tab-bar-tab-prevent-close-functions + (nth index tabs) + ; last-tab-p logically can't ever be true if we + ; make it this far + nil)) (push `((frame . ,(selected-frame)) (index . ,index) (tab . ,(nth index tabs))) - tab-bar-closed-tabs))) + tab-bar-closed-tabs) + (run-hook-with-args 'tab-bar-tab-pre-close-functions (nth index tabs) nil))) (set-frame-parameter nil 'tabs (list (nth current-index tabs))) (when (and tab-bar-mode -- 2.23.0 --=-=-=--