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: Wed, 16 Oct 2019 19:51:29 +0300 Message-ID: <83eezceir2.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> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="224037"; 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 Wed Oct 16 18:52:15 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 1iKmX1-000w3F-5k for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2019 18:52:15 +0200 Original-Received: from localhost ([::1]:45662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKmWz-0004n3-Pw for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2019 12:52:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38996) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKmWp-0004iX-8m for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2019 12:52:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKmWn-0003na-Tm for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2019 12:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37629) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKmWn-0003nS-Qx for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2019 12:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iKmWn-0005Hd-OJ for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2019 12:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Oct 2019 16:52:01 +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.157124472020302 (code B ref 37667); Wed, 16 Oct 2019 16:52:01 +0000 Original-Received: (at 37667) by debbugs.gnu.org; 16 Oct 2019 16:52:00 +0000 Original-Received: from localhost ([127.0.0.1]:46450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iKmWl-0005HO-Mj for submit@debbugs.gnu.org; Wed, 16 Oct 2019 12:51:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iKmWj-0005HA-8I for 37667@debbugs.gnu.org; Wed, 16 Oct 2019 12:51:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iKmWe-0003kV-1Q; Wed, 16 Oct 2019 12:51:52 -0400 Original-Received: from [176.228.60.248] (port=4955 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iKmWa-0003RY-2v; Wed, 16 Oct 2019 12:51:50 -0400 In-reply-to: <87lftlk504.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 16 Oct 2019 01:39:39 +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:169465 Archived-At: > From: Juri Linkov > Cc: 37667@debbugs.gnu.org > Date: Wed, 16 Oct 2019 01:39:39 +0300 > > I've started with implementing hscrolling for window tab-line > because this is needed for both graphical displays and TTY. Thanks. > But the first question popped up quickly: I don't understand > how to detect the situation where the tab-line is truncated? The situation that it's truncated, or the situation that it _needs_ to be truncated, i.e. the next tab doesn't fit on the line? If the former, the glyph_row->truncated_on_right_p flag should be set. You can see it being set in display_string, which is called from display_mode_line. If you mean the latter, then look how the truncated_on_right_p flag is being set in display_line or in other similar display functions, like display_tab_bar_line. > And how to find the tab that is visible partially? > Especially when the font is variable-pitch. I think you will need to walk the glyphs in the tab-line looking for the last glyph whose character position has the property you put on tabs in tab-line (as specified in by tab-line-format). Or maybe tab-line-format should put some special property on the last glyph of a tab, so that you could look for it more easily? Let me know if the above is not detailed enough to get you off the ground. > What I'm trying to do is to hide leftmost tabs one by one until > the current tab on the rightmost side becomes completely visible. That will work, but it's inefficient. Once you know the number N of pixels are needed to show the tab you want to unhide, just walk the glyphs of the tabs from the left edge until you find the first tab whose horizontal position M is greater or equal to N. then set it->first_visible_x to that number M and display the tab line. HTH