From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Javier Newsgroups: gmane.emacs.help Subject: Re: How to get the new frame? Date: Tue, 21 Jul 2015 17:25:51 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1437499822 21944 80.91.229.3 (21 Jul 2015 17:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2015 17:30:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 21 19:30:21 2015 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 1ZHbMv-0000BB-S3 for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2015 19:30:18 +0200 Original-Received: from localhost ([::1]:60479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHbMv-00025u-BL for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2015 13:30:17 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 6vJ9bD1ekW8t4acxAcHFJw.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.18.6-1-ARCH (x86_64)) X-Notice: Filtered by postfilter v. 0.8.2 Original-Xref: usenet.stanford.edu gnu.emacs.help:213616 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:105902 Archived-At: Ian Zimmerman wrote: > Is there a neat way in Lisp code to get at the frame which > find-file-other-frame just has created? I define this in my .emacs (defun other-frame-dec () "" (interactive) (other-frame '+1)) (defun other-frame-inc () "" (interactive) (other-frame '-1)) I think the function other-frame-inc would just do what you want (change to the freshly created frame) Emacs labels the frames as F1, F2, F3... and it just increases the number each time you create a frame (if you delete an old frame F2, its number does not get reused, emacs just keeps increasing the number in the label: F10, F11... ). I might be wrong, but that's the way things happen in my setup. I link those functions to very easy accesible keys to navigate frames in emacs as if they were tabs in firefox. (global-set-key [S-left] 'other-frame-dec) (global-set-key [S-right] 'other-frame-inc) or (global-set-key [C-iso-lefttab] 'other-frame-inc) (global-set-key [C-S-iso-lefttab] 'other-frame-dec)