Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check current emacs window position relative to other windows

Tags:

emacs

I am using S-<up> and S-<down> to run (enlarge-window) and (shrink-window), respectively.

I would like these keys to be sensitive to the position of the current window relative to others. If my frame is split horizontally into two windows, and the current window is the top one, then I would like S-<up> to run (shrink-window) instead of (enlarge-window).

How do I check the position of the current window relative to the others?

like image 882
Dan Avatar asked Aug 31 '25 11:08

Dan


1 Answers

See the function (window-edges). It returns a list of the window's coordinates. Just compare the y-axis value with the other visible windows.

like image 72
choroba Avatar answered Sep 07 '25 00:09

choroba