all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Modifying Frame Title
@ 2008-05-28 17:31 Mark Elston
  2008-05-28 22:54 ` Rupert Swarbrick
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Elston @ 2008-05-28 17:31 UTC (permalink / raw)
  To: help-gnu-emacs


I would like to modify the frame title when I run GNUS (or,
possibly other times as well).

I tried the following in the *scratch* buffer:

 (modify-frame-parameters nil ((frame-title-format . "GNUS")))

This resulted in an error, though.  Is there a way to get the
frame to have a different title?

Mark


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

* Re: Modifying Frame Title
  2008-05-28 17:31 Modifying Frame Title Mark Elston
@ 2008-05-28 22:54 ` Rupert Swarbrick
  2008-05-28 23:05   ` Johan Bockgård
  2008-05-29  0:47   ` Mark Elston
  0 siblings, 2 replies; 7+ messages in thread
From: Rupert Swarbrick @ 2008-05-28 22:54 UTC (permalink / raw)
  To: help-gnu-emacs

Mark Elston <m.elston@advantest-ard.com> writes:

> I would like to modify the frame title when I run GNUS (or,
> possibly other times as well).
>
> I tried the following in the *scratch* buffer:
>
>  (modify-frame-parameters nil ((frame-title-format . "GNUS")))
>
> This resulted in an error, though.  Is there a way to get the
> frame to have a different title?
>
> Mark

