From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Tabs Date: Sat, 28 Sep 2019 22:52:34 +0300 Organization: LINKOV.NET Message-ID: <87ef00gqst.fsf@mail.linkov.net> References: <87a7bpysm8.fsf@mail.linkov.net> <87muf56wwf.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="140166"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Emacs developers To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 28 21:56:48 2019 Return-path: Envelope-to: ged-emacs-devel@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 1iEIpg-000aJF-U3 for ged-emacs-devel@m.gmane.org; Sat, 28 Sep 2019 21:56:45 +0200 Original-Received: from localhost ([::1]:34768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEIpf-0002J4-QA for ged-emacs-devel@m.gmane.org; Sat, 28 Sep 2019 15:56:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50245) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEIp4-00025e-Fs for emacs-devel@gnu.org; Sat, 28 Sep 2019 15:56:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEIp2-0001Bg-G0 for emacs-devel@gnu.org; Sat, 28 Sep 2019 15:56:06 -0400 Original-Received: from bonobo.elm.relay.mailchannels.net ([23.83.212.22]:6906) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iEIp2-0001A3-4c for emacs-devel@gnu.org; Sat, 28 Sep 2019 15:56:04 -0400 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 AAA90501501; Sat, 28 Sep 2019 19:55:59 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a92.g.dreamhost.com (100-96-169-58.trex.outbound.svc.cluster.local [100.96.169.58]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E3597501620; Sat, 28 Sep 2019 19:55:58 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a92.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.1); Sat, 28 Sep 2019 19:55:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Plucky-Slimy: 6a9fcf1e10ab3782_1569700559158_2196307010 X-MC-Loop-Signature: 1569700559158:1489399289 X-MC-Ingress-Time: 1569700559158 Original-Received: from pdx1-sub0-mail-a92.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a92.g.dreamhost.com (Postfix) with ESMTP id E5E86816E0; Sat, 28 Sep 2019 12:55:54 -0700 (PDT) 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=2PCzMc0b8Ddp2D+LswRrxEn1N7k=; b= 1OaPQkouKRPXY9TFZmGXiLDtWv2W6U8hGDhpqQ+O9srtOTn/ZALK4Iz2RDBmXk8x yiPwqIrIHzM1DvM0uBJsGFgCW4l4sC+uKlqKbI4svG10KsKgnCpKVv22qwdfOOXe tcbMsjQ4lnxBB1sZqX/T2uePxG9ROv6yaYCf7ssThac= Original-Received: from mail.jurta.org (m91-129-99-99.cust.tele2.ee [91.129.99.99]) (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-a92.g.dreamhost.com (Postfix) with ESMTPSA id 43C25816D4; Sat, 28 Sep 2019 12:55:52 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a92 In-Reply-To: (Stefan Kangas's message of "Sat, 28 Sep 2019 19:06:57 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrfeekgddugeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelledrleelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleelrdelledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehsthgvfhgrnhesmhgrrhigihhsthdrshgvnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240372 Archived-At: >> > 1. When I run C-x or C-x , it automatically creates a new tab with >> > the next buffer. I'd rather it switched between the open tabs, and have a >> > separate command to create a new tab. I believe this would be more in line with >> > how tabs work in other software, and therefore more intuitive. >> >> If an inactive tab is displayed to the left from the currently active tab, >> do you mean that 'C-x ' doesn't switch to it but instead creates a new tab? > > When I do: > > 0. emacs -Q > 1. M-x global-tab-line-mode > 1. C-x > > I see a new tab open up with the *Messages* buffer. I would expect it > to not open up a new tab when I just ask to see the next or previous > tab. This is intentional. This feature allows you to add more tabs from the frame's buffer-list and buried-buffer-list. If you don't want to use this feature, just don't type C-x on the first tab. Also you can close unwanted tabs by clicking on the close buttons. >> > 2. None of these interactive commands work when run with M-x: >> > >> > command-execute: tab-line-add-tab must be bound to an event with parameters >> > command-execute: tab-line-close-tab must be bound to an event with parameters >> > command-execute: tab-line-select-tab must be bound to an event with parameters >> > command-execute: tab-line-switch-to-next-tab must be bound to an event >> > with parameters >> > command-execute: tab-line-switch-to-prev-tab must be bound to an event >> > with parameters >> >> Mouse commands don't work with M-x. For example, try M-x Buffer-menu-mouse-select > > True. > >> but we could declare the EVENT arg optional for these commands, >> and perform non-mouse logic when it's nil. > > This is what I would prefer. I think users will naturally try to use > these commands and be surprised when they don't work. But the EVENT arg in these commands already is optional. And executing them with M-x fails because interactive spec is (interactive "e"). Do you know what interactive spec to use to not raise the error "must be bound to an event with parameters" when executing with M-x? >> > 3. It would then be good to have key bindings for the above commands. >> >> tab-line-switch-to-prev-tab is already the same as 'C-x ' >> tab-line-switch-to-next-tab is already the same as 'C-x ' >> tab-line-add-tab is the same as 'C-x b' or any other buffer switching command >> tab-line-close-tab is the same as bury-buffer or quit-window (`q') > > Interesting. Could the doc strings for the tab-line-* commands refer > to the corresponding functions? I think that would help lessen the > confusion. Yes, this should be mentioned in the doc strings. >> only tab-line-select-tab could have a keybinding for referring tab by its >> absolute position. > > That would be good, yes. > >> > I suggest that the menu is >> > the optional non-default behaviour. >> >> I agree this should be configurable, like in e.g. Firefox a new tab page >> is configurable. > > Fair enough. Implemented now in the branch. >> > Here are some suggestions that are less fundamental, listed in no particular >> > order. >> > >> > 5. When I hover inactive tabs with the mouse, only the name of the tab is >> > highlighted. Can we get the entire tab highlighted instead, including the >> > section where the close button is? >> >> This is fixed now in the branch. > > Looks great. It might look even better if there is an "extra" > highlight on just the button when hovering only that. That would > provide the feedback that there is something clickable there. The > same goes for the active tab, where I see no highlight when I hover > the close button. Do you know is it possible to change image on mouse hover in Emacs? >> > 6. When I hover the close button on the currently active tab, I get a grey line >> > between the tab name and the button. Could we get rid of that line? >> >> This is fixed now. > > Looks great. > >> > 7. The active tab seems to be the same color in both the currently active window >> > and in other windows. Could we perhaps color the active tab differently >> > depending on if it's in the active window or not? >> >> This is an interesting suggestion, I'd never thought about such distinction, >> but it could be useful for additional indication of the currently selected >> window, like different faces of the mode-line indicate the selected window. > > Indeed. > >> > 8. In Firefox, the close tab button is not visible unless that tab is selected. >> > Perhaps that behaviour makes more sense, especially if we also implement the >> > "fixed size tabs that shrinks to fit" behaviour discussed elsewhere (because >> > smaller tabs make it too easy to accidentally click the close button). >> >> This Firefox behaviour is very inconvenient - to be able to close >> several tabs in a row I have first to switch to each of them that starts >> loading the page, so browser hangs for a while - very frustrating experience. >> Chromium close buttons on every tab are much better. However, you can set >> the close button variable to nil to disable close buttons. > > In my experience, there is rarely any significant loading time when > switching buffer in Emacs. > > In my opinion, removing the close buttons makes it easier to quickly > select tabs without worrying about accidentally closing them. Setting > tab-bar-close-button to nil gets rid of them altogether; what I want > is to only have a close button on the currently active tab. Perhaps > we could add a separate defcustom to make my preferred behaviour > optional? This is implemented now by new defcustom tab-line-close-button-show that has these options: - On all tabs - On selected tab - On non-selected tabs - None > That makes me wonder how we can best track these feature suggestions > for this branch? Wait until it lands on master and then file wishlist > bugs? Yes, it's better to merge to master before adding more features because it would be more difficult to merge with additional non-major features. >> > 9. It would probably look better if there was a couple of pixels of padding >> > between the tab name and the edge of the tab. >> >> Is this possible in Emacs? Could you please show an example of a text property >> that would put e.g. 5 pixels between characters in string. > > Sorry, I don't know how to do that. > > Is it possible to use variable-pitch-mode for the tab-bar only? In > that case C-x 8 RET THIN SPACE RET would probably do the trick. > > In any case, having a variable width font for the tabs in my opinion > would be a fantastic feature to have, and will probably go a long way > to make it look more polished and professional. Please try to customize the `tab-line' face with a variable width font. Do you like the result? >> > 10. Could we make the "+" sign (to add more tabs) more visually >> > distinct from the tabs? For example, it could have no borders. >> >> This is fixed now in the branch. > > Sorry to nit-pick so much, but I suggest to make it a bit bigger, to > make the background the same color as the surrounding tab bar, and to > make the lines thicker. (I also think that the close buttons could be > a bit bigger and thicker, too.) What font size do you use? >> > 14. Could we add a vertical line below the tabs to separate it from the buffer? > [...] >> >> This is fixed now in the branch, please try it. > > Yes, this looks good. > > I also see some other areas where you could perhaps look over the behaviour: > > A) > 0. emacs -Q > 1. C-x b *Messages* RET > 2. M-x global-tab-bar-mode > > I now see two tabs -- but I would expect to see only one. The *scratch* buffer was displayed in the same window, so it belongs to window's buffer list. > B) > 0. emacs -Q > 1. M-x global-tab-bar-mode > 2. Create new tab using "+" (add tab button). > 3. Run C-x > > The two tabs now switches places. I would expect them to stay where > they are unless I ask to move them. C-x tries to bring buffers from the global buffer-list and there are no more buffers except *scratch*. If you want to switch to the left tab, just press C-x . > C) > 0. emacs -Q > 1. M-x global-tab-bar-mode > 2. Click "+" (add tab button) > > In the menu, I now see the "*scratch*" buffer as an option. If I > click it, nothing happens. > Expected: I only see the other available but not open buffer. The same question applies to `mouse-buffer-menu'. If you click inside the buffer, do you expect the current buffer in the list? > D) > 0. emacs -Q > 1. M-x global-tab-bar-mode > 2. Click "+" (add tab button) > 3. Click "*Messages*" > 4. Click "+" (add tab button) > > (BTW, here I would expect to see an error message that there are no > more buffers to select or something...) This is the same question as above. > 5. Click "*scratch" > > Now I'm in the "*scratch*" buffer -- and the buffers switch places. I > suppose this is a result of the behaviour I've described above. > > E) > Finally, and I understand this could potentially be a lot of work, but > it would be fantastic if one could drag and drop tabs to have them > switch places (bonus points if one can drag them to other windows or > frames!). I already started to implement this additional feature but better to commit it after merge because it's easier to merge with less code. > Great to see that this feature is progressing so well! Thanks!