all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 37667@debbugs.gnu.org
Subject: bug#37667: 27.0.50; Tab Bar display problems with more than 5 tabs
Date: Mon, 21 Oct 2019 10:58:48 +0300	[thread overview]
Message-ID: <83zhhu34xz.fsf@gnu.org> (raw)
In-Reply-To: <87blubaw63.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 21 Oct 2019 01:28:52 +0300)

> From: Juri Linkov <juri@linkov.net>
> 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:
> 
>   <right-fringe> <mouse-1> is undefined
> 
> So we need to bind <mouse-1> 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.





  reply	other threads:[~2019-10-21  7:58 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 18:55 bug#37667: 27.0.50; Tab Bar display problems with more than 5 tabs Eli Zaretskii
2019-10-10 22:25 ` Juri Linkov
2019-10-11  7:16   ` Eli Zaretskii
2019-10-13 22:39     ` Juri Linkov
2019-10-14  7:00       ` Eli Zaretskii
2019-10-14 21:47         ` Juri Linkov
2019-10-15  9:09           ` Eli Zaretskii
2019-10-15 18:07             ` Juri Linkov
2019-10-15 18:46               ` Eli Zaretskii
2019-10-15 19:10                 ` Eli Zaretskii
2019-10-15 22:39                   ` Juri Linkov
2019-10-16 16:51                     ` Eli Zaretskii
2019-10-16 22:39                       ` Juri Linkov
2019-10-17  7:20                         ` Eli Zaretskii
2019-10-17 22:34                           ` Juri Linkov
2019-10-18  6:57                             ` Eli Zaretskii
2019-10-20 22:28                               ` Juri Linkov
2019-10-21  7:58                                 ` Eli Zaretskii [this message]
2019-10-21 22:20                                   ` Juri Linkov
2019-10-22 15:16                                     ` Eli Zaretskii
2019-10-22 21:19                                       ` Juri Linkov
2019-10-23 16:10                                         ` Eli Zaretskii
2019-10-28 22:38                                           ` Juri Linkov
2019-10-29 12:01                                             ` Eli Zaretskii
2019-10-30  0:35                                               ` Juri Linkov
2019-10-30 15:59                                                 ` Eli Zaretskii
2019-10-30 23:59                                                   ` Juri Linkov
2019-10-31 14:25                                                     ` Eli Zaretskii
2019-10-31  0:03                                                   ` Juri Linkov
2019-10-31 14:30                                                     ` Eli Zaretskii
2019-10-31 20:46                                                       ` Juri Linkov
2019-11-01  7:43                                                         ` Eli Zaretskii
2019-11-02 19:06                                                           ` Juri Linkov
2019-11-02 19:28                                                             ` Eli Zaretskii
2019-11-02 22:36                                                               ` Juri Linkov
2019-11-17 21:44                                           ` Juri Linkov
2019-11-18 16:18                                             ` Eli Zaretskii
2019-11-18 21:57                                               ` Juri Linkov
2019-11-19 16:51                                                 ` Eli Zaretskii
2019-11-19 22:25                                                   ` Juri Linkov
2019-11-20  3:45                                                     ` Eli Zaretskii
2019-11-20 22:40                                                       ` Juri Linkov
2019-11-21  8:23                                                         ` martin rudalics
2019-11-21 14:20                                                           ` Eli Zaretskii
2019-11-21 21:56                                                           ` Juri Linkov
2019-11-22  8:16                                                             ` martin rudalics
2019-10-11  8:17   ` martin rudalics
2019-10-13 22:31     ` Juri Linkov
2019-10-14  6:51       ` Eli Zaretskii
2019-10-14 20:07         ` Juri Linkov
2019-10-14 20:22           ` Eli Zaretskii
2019-10-14 21:50             ` Juri Linkov
2019-10-15  6:26               ` Eli Zaretskii
2019-10-15 17:54                 ` Juri Linkov
2019-10-16 18:14       ` martin rudalics
2019-10-16 20:58         ` Juri Linkov
2019-10-17  8:25           ` martin rudalics
2020-09-20 11:24 ` Lars Ingebrigtsen
2020-09-20 11:27   ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=83zhhu34xz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37667@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.