unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ship Mints <shipmints@gmail.com>
To: 72352@debbugs.gnu.org, juri@linkov.net
Subject: bug#72352: Small tab-bar-move-tab-to-group bug fix
Date: Mon, 29 Jul 2024 09:20:19 -0400	[thread overview]
Message-ID: <CAN+1HbpO_SchQTYubJ1bN2_4hEhHKjLyKNcFSeQ9u2FGuXBBdA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1985 bytes --]

             reply	other threads:[~2024-07-29 13:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 13:20 Ship Mints [this message]
2024-07-29 18:16 ` bug#72352: Small tab-bar-move-tab-to-group bug fix Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN+1HbpO_SchQTYubJ1bN2_4hEhHKjLyKNcFSeQ9u2FGuXBBdA@mail.gmail.com \
    --to=shipmints@gmail.com \
    --cc=72352@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).