From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: floriansbriefe@gmail.com Newsgroups: gmane.emacs.devel Subject: Re: frame.el: call before-make-frame-hook earlier in make-frame Date: Fri, 31 Jul 2015 09:40:34 +0200 Message-ID: <20150731074034.GA78288@csr-pc9.zib.de> References: <20150730110041.GE23175@csr-pc9.zib.de> <55BB1F2C.8070205@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1438328467 10867 80.91.229.3 (31 Jul 2015 07:41:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2015 07:41:07 +0000 (UTC) To: martin rudalics , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 09:41:02 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZL4w8-0002gn-P3 for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2015 09:41:01 +0200 Original-Received: from localhost ([::1]:43435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL4w7-0007FM-45 for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2015 03:40:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL4vr-0007FD-EK for emacs-devel@gnu.org; Fri, 31 Jul 2015 03:40:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL4vm-0000kc-77 for emacs-devel@gnu.org; Fri, 31 Jul 2015 03:40:43 -0400 Original-Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:33813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL4vl-0000kM-VD for emacs-devel@gnu.org; Fri, 31 Jul 2015 03:40:38 -0400 Original-Received: by wibud3 with SMTP id ud3so47633813wib.1 for ; Fri, 31 Jul 2015 00:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=YthO6Dph1+rYDgRia5jzydKQSfR0e4AOuRJ1ryDbst0=; b=QzhkLW5PbwYLJdQD3R6TFnhUWn86LR9b8+p0DHNdAo/C0+MMX1rWnOZCvHCyovzpkp A/DttyYYPfpM8iQgwjG7ymIqw+XDhT6MWd/j6qOHpc+oavw1sdDV9WvdGOB+UU1Fchm9 9I1RQ2noNxoo/WPSf4xKZ5XmrqceCFgRbjeUvLkn3e0sqjQ/fOZNKWZvqYegWZHOwJ+Q /P0++sKxkUFQZTD/Jaj+ZjWpNXv8Bl3NjUVK7f8QvTcpiBl6OXc2wN2lUq6jB+K7afMP O64QRhYn8EusHBlOGuK1PmdXyIjlwramH8sk+W1nT8VAFJ1pI4tyMcmoUqRSz4TxueE4 p0oQ== X-Received: by 10.180.211.49 with SMTP id mz17mr3660817wic.69.1438328437195; Fri, 31 Jul 2015 00:40:37 -0700 (PDT) Original-Received: from localhost (csr-pc9.zib.de. [130.73.78.129]) by smtp.gmail.com with ESMTPSA id jr5sm5770306wjc.14.2015.07.31.00.40.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 00:40:36 -0700 (PDT) Content-Disposition: inline In-Reply-To: <55BB1F2C.8070205@gmx.at> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188227 Archived-At: > > I would like to propose to call the before-make-frame-hook in the function > > make-frame *before* retrieving the parameters of the new frame > > (window-system-default-frame-alist and default-frame-alist) and not after. > > > > That way, one could dynamically set these variables inside the hook, e.g. to > > create the new frame under the current position of the mouse cursor. > > We could easily do that. But encouraging users to set a variable called > `default-frame-alist' in a hook is probably a very bad advice. Where > would you change the default value back after you're done with making > the frame? In `after-make-frame-functions'? As the hook is registered, the hook will always adjust the 'default-frame-alist' and thereby make its value dynamic. There is no need to restore the former default. But I see your point, that it is a kind of hack. > Creating a frame under the mouse cursor should be done by a special > function that calls `make-frame' with the mouse position passed via the > `left' and `top' PARAMETERS thus _overriding_ any default parameters. > Please tell us if and why such a function would not be practicable for > you. That is a viable solution, but it has the drawback that you have to override a default key-binding (C-x 5 2) with your own make-frame function and that you do not benefit from the nice things that 'make-frame-command' additionally does for you a) at the moment (setting the focus to the new frame etc) and b) potentially in future emacs releases. Thats why I would prefer using the hook. Thats what hooks are for: Adjusting behaviour with minimal invasion. Cheers, Florian