From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: XeCycle Newsgroups: gmane.emacs.help Subject: Re: after-make-frame-functions Date: Sun, 20 Nov 2011 12:31:56 +0800 Message-ID: <87mxbrjtxf.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321763547 7038 80.91.229.12 (20 Nov 2011 04:32:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 20 Nov 2011 04:32:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 20 05:32:21 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RRz4n-0003Qf-8l for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Nov 2011 05:32:21 +0100 Original-Received: from localhost ([::1]:41889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRz4m-00063W-H6 for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Nov 2011 23:32:20 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRz4f-00063G-5p for help-gnu-emacs@gnu.org; Sat, 19 Nov 2011 23:32:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRz4b-0005GS-7v for help-gnu-emacs@gnu.org; Sat, 19 Nov 2011 23:32:13 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:60269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRz4b-0005GO-2r for help-gnu-emacs@gnu.org; Sat, 19 Nov 2011 23:32:09 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RRz4Z-0003Nt-IB for help-gnu-emacs@gnu.org; Sun, 20 Nov 2011 05:32:07 +0100 Original-Received: from 59.78.37.25 ([59.78.37.25]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Nov 2011 05:32:07 +0100 Original-Received: from xecycle by 59.78.37.25 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Nov 2011 05:32:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 59.78.37.25 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:6g9jmL9FHrxxDENkhj9SUNIkHdo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82975 Archived-At: kenneth johansson writes: > Using GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.5) > > I'm trying to make some changes to a new frame but it looks like the > function run on the hook after-make-frame-functions is affecting the > old frame not the new one. > > Add the following hook. start emacs with > > emacs --daemon > emacsclient -c > > and you will get a printout in messages that the frame is in a terminal. > But that is not what I expect, the new frame is a window. > > bug or feature ?? > > ------------ > (defun start-theme (dummy) > (if window-system > (message "frame in window") > (message "frame in terminal") > ) > ) (defun your-func (new-frame) (select-frame new-frame) (do-what-you-want)) > (add-hook 'after-make-frame-functions 'start-theme) > ----------- > > > -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591