diff --git a/oni-eww.el b/oni-eww.el index fd4b76c..713c833 100644 --- a/oni-eww.el +++ b/oni-eww.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; 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)