[oni-eww] Display new eww buffers as the only buffer
This commit is contained in:
parent
f155080f3f
commit
6234e99de9
1 changed files with 11 additions and 1 deletions
12
oni-eww.el
12
oni-eww.el
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2021.0406.105450
|
;; Version: 2021.0406.111733
|
||||||
;; Package-Requires: (eww oni-data-dir)
|
;; Package-Requires: (eww oni-data-dir)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; 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)
|
(add-hook 'window-configuration-change-hook #'oni-eww-resize-margins nil t)
|
||||||
(oni-eww-resize-margins))
|
(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/"))
|
(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)
|
(add-hook 'eww-mode-hook #'oni-eww-setup-margins)
|
||||||
|
|
||||||
(provide 'oni-eww)
|
(provide 'oni-eww)
|
||||||
|
|
Loading…
Reference in a new issue