[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Child Frame naming standard.
From: |
Galen Boyer |
Subject: |
Re: Child Frame naming standard. |
Date: |
27 Feb 2006 18:45:02 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
On Mon, 27 Feb 2006, ihs_4664@yahoo.com wrote:
> Galen Boyer wrote:
>> Is there a way that if a child frame were created, C-x 5 0, and
>> subsequently M-x set-frame-name, that the name I give it could be
>> concatenated with the parental frame, at all times?
>> Parent frame name = "ProjectX"
>> Child frame rename = "Branch"
>> Actual Child frame name after rename = "ProjectX [Branch]"
>
> As far as I know, Emacs does not keep track of which frame was
> selected (the parent) when a new frame is created (the child). But
> you should be able to do that explicitly:
>
> (add-hook 'after-make-frame-functions
> (lambda (frame)
> (modify-frame-parameters frame
> `((parent-frame
> . ,(selected-frame))))))
>
> (defadvice set-frame-name (before interactive activate)
> "When called interactively, provide the parent frame's name as
> the initial input."
> (interactive (list (read-string "Frame name: "
> (concat (frame-parameter
> (frame-parameter
> (selected-frame)
> 'parent-frame)
> 'name)
> " ")))))
Thanks Kevin,
I'll give this a shot.
--
Galen Boyer