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 12:38:25 +0200 Message-ID: <20150731103825.GB78288@csr-pc9.zib.de> References: <20150730110041.GE23175@csr-pc9.zib.de> <55BB1F2C.8070205@gmx.at> <20150731074034.GA78288@csr-pc9.zib.de> <55BB462C.5000401@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1438339131 16774 80.91.229.3 (31 Jul 2015 10:38:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2015 10:38:51 +0000 (UTC) Cc: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 12:38:51 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 1ZL7iD-0004j0-Ux for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2015 12:38:50 +0200 Original-Received: from localhost ([::1]:43910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7iD-0006bP-8b for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2015 06:38:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7hw-0006aN-Ly for emacs-devel@gnu.org; Fri, 31 Jul 2015 06:38:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL7ht-0000ca-Bf for emacs-devel@gnu.org; Fri, 31 Jul 2015 06:38:32 -0400 Original-Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:35060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL7ht-0000cK-5Y for emacs-devel@gnu.org; Fri, 31 Jul 2015 06:38:29 -0400 Original-Received: by wibxm9 with SMTP id xm9so27775354wib.0 for ; Fri, 31 Jul 2015 03:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=6oAJnAs9M2+hvUawVH1JpDuqYzw7JyFAejVXErALHwM=; b=JIBWORruCTl5N2HUzda3OZ/RP2Xfgkf8SrU1Gsa6MXMzvefbIE+KnzFTOM2XraFSs3 qL7c33lWCbYoEjwTF6HnQ1CoiUvlLe8JJiKOW1c+Ziw2Pvxm99/rIzXNzCVqqvAzwF9i IP0h4oRrRLyOi8MUOpsNxQ6oHErYCdlZ7wUvVz/4FL4tP9pPrPpncZhbj7XMpmUSDPxb vDivC2xzPg04PYq9Bfz/tqSMKqDxgHvXsKgxj+LKyMC1cj6mFNfiawZN3Nax9tUwlkt0 7VJXpuAS5gi+0ZXnt9zVA/iC6NcxjZ3HGJFm0CmeFpLzhndFPm+T7L0Jfn69ESD3wMP+ Mozg== X-Received: by 10.194.109.167 with SMTP id ht7mr4465341wjb.60.1438339108400; Fri, 31 Jul 2015 03:38:28 -0700 (PDT) Original-Received: from localhost (csr-pc9.zib.de. [130.73.78.129]) by smtp.gmail.com with ESMTPSA id yu4sm6481665wjc.43.2015.07.31.03.38.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 03:38:27 -0700 (PDT) Content-Disposition: inline In-Reply-To: <55BB462C.5000401@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::229 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:188234 Archived-At: > > 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) > > Here `make-frame-command' does only > > (interactive) > (if (display-graphic-p) > (make-frame) > (select-frame (make-frame)))) > > and since you are not on a text terminal (on a text terminal you can > hardly make a frame at the mouse position) `make-frame-command' is just > an interactive wrapper for `make-frame'. Everything else (like > redirecting focus to the new frame) is done inside `make-frame'. The use case was just an example, other dynamic settings would be possible. > > in future emacs releases. Thats why I would prefer using the hook. Thats what > > hooks are for: Adjusting behaviour with minimal invasion. > > That hook would be run for any frames created by other packages, say for > the speedbar or the ediff control window. Are you sure you want these > to pop up at the mouse position? And how do you get the mouse position > when it's outside of any emacs frame? Or do you want to position a new > frame always inside an existing frame? If the mouse position cannot be determined I used a default position value. But you are completely right for frames opened by other packages (speedbar, ediff control window). I missed those cases in my considerations. So your proposal of a separate 'make-frame' command for interactively created frames seems to be the right choice and I will follow this approach. Thank you very much for your advice! Florian