1
0
Fork 0

[oni-eww] Display new eww buffers as the only buffer

This commit is contained in:
Tom Willemse 2021-04-06 11:17:44 -07:00
parent f155080f3f
commit 6234e99de9

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2021.0406.105450
;; Version: 2021.0406.111733
;; Package-Requires: (eww oni-data-dir)
;; This program is free software; you can redistribute it and/or modify
@ -42,8 +42,18 @@ The desired window width is specified in oni-eww-desired-window-width."
(add-hook 'window-configuration-change-hook #'oni-eww-resize-margins nil t)
(oni-eww-resize-margins))
(defun oni-eww-display-buffer-in-only-window (buffer alist)
"Show only BUFFER.
Delete all other windows and then pass BUFFER and ALIST on to
`display-buffer-same-window'."
(delete-other-windows)
(display-buffer-same-window buffer alist))
(setq eww-bookmarks-directory (oni-data-dir-locate "eww/"))
(add-to-list 'display-buffer-alist
`(,(rx string-start "*eww*" string-end) oni-eww-display-buffer-in-only-window))
(add-hook 'eww-mode-hook #'oni-eww-setup-margins)
(provide 'oni-eww)