help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Child Frame naming standard.


From: Kevin Rodgers
Subject: Re: Child Frame naming standard.
Date: Mon, 27 Feb 2006 09:08:00 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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)
                                          " ")))))

--
Kevin Rodgers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]