summaryrefslogtreecommitdiff
path: root/config/display-buffer/config-display-buffer-alist.el
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2022-10-07 02:13:54 -0400
committerJohn Turner <jturner.usa@gmail.com>2022-10-07 02:13:54 -0400
commitd314fe16f72fc758639c83848a16e4d2ed7efa9e (patch)
tree80c6d5ec8897f27db66b49b68cb617e30a1423f6 /config/display-buffer/config-display-buffer-alist.el
parenta9b93ae5443bf92dfdc5aaf786d2607241c9c287 (diff)
downloademacs.d-d314fe16f72fc758639c83848a16e4d2ed7efa9e.tar.gz
created display-buffer-in-side-window wrapper function
The old display-buffer-alist thing did not work like I expected it to, so we removed it. Instead of trying to update display-buffer-alist when the screen resizes via a hook, we just create our own display function that can be used in display-buffer-alist directly. The function takes a "which-side" property in the alist, the property holds a function that returns which side the new buffer will snap to when invoked. The display function then creates a new alist with the side property and any other properties were passed in, and calls display-buffer-in-side-window with the new alist. This allows us to use this function as if it were display-buffer-in-side-window, but with an extra property to decide which side the window snaps to each time the function is invoked. This is useful if you want side windows to snap to different parts of the screen based on the current size of the frame, or anything else.
Diffstat (limited to 'config/display-buffer/config-display-buffer-alist.el')
-rw-r--r--config/display-buffer/config-display-buffer-alist.el6
1 files changed, 0 insertions, 6 deletions
diff --git a/config/display-buffer/config-display-buffer-alist.el b/config/display-buffer/config-display-buffer-alist.el
deleted file mode 100644
index e64f109..0000000
--- a/config/display-buffer/config-display-buffer-alist.el
+++ /dev/null
@@ -1,6 +0,0 @@
-(defvar config-display-buffer-gaps-width 20)
-
-(defun config-display-buffer-which-side ()
- (if (> (+ (frame-pixel-width) config-display-buffer-gaps-width) (/ (x-display-pixel-width) 2))
- 'right
- 'bottom))