From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o?= Guerra Newsgroups: gmane.emacs.bugs Subject: bug#39649: 27.0.60; tab-line doesn't scroll Date: Wed, 19 Feb 2020 21:57:15 +0100 Message-ID: References: <87lfp0lsun.fsf@mail.linkov.net> <87imk3a5sa.fsf@mail.linkov.net> <87h7zn4d99.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="14007"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39649@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 19 21:58:13 2020 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 1j4WQ7-0003US-Uh for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Feb 2020 21:58:12 +0100 Original-Received: from localhost ([::1]:60316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4WQ6-000895-Ue for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Feb 2020 15:58:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53758) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4WPz-00088x-Pq for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 15:58:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4WPy-0004kW-J5 for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 15:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4WPy-0004kQ-FX for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 15:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4WPy-0003np-Dv for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 15:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o?= Guerra Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Feb 2020 20:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39649 X-GNU-PR-Package: emacs Original-Received: via spool by 39649-submit@debbugs.gnu.org id=B39649.158214587914607 (code B ref 39649); Wed, 19 Feb 2020 20:58:02 +0000 Original-Received: (at 39649) by debbugs.gnu.org; 19 Feb 2020 20:57:59 +0000 Original-Received: from localhost ([127.0.0.1]:43438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4WPu-0003nX-Rj for submit@debbugs.gnu.org; Wed, 19 Feb 2020 15:57:59 -0500 Original-Received: from mail-vs1-f65.google.com ([209.85.217.65]:44598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4WPt-0003nL-V0 for 39649@debbugs.gnu.org; Wed, 19 Feb 2020 15:57:58 -0500 Original-Received: by mail-vs1-f65.google.com with SMTP id p6so1237115vsj.11 for <39649@debbugs.gnu.org>; Wed, 19 Feb 2020 12:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hVLnUuNwLKEYAddobc0t1BA3coFhKHjJcMwpKFEw2pc=; b=WplstXfIf94SsYTwE/XKv+6dt4Y8gIIIKW5gL2KBVxpgc1pBIY2GO09oZKh3Blrbfc YBshV7Ivv+VCsqBzcTSfqq/dNU2OREtAwVAnwpSzUO9o61Rr2Qv4sS4sV0HCKFTdvEWd wj2h8DUxHsK5lhvbvPyl7rVwAw7B+raHlPOZhH9rwxthEbmamFuJRTOUwF7MkfG5ZOd2 R5r7bFDz0Lcu3QT6cLmC/+JwTh3g9KrZBYEa17SUGXwms62+Fr3bUhNy183DCif/VYLk 1XrNMIAZDLTS06KvZDjM58haNISw9woro3WJzv42iZiJlULXATB1dAC0bCZyfkKYI86Z d6BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hVLnUuNwLKEYAddobc0t1BA3coFhKHjJcMwpKFEw2pc=; b=ZOZj7YuLBG3qV65OmXfoS9avKeWGWGm5yuDYlQ2tYn8tfJ1zCW8vKSnnzZ6ODSMoTI IEXhzzn02qvgOHrl1anczELj169tC3qCopqN/CynFBXL6jt5Vjv/r8mUylevjMQ6cL3y VrSOwwgNM2FhH2ZNvel7H0ULnlRiiIAGTEZ/72Y2lz9p9c6rv/thEeJfuy17Whc0a2iD 4VuauUrVvk4QPyZ6rjD+COvxlnAEcyXxNVC/Lh5KciT3KBDMNu2GFYUKCF/ewYeZ6x4b 5kxcxrvKuYdnTmMI6Q94AF++kZYS1IT+SQKCZjexmXTJPr6BXwaW4lteDqD3GKfFY8gj +VAA== X-Gm-Message-State: APjAAAUPLZH5XlETCn0dftv+Wh+MVAW+Od1nB84EZ+u5P2rHT/nn+GU7 XEw1qknRxBo6YaqU/qyk5LlO4TO1aodnXX63zmnctQDD X-Google-Smtp-Source: APXvYqw3tDM9qlHQg7WT7BpNBZMkVJzqhLf/k0yG+WowF/KXBjdzCkVeWFkFnoMhx9iJdoJpGGEI3okZwfCKX5yfjeA= X-Received: by 2002:a67:6483:: with SMTP id y125mr14785173vsb.212.1582145872247; Wed, 19 Feb 2020 12:57:52 -0800 (PST) In-Reply-To: <87h7zn4d99.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:176260 Archived-At: This seems better to me. However, scrolling is occurring when not necessary, which looks kinda weird https://youtu.be/_YG0XH8XJpI On Wed, 19 Feb 2020 at 01:51, Juri Linkov wrote: > > >> Seems to fix the issue in a specific situation, viz. after I select a > >> tab manually with the mouse. However, when selecting a buffer that is > >> already visible in the tab-line the tab-line still might get scrolled > >> or if I just scroll the tab-line and change to a non-visible buffer > >> the tab-line doesn't get scrolled. I'm a bit interested in knowing the > >> reasoning to not always scroll the tab-line. > > > > While you're manually scrolling the tab-line using the mouse wheel > > or clicking on arrow buttons, auto-scrolling should be disabled > > because it should not bring the current tab back into view immediately > > on every step of manual scrolling. Just imagine that you clicked > > on the arrow button to scroll, but it has no effect because auto-scrolling > > immediately moved the tab-line back to its original state. > > This is why auto-scrolling should be disabled during manual scrolling. > > > > Now the question: how to detect the moment when you stop manually > > scrolling? How would you indicate that manual scrolling is finished, > > and it's time to enable auto-scrolling to bring the currently selected tab > > back into view? I have no idea. > > Actually, I have an idea - the right moment is when the current buffer > changes on the current tab. This patch is the right way to handle this case: > > diff --git a/lisp/tab-line.el b/lisp/tab-line.el > index 86ac234f3d..ad2b167e33 100644 > --- a/lisp/tab-line.el > +++ b/lisp/tab-line.el > @@ -464,6 +464,13 @@ tab-line-format > (window-buffer) > (window-parameter nil 'tab-line-hscroll))) > (cache (window-parameter nil 'tab-line-cache))) > + ;; Enable auto-hscroll again after it was disabled on manual scrolling. > + ;; The moment to enable it is when the window-buffer was updated. > + (when (and tab-line-auto-hscroll ; if auto-hscroll was enabled > + (natnump (nth 2 cache-key)) ; non-negative on manual scroll > + cache ; window-buffer was updated > + (not (equal (nth 1 (car cache)) (nth 1 cache-key)))) > + (set-window-parameter nil 'tab-line-hscroll nil)) > (or (and cache (equal (car cache) cache-key) (cdr cache)) > (cdr (set-window-parameter > nil 'tab-line-cache