unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* tab-line-tab-modified: cool feature... not yet there
@ 2021-09-26 10:20 Pedro Andres Aranda Gutierrez
  2021-09-27 15:41 ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2021-09-26 10:20 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

Hi,

I'm really excited with this tab-line-tab-modified customizable face. In my
case I have two themes, which I use depending on the light conditions (one
dark and one light) and I have a function to switch themes, very much as
explained in

https://stackoverflow.com/questions/23793288/cycle-custom-themes-w-emacs-24

Now, what I see is that the font isn't changed if I call customize-face
from lisp (i.e. in my code) It does, however, when I call it interactively
(M-x customize-face). That looks really weird to me.

Any help appreciated...

Best,/PA

PS:
In GNU Emacs 28.0.50 (build 2, x86_64-apple-darwin19.6.0, NS appkit-1894.60
Version 10.15.7 (Build 19H1419))
 of 2021-09-26 built on paag-MacBookAir
Repository revision: 27d8726ae29a1441dba776d7d3d0685ef85a3fdf
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.7

Configured using:
 'configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
 LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include CC=clang
 OBJC=clang 'CFLAGS=-g -O3''

Checking on Linux in a couple of minutes....
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

[-- Attachment #2: Type: text/html, Size: 1873 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
  2021-09-26 10:20 tab-line-tab-modified: cool feature... not yet there Pedro Andres Aranda Gutierrez
@ 2021-09-27 15:41 ` Juri Linkov
  0 siblings, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2021-09-27 15:41 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Adam Porter, emacs-devel

> I'm really excited with this tab-line-tab-modified customizable face. In my
> case I have two themes, which I use depending on the light conditions (one
> dark and one light) and I have a function to switch themes, very much as
> explained in
>
> https://stackoverflow.com/questions/23793288/cycle-custom-themes-w-emacs-24
>
> Now, what I see is that the font isn't changed if I call customize-face
> from lisp (i.e. in my code) It does, however, when I call it interactively
> (M-x customize-face). That looks really weird to me.
>
> Any help appreciated...

It's not clear how do you call customize-face, but this has no problems:

  (set-face-foreground 'tab-line-tab-modified "darkgreen")

This is how I switch faces depending on the light conditions.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
       [not found] ` <6764B7C0-D125-4E1C-B030-4D7FEAC02980@gmail.com>
@ 2021-10-02  7:19   ` Adam Porter
  2021-10-02 19:42     ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Porter @ 2021-10-02  7:19 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: emacs-devel, Juri Linkov

Hi Juri, Pedro,

Not sure why this thread was moved off-list.  I'll add it back.

> > El 28 sept 2021, a las 21:04, Juri Linkov <juri@linkov.net> escribió:

> > Thanks, now everything is clear.  The problem is that it changes the color
> > of the tab only after you switch to another buffer.  I don't know whether
> > the author Adam (Cc'ed) intended this.  It makes sense not to change
> > the color of the current tab immediately to not distract the user.

On Wed, Sep 29, 2021 at 12:00 AM Pedro Andres Aranda Gutierrez
<paaguti@gmail.com> wrote:

> I don’t know if changing the colour in the tab distracts or confuses. At least it seems to confuse me ;-) I would expect the tab to change at the same time as the mode-line in order to have consistent information on the screen. I don’t like to be told different things by the tab line and the mode line ;-)

The patch I submitted doesn't have any effect on how or when the
tab-line is updated.  I've also noticed the effect you describe, that
the tab-line doesn't update until I change to another buffer, but ISTM
that that's an orthogonal issue.  The tab-bar does update with
redisplay, while the tab-line seems to only update on buffer-switch,
or something like that.  If the tab-line should update with redisplay,
I guess that could be done.  I guess it might be relevant to redisplay
performance, but Juri should know about that; maybe that's why it
doesn't already do that.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
  2021-10-02  7:19   ` Adam Porter
@ 2021-10-02 19:42     ` Juri Linkov
  2021-10-03  5:25       ` Pedro Andres Aranda Gutierrez
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2021-10-02 19:42 UTC (permalink / raw)
  To: Adam Porter; +Cc: Pedro Andres Aranda Gutierrez, emacs-devel

>> > Thanks, now everything is clear.  The problem is that it changes the color
>> > of the tab only after you switch to another buffer.  I don't know whether
>> > the author Adam (Cc'ed) intended this.  It makes sense not to change
>> > the color of the current tab immediately to not distract the user.
>>
>> I don’t know if changing the colour in the tab distracts or confuses. At
>> least it seems to confuse me ;-) I would expect the tab to change at the
>> same time as the mode-line in order to have consistent information on the
>> screen. I don’t like to be told different things by the tab line and the
>> mode line ;-)
>
> The patch I submitted doesn't have any effect on how or when the
> tab-line is updated.  I've also noticed the effect you describe, that
> the tab-line doesn't update until I change to another buffer, but ISTM
> that that's an orthogonal issue.  The tab-bar does update with
> redisplay, while the tab-line seems to only update on buffer-switch,
> or something like that.  If the tab-line should update with redisplay,
> I guess that could be done.  I guess it might be relevant to redisplay
> performance, but Juri should know about that; maybe that's why it
> doesn't already do that.

Indeed, it's related to redisplay performance, so it was optimized by caching
to update the tab-line only on buffer switching, not on every key press.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
  2021-10-02 19:42     ` Juri Linkov
@ 2021-10-03  5:25       ` Pedro Andres Aranda Gutierrez
  2021-10-03 17:17         ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2021-10-03  5:25 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Adam Porter, emacs-devel

