From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#15133: 24.3.50; REGRESSION: `after-make-frame-functions' now run with wrong frame selected Date: Mon, 19 Aug 2013 08:01:20 -0700 (PDT) Message-ID: <6bb534ef-d80b-4c35-9538-2ee383d95610@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1376924608 23022 80.91.229.3 (19 Aug 2013 15:03:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Aug 2013 15:03:28 +0000 (UTC) To: 15133@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 19 17:03:28 2013 Return-path: Envelope-to: geb-bug-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 1VBQzQ-0005fA-77 for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2013 17:03:28 +0200 Original-Received: from localhost ([::1]:43594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQzP-0005ZI-FT for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2013 11:03:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQzC-0005S4-2E for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:03:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBQz1-0000u7-Gn for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:03:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQz1-0000tr-C2 for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VBQz0-0005eT-Po for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2013 15:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15133 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137692452521638 (code B ref -1); Mon, 19 Aug 2013 15:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Aug 2013 15:02:05 +0000 Original-Received: from localhost ([127.0.0.1]:40505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBQy3-0005cs-MO for submit@debbugs.gnu.org; Mon, 19 Aug 2013 11:02:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40654) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBQxx-0005cG-Hi for submit@debbugs.gnu.org; Mon, 19 Aug 2013 11:01:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBQxi-0000Ph-83 for submit@debbugs.gnu.org; Mon, 19 Aug 2013 11:01:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQxi-0000Pd-5X for submit@debbugs.gnu.org; Mon, 19 Aug 2013 11:01:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQxZ-0004eb-Ga for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:01:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBQxQ-0000LD-RW for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:01:33 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:34475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQxQ-0000Km-Ja for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:01:24 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7JF1I1n025572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Aug 2013 15:01:21 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7JF1Hx3020902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 19 Aug 2013 15:01:18 GMT Original-Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7JF1Hd5020865 for ; Mon, 19 Aug 2013 15:01:17 GMT X-Priority: 2 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77509 Archived-At: This regression was introduced after a build from 2013-08-08. It appears in the build cited below, from 2013-08-18. It makes Emacs unusable (by me). I have this as `after-make-frame-functions': `(fit-frame)', in order to fit the new frame to its displayed buffer.' When `after-make-frame-functions' is run in `make-frame' now, the original frame, not the newly created frame, is selected when it runs. So `fit-frame' is called with the original (wrong) frame selected. Here is a snapshot from the debugger: Debugger entered--entering a function: * fit-frame(#) * run-hook-with-args(fit-frame #) * (let* ((display (cdr (assq (quote display) parameters))) (w (cond ((assq = =3D (quote terminal) parameters) (let ((type ...)) (cond (... nil) (... ...) (t= =3D type)))) ((assq (quote window-system) parameters) (cdr (assq (quote window= =3D -system) parameters))) (display (or (window-system-for-display display) (er= =3D ror "Don't know how to interpret display \"%S\"" display))) (t window-syste= =3D m))) (frame-creation-function (cdr (assq w frame-creation-function-alist)))= =3D (oldframe (selected-frame)) (params parameters) frame) (if frame-creation-= =3D function nil (error "Don't know how to create a frame on window system %s" = =3D w)) (if (get w (quote window-system-initialized)) nil (funcall (cdr (assq w= =3D window-system-initialization-alist)) display) (setq x-display-name display= =3D ) (put w (quote window-system-initialized) t)) (progn (let ((--dolist-tail-= =3D - (cdr (assq w window-system-default-frame-alist))) p) (while --dolist-tail= =3D -- (setq p (car --dolist-tail--)) (if (assq (car p) params) nil (setq param= =3D s (cons p params))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (progn = =3D (let ((--dolist-tail-- default-frame-alist) p) (while --dolist-tail-- (setq= =3D p (car --dolist-tail--)) (if (assq (car p) params) nil (setq params (cons = =3D p params))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (run-hooks (quo= =3D te before-make-frame-hook)) (setq frame (funcall frame-creation-function pa= =3D rams)) (normal-erase-is-backspace-setup-frame frame) (progn (let ((--dolist= =3D -tail-- frame-inherited-parameters) param) (while --dolist-tail-- (setq par= =3D am (car --dolist-tail--)) (if (assq param parameters) nil (let ((val ...)) = =3D (if val (progn ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (run= =3D -hook-with-args (quote after-make-frame-functions) frame) frame) * (lambda (&optional parameters) "Return a newly created frame displaying t= =3D he current buffer.\nOptional argument PARAMETERS is an alist of frame param= =3D eters for\nthe new frame. Each element of PARAMETERS should have the\nform= =3D (NAME . VALUE), for example:\n\n (name . STRING)=09The frame should be nam= ed=3D STRING.\n\n (width . NUMBER)=09The frame should be NUMBER characters in wi= dt=3D h.\n (height . NUMBER)=09The frame should be NUMBER text lines high.\n\nYou= c=3D annot specify either `width' or `height', you must specify\nneither or both= =3D .\n\n (minibuffer . t)=09The frame should have a minibuffer.\n (minibuffer = . =3D nil)=09The frame should have no minibuffer.\n (minibuffer . only)=09The fra= me s=3D hould contain only a minibuffer.\n (minibuffer . WINDOW)=09The frame should= u=3D se WINDOW as its minibuffer window.\n\n (window-system . nil)=09The frame s= ho=3D uld be displayed on a terminal device.\n (window-system . x)=09The frame sh= ou=3D ld be displayed in an X window.\n\n (display . \":0\") The frame should= =3D appear on display :0.\n\n (terminal . TERMINAL) The frame should use the = =3D terminal object TERMINAL.\n\nIn addition, any parameter specified in `defau= =3D lt-frame-alist',\nbut not present in PARAMETERS, is applied.\n\nBefore crea= =3D ting the frame (via `frame-creation-function-alist'),\nthis function runs t= =3D he hook `before-make-frame-hook'. After\ncreating the frame, it runs the h= =3D ook `after-make-frame-functions'\nwith one arg, the newly created frame.\n\= =3D nIf a display parameter is supplied and a window-system is not,\nguess the = =3D window-system from the display.\n\nOn graphical displays, this function doe= =3D s not itself make the new\nframe the selected frame. However, the window s= =3D ystem may select\nthe new frame according to its own rules." (interactive) = =3D (let* ((display (cdr (assq (quote display) parameters))) (w (cond ((assq (q= =3D uote terminal) parameters) (let (...) (cond ... ... ...))) ((assq (quote wi= =3D ndow-system) parameters) (cdr (assq ... parameters))) (display (or (window-= =3D system-for-display display) (error "Don't know how to interpret display \"%= =3D S\"" display))) (t window-system))) (frame-creation-function (cdr (assq w f= =3D rame-creation-function-alist))) (oldframe (selected-frame)) (params paramet= =3D ers) frame) (if frame-creation-function nil (error "Don't know how to creat= =3D e a frame on window system %s" w)) (if (get w (quote window-system-initiali= =3D zed)) nil (funcall (cdr (assq w window-system-initialization-alist)) displa= =3D y) (setq x-display-name display) (put w (quote window-system-initialized) t= =3D )) (progn (let ((--dolist-tail-- (cdr (assq w window-system-default-frame-a= =3D list))) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (assq = =3D (car p) params) nil (setq params (cons p params))) (setq --dolist-tail-- (c= =3D dr --dolist-tail--))))) (progn (let ((--dolist-tail-- default-frame-alist) = =3D p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (assq (car p) = =3D params) nil (setq params (cons p params))) (setq --dolist-tail-- (cdr --dol= =3D ist-tail--))))) (run-hooks (quote before-make-frame-hook)) (setq frame (fun= =3D call frame-creation-function params)) (normal-erase-is-backspace-setup-fram= =3D e frame) (progn (let ((--dolist-tail-- frame-inherited-parameters) param) (= =3D while --dolist-tail-- (setq param (car --dolist-tail--)) (if (assq param pa= =3D rameters) nil (let (...) (if val ...))) (setq --dolist-tail-- (cdr --dolist= =3D -tail--))))) (run-hook-with-args (quote after-make-frame-functions) frame) = =3D frame))(nil) * apply((lambda (&optional parameters) "Return a newly created frame displa= =3D ying the current buffer.\nOptional argument PARAMETERS is an alist of frame= =3D parameters for\nthe new frame. Each element of PARAMETERS should have the= =3D \nform (NAME . VALUE), for example:\n\n (name . STRING)=09The frame should = be=3D named STRING.\n\n (width . NUMBER)=09The frame should be NUMBER characters= i=3D n width.\n (height . NUMBER)=09The frame should be NUMBER text lines high.\= n\=3D nYou cannot specify either `width' or `height', you must specify\nneither o= =3D r both.\n\n (minibuffer . t)=09The frame should have a minibuffer.\n (minib= uf=3D fer . nil)=09The frame should have no minibuffer.\n (minibuffer . only)=09T= he f=3D rame should contain only a minibuffer.\n (minibuffer . WINDOW)=09The frame = sh=3D ould use WINDOW as its minibuffer window.\n\n (window-system . nil)=09The f= ra=3D me should be displayed on a terminal device.\n (window-system . x)=09The fr= am=3D e should be displayed in an X window.\n\n (display . \":0\") The frame = =3D should appear on display :0.\n\n (terminal . TERMINAL) The frame should us= =3D e the terminal object TERMINAL.\n\nIn addition, any parameter specified in = =3D `default-frame-alist',\nbut not present in PARAMETERS, is applied.\n\nBefor= =3D e creating the frame (via `frame-creation-function-alist'),\nthis function = =3D runs the hook `before-make-frame-hook'. After\ncreating the frame, it runs= =3D the hook `after-make-frame-functions'\nwith one arg, the newly created fra= =3D me.\n\nIf a display parameter is supplied and a window-system is not,\ngues= =3D s the window-system from the display.\n\nOn graphical displays, this functi= =3D on does not itself make the new\nframe the selected frame. However, the wi= =3D ndow system may select\nthe new frame according to its own rules." (interac= =3D tive) (let* ((display (cdr (assq (quote display) parameters))) (w (cond ((a= =3D ssq (quote terminal) parameters) (let (...) (cond ... ... ...))) ((assq (qu= =3D ote window-system) parameters) (cdr (assq ... parameters))) (display (or (w= =3D indow-system-for-display display) (error "Don't know how to interpret displ= =3D ay \"%S\"" display))) (t window-system))) (frame-creation-function (cdr (as= =3D sq w frame-creation-function-alist))) (oldframe (selected-frame)) (params p= =3D arameters) frame) (if frame-creation-function nil (error "Don't know how to= =3D create a frame on window system %s" w)) (if (get w (quote window-system-in= =3D itialized)) nil (funcall (cdr (assq w window-system-initialization-alist)) = =3D display) (setq x-display-name display) (put w (quote window-system-initiali= =3D zed) t)) (progn (let ((--dolist-tail-- (cdr (assq w window-system-default-f= =3D rame-alist))) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if = =3D (assq (car p) params) nil (setq params (cons p params))) (setq --dolist-tai= =3D l-- (cdr --dolist-tail--))))) (progn (let ((--dolist-tail-- default-frame-a= =3D list) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (assq (c= =3D ar p) params) nil (setq params (cons p params))) (setq --dolist-tail-- (cdr= =3D --dolist-tail--))))) (run-hooks (quote before-make-frame-hook)) (setq fram= =3D e (funcall frame-creation-function params)) (normal-erase-is-backspace-setu= =3D p-frame frame) (progn (let ((--dolist-tail-- frame-inherited-parameters) pa= =3D ram) (while --dolist-tail-- (setq param (car --dolist-tail--)) (if (assq pa= =3D ram parameters) nil (let (...) (if val ...))) (setq --dolist-tail-- (cdr --= =3D dolist-tail--))))) (run-hook-with-args (quote after-make-frame-functions) f= =3D rame) frame)) nil) * make-frame(nil) (lambda nil (make-frame pop-up-frame-alist))() display-buffer-pop-up-frame(# ((inhibit-same-win= =3D dow . t))) display-buffer--maybe-pop-up-frame-or-window(# (= =3D (inhibit-same-window . t))) display-buffer(# t) pop-to-buffer(# t nil) switch-to-buffer-other-window(#) find-file-other-window("~/drews-lisp-20/autofit-frame.el" WILDCARDS) In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-08-17 on ODIEONE Bzr revision: 113938 eliz@gnu.org-20130817171807-fxigtkbc6yy8m9iw Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D3D/c/Devel/emacs/binary --enable-checking=3D3Dyes,gl= yphs CFLAGS=3D3D-O0 -g3 LDFLAGS=3D3D-Lc:/Devel/emacs/lib CPPFLAGS=3D3D-Ic:/Devel/emacs/include'