Custom frame title in Emacs

1

I'm using Emacs and I find quite annoying the default frame (aka window) title that is user@host especially when I have several frames opened. Searching around I found that it's possible to change that by editing the variable frame-title-format; so I did it, I changed it to "%b" (for example) and that worked.

Now the issue: after exactly 30 seconds I minimized the frame the title switches back to user@host until I focus again on the frame.

I tried to write in my ~/.emacs:

(setq frame-title-format "%b")

and I even tried to customize it:

(custom-set-variables
 ; [...]
 '(frame-title-format "%b")
)

with no luck.

DETAILS:

  • GNU Emacs 23.2.1

  • Debian Squeeze

  • Openbox

Am I missing something?

cYrus

Posted 2010-10-17T18:44:12.107

Reputation: 18 102

1What version of Emacs are you using, under what operating system? Can you reproduce this behavior with a .emacs that only contains (setq frame-title-format "%b")? – Gilles 'SO- stop being evil' – 2010-10-17T19:45:10.603

Edited. Yes, it's the same with a ~/.emacs that only contains (setq frame-title-format "%b"). – cYrus – 2010-10-17T20:04:03.300

Do you have a way to reproduce the problem, or does it happen randomly “after a while”? What is your window manager or desktop environment (not that I think it should matter)? (By the way, yes, it should work the way you think, and it does for me with Emacs 23.1.1 on Ubuntu.) – Gilles 'SO- stop being evil' – 2010-10-17T21:22:01.897

Surprisingly, "after a while" = 30 seconds. – cYrus – 2010-10-17T21:46:28.527

Answers

4

I have this in my .emacs:

(setq frame-title-format "%b")
(setq icon-title-format "%b")

And it works for me (GNU Emacs 23.1.1).

If it continues to not work for you, try running a plain-vanilla emacs session (emacs -q --no-site-init), then add the above two lines and then try it. If it works then something in your .emacs file (or the site-wide .emacs file) is in conflict.

Joe Casadonte

Posted 2010-10-17T18:44:12.107

Reputation: 3 945

Yes, thank you, that worked! For some reason after a while icon-title-format is used rather than frame-title-format; setting both to the same value solved my problem. – cYrus – 2010-10-20T15:09:32.777

0

(modify-frame-parameters (selected-frame) (list (cons 'name "The New Title")))

does the trick for me.

pmr

Posted 2010-10-17T18:44:12.107

Reputation: 194

Yes thanks, it does the trick but this way I cannot have the same behavior of "%b": shows the current buffer. – cYrus – 2010-10-17T20:43:54.163