The reason for the debugger error is that you need to quote the alist
you're parsing, like so:

  (modify-frame-parameters nil '((frame-title-format . "GNUS")))

                     HERE -----^

Otherwise emacs thinks you're asking it to run the function referred to by 

  (frame-title-format . "GNUS")

with no arguments. And that itself would try to run the
frame-title-format function I think (which doesn't exist). Eugh.

ANYHOW, that still won't work, since frame-title-format isn't for that
- it's a normal variable to decide on a name to give the frame if
no-one's set it explicitely (look up C-h v frame-title-format).

What you want appears to be

  (modify-frame-parameters nil '((name . "GNUS")))

Note that I've never done this before, and worked this out from
reading the help strings, but the frame name hasn't changed when I've
switched buffers here, so I presume I've got it right!



Rupert



P.S. To work out that I needed to change "name" (I couldn't see it
     immediately in the docs), I outputted the current frame params
     with (frame-parameters). Unfortunately, there's enough stuff that
     this gets abbreviated in the message line to (blah blah ...). So
     I used the following hack in a temporary buffer:

       (insert (format "%s" (frame-parameters)))

     Maybe that trick'll come in useful someday.


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

* Re: Modifying Frame Title
  2008-05-28 22:54 ` Rupert Swarbrick
@ 2008-05-28 23:05   ` Johan Bockgård
  2008-05-28 23:21     ` Rupert Swarbrick
  2008-05-29  0:47   ` Mark Elston
  1 sibling, 1 reply; 7+ messages in thread
From: Johan Bockgård @ 2008-05-28 23:05 UTC (permalink / raw)
  To: help-gnu-emacs

Rupert Swarbrick <rswarbrick@gmail.com> writes:

> I outputted the current frame params with
> (frame-parameters). Unfortunately, there's enough stuff that this gets
> abbreviated in the message line to (blah blah ...). So I used the
> following hack in a temporary buffer:

You can use C-u C-x C-e (and, in *scratch*, C-j) to eval an expression
and print its value into a buffer, and then use RET on the value to
toggle abbreviation.

-- 
Johan Bockgård


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

* Re: Modifying Frame Title
  2008-05-28 23:05   ` Johan Bockgård
@ 2008-05-28 23:21     ` Rupert Swarbrick
  2008-05-28 23:25       ` Rupert Swarbrick
  0 siblings, 1 reply; 7+ messages in thread
From: Rupert Swarbrick @ 2008-05-28 23:21 UTC (permalink / raw)
  To: help-gnu-emacs

bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

> Rupert Swarbrick <rswarbrick@gmail.com> writes:
>
>> I outputted the current frame params with
>> (frame-parameters). Unfortunately, there's enough stuff that this gets
>> abbreviated in the message line to (blah blah ...). So I used the
>> following hack in a temporary buffer:
>
> You can use C-u C-x C-e (and, in *scratch*, C-j) to eval an expression
> and print its value into a buffer, and then use RET on the value to
> toggle abbreviation.
>
Ah. I thought there should be a better way... Thanks!

Rupert


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

* Re: Modifying Frame Title
  2008-05-28 23:21     ` Rupert Swarbrick
@ 2008-05-28 23:25       ` Rupert Swarbrick
  2008-05-28 23:34         ` Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Rupert Swarbrick @ 2008-05-28 23:25 UTC (permalink / raw)
  To: help-gnu-emacs

Rupert Swarbrick <rswarbrick@gmail.com> writes:

> bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
>> You can use C-u C-x C-e (and, in *scratch*, C-j) to eval an expression
>> and print its value into a buffer, and then use RET on the value to
>> toggle abbreviation.
>>
> Ah. I thought there should be a better way... Thanks!
>
> Rupert

Hmm, I like the abbreviation toggling by the way. Can you explain how
on earth it sets up the keybinding? Since <return> inserts newlines
elsewhere in the buffer and C-h c says newline then and
last-sexp-toggle-display when you're over it. Very swish!

Rupert


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

* Re: Modifying Frame Title
  2008-05-28 23:25       ` Rupert Swarbrick
@ 2008-05-28 23:34         ` Johan Bockgård
  0 siblings, 0 replies; 7+ messages in thread
From: Johan Bockgård @ 2008-05-28 23:34 UTC (permalink / raw)
  To: help-gnu-emacs

Rupert Swarbrick <rswarbrick@gmail.com> writes:

> Hmm, I like the abbreviation toggling by the way. Can you explain how
> on earth it sets up the keybinding? Since <return> inserts newlines
> elsewhere in the buffer and C-h c says newline then and
> last-sexp-toggle-display when you're over it. Very swish!

It uses the `keymap' text property (try `C-u C-x =' on the text).

-- 
Johan Bockgård


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

* Re: Modifying Frame Title
  2008-05-28 22:54 ` Rupert Swarbrick
  2008-05-28 23:05   ` Johan Bockgård
@ 2008-05-29  0:47   ` Mark Elston
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Elston @ 2008-05-29  0:47 UTC (permalink / raw)
  To: help-gnu-emacs

Rupert Swarbrick <rswarbrick@gmail.com> writes:

> Mark Elston <m.elston@advantest-ard.com> writes:
>
>> I would like to modify the frame title when I run GNUS (or,
>> possibly other times as well).
>>
>> I tried the following in the *scratch* buffer:
>>
>>  (modify-frame-parameters nil ((frame-title-format . "GNUS")))
>>
>> This resulted in an error, though.  Is there a way to get the
>> frame to have a different title?
>>
>> Mark
>
> ...
>
> What you want appears to be
>
>   (modify-frame-parameters nil '((name . "GNUS")))
>
> Note that I've never done this before, and worked this out from
> reading the help strings, but the frame name hasn't changed when I've
> switched buffers here, so I presume I've got it right!
>

Great, Rupert.  Works like a charm.

Now I just need to add it to a hook function and I'm all set...

Mark


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

end of thread, other threads:[~2008-05-29  0:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 17:31 Modifying Frame Title Mark Elston
2008-05-28 22:54 ` Rupert Swarbrick
2008-05-28 23:05   ` Johan Bockgård
2008-05-28 23:21     ` Rupert Swarbrick
2008-05-28 23:25       ` Rupert Swarbrick
2008-05-28 23:34         ` Johan Bockgård
2008-05-29  0:47   ` Mark Elston

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.