about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--init/functions.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/init/functions.el b/init/functions.el
index ebcc5b5f7d19..4ca7cedb2797 100644
--- a/init/functions.el
+++ b/init/functions.el
@@ -204,4 +204,14 @@ Including indent-buffer, which should not be called automatically on save."
   (epg-sign-string (epg-make-context) "dummy")
   nil)
 
+(defun bottom-right-window-p ()
+  "Determines whether the last (i.e. bottom-right) window of the
+  active frame is showing the buffer in which this function is
+  executed."
+  (let* ((frame (selected-frame))
+         (right-windows (window-at-side-list frame 'right))
+         (bottom-windows (window-at-side-list frame 'bottom))
+         (last-window (car (seq-intersection right-windows bottom-windows))))
+    (eq (current-buffer) (window-buffer last-window))))
+
 (provide 'functions)