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: Problem setting frame title on startup Date: Mon, 18 Mar 2013 13:40:42 +0800 Message-ID: <87a9q1jmed.fsf@xc.laptop> References: <20130315195145.GA18986@earth> <20130316102434.GA3320@earth> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1363585525 8310 80.91.229.3 (18 Mar 2013 05:45:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Mar 2013 05:45:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 18 06:45:44 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UHStA-00066a-HR for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Mar 2013 06:45:40 +0100 Original-Received: from localhost ([::1]:37328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHSsn-00018P-Lt for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Mar 2013 01:45:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHSsd-00016L-By for help-gnu-emacs@gnu.org; Mon, 18 Mar 2013 01:45:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHSsc-0001BC-F5 for help-gnu-emacs@gnu.org; Mon, 18 Mar 2013 01:45:07 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:53621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHSsc-0001A7-8U for help-gnu-emacs@gnu.org; Mon, 18 Mar 2013 01:45:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UHSsw-0005uR-3L for help-gnu-emacs@gnu.org; Mon, 18 Mar 2013 06:45:26 +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 ; Mon, 18 Mar 2013 06:45:26 +0100 Original-Received: from XeCycle by 59.78.37.25 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Mar 2013 06:45:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 59.78.37.25 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:VW9x7fE49Vsb1Ekh8LE63CMwFwE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:89574 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ian van der Neut writes: [...] > In normal mode (just starting 'emacs filename' from the command line, rat= her > than emacsclient) it doesn't show the project name until I open a new fra= me, > then both frames get the right frame title. If Emacs is started as `emacs --daemon`, there would be no frame while executing .emacs. If not started as a daemon, there would be one, but after-make-frame-functions won't be executed for this frame. Therefore I wrote this macro: (require 'cl) (defmacro do-frames (&rest body) (let ((frame (gensym))) `(progn (dolist (,frame (frame-list)) (select-frame ,frame) ,@body) (add-hook 'after-make-frame-functions (lambda (new-frame) (select-frame new-frame) ,@body))))) And (do-frames (what-ever you-like)) would work for all frames, either started as daemon or not. =2D-=20 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 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAEBAgAGBQJRRqjdAAoJEI1xjsR3leWRpXkH+gNekSSO77LL2FDO7qYGGUhb RcHe0Oit1L0GRcpFlsLxmTdC1YaYqqfDDjqrk+4YqN17qBLNkIB77gGbz4agyLKA QO9Ed0jOGV+UL/SXDIX9GCDR0L+Xo0P6UrhJmRdl/yugG3DsUCEnfkPCFU9Wf4Zg YNSxDq/ajo0264yarbosIyDxJvmK1y1CJgM+ifNsQUZI3c8ZisQdJ+jIJ0a4KBlD NLmm67Y6bKs/uMkw7LSoBLwY6jm4Dzx3TABBnjiCFWMFk0iaP9nm5FJiWHT+iM4s YqdY1KSOlxQB2pMI9qvl3qFQ+B+8QK+G9HopQ0VwMtcpRuIfnxJepjU4dngT+nk= =1g2F -----END PGP SIGNATURE----- --=-=-=--