From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#39649: 27.0.60; tab-line doesn't scroll Date: Wed, 19 Feb 2020 02:24:18 +0200 Organization: LINKOV.NET Message-ID: <87h7zn4d99.fsf@mail.linkov.net> References: <87lfp0lsun.fsf@mail.linkov.net> <87imk3a5sa.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="99868"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 39649@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o?= Guerra Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 19 01:52:15 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 1j4Db5-000Pqu-9Z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Feb 2020 01:52:15 +0100 Original-Received: from localhost ([::1]:43676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4Db4-0000Pg-54 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Feb 2020 19:52:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36511) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4Dat-0000PE-Gx for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4Das-0006qn-GV for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4Das-0006q8-Cq for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4Das-0001ZC-Bk for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Feb 2020 00:52: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.15820734785946 (code B ref 39649); Wed, 19 Feb 2020 00:52:02 +0000 Original-Received: (at 39649) by debbugs.gnu.org; 19 Feb 2020 00:51:18 +0000 Original-Received: from localhost ([127.0.0.1]:41481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4Da9-0001Xo-7a for submit@debbugs.gnu.org; Tue, 18 Feb 2020 19:51:18 -0500 Original-Received: from aye.elm.relay.mailchannels.net ([23.83.212.6]:29683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4Da7-0001Xf-EY for 39649@debbugs.gnu.org; Tue, 18 Feb 2020 19:51:16 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E59D2360F99; Wed, 19 Feb 2020 00:51:13 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (100-96-13-15.trex.outbound.svc.cluster.local [100.96.13.15]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id C9E2A360E07; Wed, 19 Feb 2020 00:51:12 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 19 Feb 2020 00:51:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Skirt-Tasty: 1641f0ac68e2b056_1582073473086_636771610 X-MC-Loop-Signature: 1582073473086:1003631037 X-MC-Ingress-Time: 1582073473086 Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTP id 36A677F038; Tue, 18 Feb 2020 16:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=wlTbTr9XSu2Uqqiw2qlOr0Uueg0=; b= bOt3Z+6+IaZMWqwuH2i4pFSAlmNCrPt882JupIefrAdzzvnI7U17ui1PXrzQqAOA N7ihv/DBPeIXlb38EyR3JNj1CZRLw/5yEZEIfXYB8RzUVeRXULcaaXft+BVCa7zW IQ8gpeN3oM6ZJe73Ph64RQ6yTIqiwj2Kq+AWWL55IOg= Original-Received: from localhost.linkov.net (m91-129-103-27.cust.tele2.ee [91.129.103.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTPSA id 2557A7F015; Tue, 18 Feb 2020 16:51:06 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a86 In-Reply-To: <87imk3a5sa.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 19 Feb 2020 00:39:09 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrjeelgddvhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehlohgtrghlhhhoshhtrdhlihhnkhhovhdrnhgvthdpihhnvghtpeeluddruddvledruddtfedrvdejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepjhhotggrrdgsthesghhmrghilhdrtghomh 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:176231 Archived-At: >> 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