Hi, I've seen a couple of ideas in the internet on how to spped his up. You could use the buffer-change hooks and defadvice on undo and would be much less than on every keypress, right? I think this could be a good compromise

Best, /PA

Enviado desde mi iPad

El 2 oct 2021, a las 21:42, Juri Linkov <juri@linkov.net> escribió:

>>>> Thanks, now everything is clear.  The problem is that it changes the color
>>>> of the tab only after you switch to another buffer.  I don't know whether
>>>> the author Adam (Cc'ed) intended this.  It makes sense not to change
>>>> the color of the current tab immediately to not distract the user.
>>> 
>>> I don’t know if changing the colour in the tab distracts or confuses. At
>>> least it seems to confuse me ;-) I would expect the tab to change at the
>>> same time as the mode-line in order to have consistent information on the
>>> screen. I don’t like to be told different things by the tab line and the
>>> mode line ;-)
>> 
>> The patch I submitted doesn't have any effect on how or when the
>> tab-line is updated.  I've also noticed the effect you describe, that
>> the tab-line doesn't update until I change to another buffer, but ISTM
>> that that's an orthogonal issue.  The tab-bar does update with
>> redisplay, while the tab-line seems to only update on buffer-switch,
>> or something like that.  If the tab-line should update with redisplay,
>> I guess that could be done.  I guess it might be relevant to redisplay
>> performance, but Juri should know about that; maybe that's why it
>> doesn't already do that.
> 
> Indeed, it's related to redisplay performance, so it was optimized by caching
> to update the tab-line only on buffer switching, not on every key press.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
  2021-10-03  5:25       ` Pedro Andres Aranda Gutierrez
@ 2021-10-03 17:17         ` Juri Linkov
  2021-10-04  5:10           ` Pedro Andres Aranda Gutierrez
  2021-10-04  7:35           ` Pedro Andres Aranda Gutierrez
  0 siblings, 2 replies; 8+ messages in thread
From: Juri Linkov @ 2021-10-03 17:17 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: Adam Porter, emacs-devel

> Hi, I've seen a couple of ideas in the internet on how to spped his up. You
> could use the buffer-change hooks and defadvice on undo and would be much
> less than on every keypress, right? I think this could be a good compromise

Fortunately, it was much easier to implement this by adding
just these 3 lines to tab-line-format:

+                          (and (memq 'tab-line-tab-face-modified
+                                     tab-line-tab-face-functions)
+                               (buffer-file-name) (buffer-modified-p))))

So now this is fixed in the emacs-28 branch.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
  2021-10-03 17:17         ` Juri Linkov
@ 2021-10-04  5:10           ` Pedro Andres Aranda Gutierrez
  2021-10-04  7:35           ` Pedro Andres Aranda Gutierrez
  1 sibling, 0 replies; 8+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2021-10-04  5:10 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Adam Porter, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

will check :-)

/PA

On Sun, 3 Oct 2021 at 19:21, Juri Linkov <juri@linkov.net> wrote:

> > Hi, I've seen a couple of ideas in the internet on how to spped his up.
> You
> > could use the buffer-change hooks and defadvice on undo and would be much
> > less than on every keypress, right? I think this could be a good
> compromise
>
> Fortunately, it was much easier to implement this by adding
> just these 3 lines to tab-line-format:
>
> +                          (and (memq 'tab-line-tab-face-modified
> +                                     tab-line-tab-face-functions)
> +                               (buffer-file-name) (buffer-modified-p))))
>
> So now this is fixed in the emacs-28 branch.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

[-- Attachment #2: Type: text/html, Size: 1368 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: tab-line-tab-modified: cool feature... not yet there
  2021-10-03 17:17         ` Juri Linkov
  2021-10-04  5:10           ` Pedro Andres Aranda Gutierrez
@ 2021-10-04  7:35           ` Pedro Andres Aranda Gutierrez
  1 sibling, 0 replies; 8+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2021-10-04  7:35 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Adam Porter, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

Cool! Everything is consistent right now:-)

Thanks a ton! /PA

On Sun, 3 Oct 2021 at 19:21, Juri Linkov <juri@linkov.net> wrote:

> > Hi, I've seen a couple of ideas in the internet on how to spped his up.
> You
> > could use the buffer-change hooks and defadvice on undo and would be much
> > less than on every keypress, right? I think this could be a good
> compromise
>
> Fortunately, it was much easier to implement this by adding
> just these 3 lines to tab-line-format:
>
> +                          (and (memq 'tab-line-tab-face-modified
> +                                     tab-line-tab-face-functions)
> +                               (buffer-file-name) (buffer-modified-p))))
>
> So now this is fixed in the emacs-28 branch.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

[-- Attachment #2: Type: text/html, Size: 1411 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-04  7:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 10:20 tab-line-tab-modified: cool feature... not yet there Pedro Andres Aranda Gutierrez
2021-09-27 15:41 ` Juri Linkov
     [not found] <87ilykpnqb.fsf@mail.linkov.net>
     [not found] ` <6764B7C0-D125-4E1C-B030-4D7FEAC02980@gmail.com>
2021-10-02  7:19   ` Adam Porter
2021-10-02 19:42     ` Juri Linkov
2021-10-03  5:25       ` Pedro Andres Aranda Gutierrez
2021-10-03 17:17         ` Juri Linkov
2021-10-04  5:10           ` Pedro Andres Aranda Gutierrez
2021-10-04  7:35           ` Pedro Andres Aranda Gutierrez

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).