From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#72352: Small tab-bar-move-tab-to-group bug fix Date: Mon, 29 Jul 2024 09:20:19 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a7a5a4061e62b91a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14407"; mail-complaints-to="usenet@ciao.gmane.io" To: 72352@debbugs.gnu.org, juri@linkov.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 29 15:21:07 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sYQJH-0003c3-5v for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jul 2024 15:21:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYQJ2-0005Ci-C9; Mon, 29 Jul 2024 09:20:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYQJ0-0005Bo-F2 for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 09:20:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYQJ0-00026e-5V for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 09:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=kEvClszz8nVDVlnE6B3pXNtzuv5dS9PlMAFD15hMEkQ=; b=thbIsWbXz1YCdak2aKnHjWwKPHbDbS4THRVaKDmhLu8qVKXCke8c3XtNErU4CKI2Tbx7Ke3cSkmxf/Z+idkl9W4iYg3C2pUFm5I0+LC0vb4Uu/MX5K44HbOX1M4Pv04rfg/OhkEu7g1jFLPIElz5mkw1jeiMfLHuvmGRICVcUE7DHDluFgoAaNiWiGMZZQ9R0Qgn3ngGkR9oSnNKR6ESIauCKdtoYFd1vQx3Z7o8RSFIPglm7O61hh1Jbn3k0ucVKBuCdfg2ThmEGRam/R8e6Nur0Bvjuia57iqO4N1fzmqnf2HtyL6yBotRSE1PD0XCQmJP/5JpQMGT/TzDQNRVZg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYQJC-0003eV-GA for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 09:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jul 2024 13:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72352 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Juri Linkov Original-Received: via spool by submit@debbugs.gnu.org id=B.172225925214014 (code B ref -1); Mon, 29 Jul 2024 13:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jul 2024 13:20:52 +0000 Original-Received: from localhost ([127.0.0.1]:45122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYQJ2-0003dx-8Q for submit@debbugs.gnu.org; Mon, 29 Jul 2024 09:20:52 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYQIz-0003do-UT for submit@debbugs.gnu.org; Mon, 29 Jul 2024 09:20:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYQIm-00057h-Rj for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 09:20:36 -0400 Original-Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYQIk-000256-Lu for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 09:20:36 -0400 Original-Received: by mail-vs1-xe2f.google.com with SMTP id ada2fe7eead31-4929d6429c2so460098137.3 for ; Mon, 29 Jul 2024 06:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722259231; x=1722864031; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=kEvClszz8nVDVlnE6B3pXNtzuv5dS9PlMAFD15hMEkQ=; b=c0hilPnJrwPK5lW69lDrL85ln+qSf8tF8Hc2d42Ui3qQdy4uBPDPSO3/XXUojrk94G iYMqY1Jd9YYAN85rapJmFysd+y5WuKJbwjvesI05qjacn0qbYJRyDjP63brOq5sslAAm KRMV3aS48f+msSMmb3rUi4Vn7IAO1uFj4/MgW/svFSQgHaRY2Wx1HUn1lxrK6oPMnLsk U6fsElPq6ACJDWgDolmUENvEUM4/2skzfMczh+SUdhVoasKLE402xNE5kE5uxRVwCnAf gEJTcOv9vwn+KPWOLuQJHnrqMCIdhjJI6AL7nTN/BZDMRiZ/LkYTPJn5C0Tl3FrDJ5QL tq6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722259231; x=1722864031; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kEvClszz8nVDVlnE6B3pXNtzuv5dS9PlMAFD15hMEkQ=; b=gybpdommh1p48VOtsinDwiYPuKar4kimrQEkj10DMJHOl2LY717kNIzlEtLrGI8je9 L8tBwRjpUb471SXaZZF6pNnggzx2wH4apqu7rFRBw5VziUBwit8dXYoMhTIDEzZXCe0y IcYj3+WOWSqzveOw/HzkCNSJPct6dfY3JRXLNhDCascdp0pxSZ+winNqs30AMX6R7LD4 lTtiI9J+06ISAyPxwR4GhI0ICTJIGxn4YBk8cwk+039RX+YQ74I2SRnlvlvJ3rkrTwtu wB8e8J65/mgBK/SszIQTvdTy47mlZ2XGsdeVtHH7ZpbZUpXiC0yqP8eFs2gHDN4blivT TGwQ== X-Gm-Message-State: AOJu0Yyk0eo8ZYcw17YBpJwtzLPP3iml2G0BQCNzn0MnDCe/ofvj/MNg PMewda8L1y+s5Lb8A37OUK0BpN3/fzINMB5W1YH8mRYLX1CEkVnGHLA6rFdpe3IqD/bESqGJmy5 4DDJqFHaX0fIjRWtmbJraP828cY/L72Gt X-Google-Smtp-Source: AGHT+IEX7VEr4uWlPcZc5CoNOdINe1MX4imRAo3gQjo0RKT+mH++1OZVJ0U2GZvajV31PHHvem2CbmIxcwEWvZG7lJo= X-Received: by 2002:a05:6102:5112:b0:493:b52f:ecb6 with SMTP id ada2fe7eead31-493fa456e88mr4060897137.20.1722259230661; Mon, 29 Jul 2024 06:20:30 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::e2f; envelope-from=shipmints@gmail.com; helo=mail-vs1-xe2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289520 Archived-At: --000000000000a7a5a4061e62b91a Content-Type: text/plain; charset="UTF-8" This corrects for the condition where a tab, among its set of tabs which all share the same group (nil or otherwise), is changed to a new group that doesn't yet exist. The current behavior is to leave that tab where it is within the "old group" but this is counter to the goal of keeping group-related tabs "together." The correction I've made is simply to move that newly grouped tab to the end. I've tested this and been using a patched form for a while to no ill effect. (defun tab-bar-move-tab-to-group (&optional tab) ... * (pos (if beg* (cond ;; Don't move tab when it's already inside group bounds ((and len (>= tab-index beg) (<= tab-index (+ beg len))) nil) ;; Move tab from the right to the group end ((and len (> tab-index (+ beg len))) (+ beg len 1)) ;; Move tab from the left to the group beginning ((< tab-index beg) beg)) * -1))) ; Move to the end* ... Much obliged, Stephane --000000000000a7a5a4061e62b91a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This corrects for the condition where a tab, among its = set of tabs which all share the same group (nil or otherwise), is changed t= o a new group that doesn't yet exist. The current behavior is to leave = that tab where it is within the "old group" but this is counter t= o the goal of keeping group-related tabs "together." The correcti= on I've made is simply to move that new= ly grouped tab to the end. I've tested this and been using a patched fo= rm for a while to=C2=A0no=C2=A0ill effect.

(defun tab-bar-move-tab= -to-group (&optional tab)
...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pos (if beg
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Don't move tab when it's a= lready inside group bounds
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0((and len (>=3D tab-index beg) (<=3D tab-index (+ be= g len))) nil)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0;; Move tab from the right to the group end
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((and len (> tab-index (+ beg l= en))) (+ beg len 1))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0;; Move tab from the left to the group beginning
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((< tab-index beg) b= eg))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -1))) ; Move to the e= nd
...

Much obliged,

Stephane
--000000000000a7a5a4061e62b91a--