help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the new frame?


From: Javier
Subject: Re: How to get the new frame?
Date: Tue, 21 Jul 2015 17:25:51 +0000 (UTC)
User-agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.18.6-1-ARCH (x86_64))

Ian Zimmerman <itz@buug.org> 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]