From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Frame size changes Date: Sun, 05 Oct 2008 22:08:15 +0200 Message-ID: <48E91EAF.6060506@swipnet.se> References: <877i8qvq5k.fsf@cyd.mit.edu> <48E5C4E5.9040400@swipnet.se> <873ajdtuhz.fsf@cyd.mit.edu> <48E7191F.7060407@swipnet.se> <87od1y99gi.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223237381 3486 80.91.229.12 (5 Oct 2008 20:09:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2008 20:09:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 05 22:10:39 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KmZw0-0004Sb-Ft for ged-emacs-devel@m.gmane.org; Sun, 05 Oct 2008 22:10:32 +0200 Original-Received: from localhost ([127.0.0.1]:35754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmZux-0003hh-3n for ged-emacs-devel@m.gmane.org; Sun, 05 Oct 2008 16:09:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KmZus-0003gv-No for emacs-devel@gnu.org; Sun, 05 Oct 2008 16:09:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KmZuq-0003gA-DL for emacs-devel@gnu.org; Sun, 05 Oct 2008 16:09:22 -0400 Original-Received: from [199.232.76.173] (port=38546 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmZuq-0003g4-7V for emacs-devel@gnu.org; Sun, 05 Oct 2008 16:09:20 -0400 Original-Received: from proxy2.bredband.net ([195.54.101.72]:49260) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KmZup-0000vZ-Qw for emacs-devel@gnu.org; Sun, 05 Oct 2008 16:09:20 -0400 Original-Received: from ironport2.bredband.com (195.54.101.122) by proxy2.bredband.net (7.3.127) id 48DC49FD002A8255 for emacs-devel@gnu.org; Sun, 5 Oct 2008 22:09:08 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQ2ALu76EhV4S2yPGdsb2JhbACBcZFiAQEBATWkLoFq Original-Received: from c-b22de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO husetbladh.homeip.net) ([85.225.45.178]) by ironport2.bredband.com with ESMTP; 05 Oct 2008 22:09:08 +0200 User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) In-Reply-To: <87od1y99gi.fsf@cyd.mit.edu> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104352 Archived-At: Chong Yidong skrev: > How about the proposed solution (patch included): > > The variable after-init-time (new to Emacs 23) is set to `current-time' > after initialization. Since it's nil during initialization, we can use > it to tell if Emacs is currently being initialized. Suppose we make > after-init-time a built-in variable. Then, make x_wm_set_size_hint a > no-op when after-init-time is nil. The result is that WM hints are not > set during initialization. > > According to my (non-thorough) testing, this eliminates the erratic > frame sizing during startup, without introducing any other ill effects. > > What do you think? Sounds very interesting. I'd say check it in so we can get it tested by pretesters. Good work! Jan D. > > > *** trunk/lisp/startup.el.~1.507.~ 2008-10-02 16:21:54.000000000 -0400 > --- trunk/lisp/startup.el 2008-10-05 14:17:47.000000000 -0400 > *************** > *** 257,268 **** > therefore, if you set `debug-on-error' non-nil in `.emacs', > an error in one of these functions will invoke the debugger.") > > - (defvar before-init-time nil > - "Value of `current-time' before Emacs begins initialization.") > - > - (defvar after-init-time nil > - "Value of `current-time' after loading the init files.") > - > (defvar emacs-startup-hook nil > "Normal hook run after loading init files and handling the command line.") > > --- 257,262 ---- > > *** trunk/src/lisp.h.~1.644.~ 2008-09-24 16:14:33.000000000 -0400 > --- trunk/src/lisp.h 2008-10-05 14:23:45.000000000 -0400 > *************** > *** 3102,3107 **** > --- 3102,3108 ---- > /* defined in emacs.c */ > extern Lisp_Object decode_env_path P_ ((char *, char *)); > extern Lisp_Object Vinvocation_name, Vinvocation_directory; > + extern Lisp_Object Vbefore_init_time, Vafter_init_time; > extern Lisp_Object Vinstallation_directory; > extern Lisp_Object empty_unibyte_string, empty_multibyte_string; > EXFUN (Fkill_emacs, 1); > *** trunk/src/emacs.c.~1.447.~ 2008-10-05 14:07:06.000000000 -0400 > --- trunk/src/emacs.c 2008-10-05 14:27:01.000000000 -0400 > *************** > *** 131,136 **** > --- 131,139 ---- > nil means get them only from PATH_LOADSEARCH. */ > Lisp_Object Vinstallation_directory; > > + /* The values of `current-time' before and after Emacs initialization. */ > + Lisp_Object Vbefore_init_time, Vafter_init_time; > + > /* Hook run by `kill-emacs' before it does really anything. */ > Lisp_Object Vkill_emacs_hook; > > *************** > *** 2497,2502 **** > --- 2500,2513 ---- > DEFVAR_LISP ("previous-system-time-locale", &Vprevious_system_time_locale, > doc: /* Most recently used system locale for time. */); > Vprevious_system_time_locale = Qnil; > + > + DEFVAR_LISP ("before-init-time", &Vbefore_init_time, > + doc: /* Value of `current-time' before Emacs begins initialization. */); > + Vbefore_init_time = Qnil; > + > + DEFVAR_LISP ("after-init-time", &Vafter_init_time, > + doc: /* Value of `current-time' after loading the init files. */); > + Vafter_init_time = Qnil; > } > > /* arch-tag: 7bfd356a-c720-4612-8ab6-aa4222931c2e > *** trunk/src/gtkutil.c.~1.138.~ 2008-07-29 12:15:41.000000000 -0400 > --- trunk/src/gtkutil.c 2008-10-05 14:22:01.000000000 -0400 > *************** > *** 934,939 **** > --- 934,942 ---- > long flags; > int user_position; > { > + if (NILP (Vafter_init_time)) > + return; > + > if (FRAME_GTK_OUTER_WIDGET (f)) > { > /* Must use GTK routines here, otherwise GTK resets the size hints >