Similar to WindMove, this package allows you to move focus between frames using arrow keys. Additionally, it can hook into WindMove’s keys so that when you can’t move between windows (because you reached the edge of the frame), the next event jumps frames.
Note This not for moving frames, but for moving focus between frames.
To install framemove on its own:
(require 'framemove) (framemove-default-keybindings) ;; default prefix is Meta
But you might want to use this in conjunction with WindMove, in which case this is the integration code to add to your .emacs:
(require 'framemove) (windmove-default-keybindings) (setq framemove-hook-into-windmove t)
Currently, when focus shifts to a new frame - the point does not change inside the frame.
Download from Lisp:framemove.el
If you get errors due to remove-if-not not being defined, you might need some common-lisp stuff:
1. I like it. I bind your change-focus keys to
‘M-S-up’, etc., since I bind
‘M-up’ etc. to the frame movement commands
‘move-frame-up’ etc. from frame-cmds.el.
2. Suggestion: Let
‘fm-left-frame’ etc. cycle (wrap) around to the rightmost frame when the end is reached, instead of just showing the message “
No frame in that direction”. That would make this feature more useful.
3. Consider adding to the file header of framemove.el:
;; Compatibility: GNU Emacs 22.x, 23.x
4. Consider making it a bit clearer in the file’s
Commentary and on this wiki page that, in spite of the names, this is not about moving frames; it is about moving (changing) the input focus from one frame to the next. The function and libraries names are a bit unfortunate, IMO, but I suppose they are modeled on
windmove.el, which also uses unfortunate terminology. But for windows, actual “moving” makes less sense than for frames. The only way you can “move” a window is relative to others: exchange them. Not so, for frames. – DrewAdams
*Done* (to some extent)
5. Suggestion: fail with a more informative message than a “Wrong-type-argument-p” error on terminal frames:
--- a/.emacs.d/packages/framemove/framemove.el +++ b/.emacs.d/packages/framemove/framemove.el @@ -102,7 +102,9 @@ (interactive (list (intern (completing-read "Which direction: " '("up" "down" "left" "right") nil t)))) (let* ((thisframe (selected-frame)) - (current-coords (fm-absolute-coords-of-position (posn-at-point))) + (current-coords (if (frame-parameter thisframe 'top) + (fm-absolute-coords-of-position (posn-at-point)) + (error "Frame movement not supported on character terminals."))) (coords-projected-in-dir (fm-project current-coords thisframe dir)) (possible-frames (sort
Look also at ‘next-multiframe-window` command and possibly bound it to a handy keybinding! – SewerynKokot