From 6234e99de976e81907ffe5516cd02b0a039bd712 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 6 Apr 2021 11:17:44 -0700 Subject: [PATCH] [oni-eww] Display new eww buffers as the only buffer --- oni-eww.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)