From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37667: 27.0.50; Tab Bar display problems with more than 5 tabs Date: Mon, 21 Oct 2019 10:58:48 +0300 Message-ID: <83zhhu34xz.fsf@gnu.org> References: <83o8yrvzgh.fsf@gnu.org> <87imownt6j.fsf@mail.linkov.net> <83eezjrbuj.fsf@gnu.org> <87sgnw2pz3.fsf@mail.linkov.net> <83o8yjke0u.fsf@gnu.org> <87lftnqbmg.fsf@mail.linkov.net> <83h84agytj.fsf@gnu.org> <87tv89opbh.fsf@mail.linkov.net> <83mue1g845.fsf@gnu.org> <83lftlg6zc.fsf@gnu.org> <87lftlk504.fsf@mail.linkov.net> <83eezceir2.fsf@gnu.org> <87pniwuwj5.fsf@mail.linkov.net> <83blufdehy.fsf@gnu.org> <878spj57dk.fsf@mail.linkov.net> <83v9sm8rs3.fsf@gnu.org> <87blubaw63.fsf@mail.linkov.net> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="72710"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37667@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 21 10:00:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1iMSbt-000Ih7-LL for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 10:00:13 +0200 Original-Received: from localhost ([::1]:35640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMSbr-0000ay-T5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 04:00:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50834) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMSbk-0000ac-QS for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 04:00:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMSbj-0003nQ-GU for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 04:00:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46863) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMSbj-0003nI-DS for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 04:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMSbj-0006NK-8k for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 04:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Oct 2019 08:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37667 X-GNU-PR-Package: emacs Original-Received: via spool by 37667-submit@debbugs.gnu.org id=B37667.157164474324407 (code B ref 37667); Mon, 21 Oct 2019 08:00:03 +0000 Original-Received: (at 37667) by debbugs.gnu.org; 21 Oct 2019 07:59:03 +0000 Original-Received: from localhost ([127.0.0.1]:55684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMSal-0006La-BZ for submit@debbugs.gnu.org; Mon, 21 Oct 2019 03:59:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMSaj-0006Kw-1i for 37667@debbugs.gnu.org; Mon, 21 Oct 2019 03:59:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iMSad-0003Y6-Bs; Mon, 21 Oct 2019 03:58:55 -0400 Original-Received: from [176.228.60.248] (port=4223 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iMSac-00034H-OB; Mon, 21 Oct 2019 03:58:55 -0400 In-reply-to: <87blubaw63.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 21 Oct 2019 01:28:52 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169888 Archived-At: > From: Juri Linkov > Cc: 37667@debbugs.gnu.org > Date: Mon, 21 Oct 2019 01:28:52 +0300 > > > Agreed. As we already have fringe bitmaps to show truncation both on > > the left and on the right, arranging for them to be displayed for > > tab-lines will allow us to bind clicking on these to scrolling > > commands. > > Trying to click on truncation arrows in fringe bitmaps of buffers signals: > > is undefined > > So we need to bind to a tab-line scrolling command > for [tab-line right-fringe] keymap? Either that, or bind the click on the fringe to a command that looks at posn-area of the click event, and scrolls the tab-line of the area is tab-line. > Or maybe the tab-line could be dragged like dragging the > horizontal scroll bar in horizontal-scroll-bar-mode? That would prevent using the drag events for something else, like reordering the tabs. It is also not what other applications do, right? > Or mouse-wheel could scroll the whole tab-line horizontally > instead of switching tabs like it does now? That could be an additional feature, but it cannot be the only one, I think, because some mice have no wheel. > >> These commands could work for the tab-line like hscrolling > >> in the buffer works when 'auto-hscroll-mode' is 'current-line'. > > > > There's an important difference, I think: you want to scroll the > > tab-line in tab-button granularity, not one character at a time. But > > the principle and the main idea is the same, yes. > > I thought that granularity should be wider: scrolling by the window width, > like 'C-x >' ('scroll-right') does, where default is window width minus 2. I think this would be less convenient. > But maybe tab-button granularity is fine. The only problem is that > I still studying the code to understand where to begin. Could you suggest > in what function to implement all this scrolling? I think you will need a new function. A tab-line is generated from a Lisp string, and we don't have code for hscrolling screen lines produced from strings (as opposed to from buffer text). The general idea is to identify the first (leftmost) tab you want to be visible, and then make changes in display_mode_line to start display from that tab. I think the first part is the more complex of these two. format-mode-line shows an example of how to generate display derived from Lisp and C strings without displaying anything; you could use that for finding the X coordinate (in it.current_x) of the beginning of the Nth tab's button. Each click on the right fringe increases N, each click on the left decreases it. The X coordinate you compute is the value to use for it.first_visible_x in display_mode_line. I hope this makes enough sense to get you going. If not, please ask more specific questions. Thanks.