Update :tools/lookup +xwidget support
Remove :tools/lookup +xwidget. Provide `+lookup-xwidget-webkit-open-url-fn` so that we can manually configure Xwidget WebKit browser for `+lookup/online` or `+lookup/in-docsets`.
This commit is contained in:
parent
99eea1d3e2
commit
9caf05ffe4
4 changed files with 34 additions and 20 deletions
|
@ -116,8 +116,6 @@ Used by `+lookup/dictionary-definition' and `+lookup/synonyms'.
|
|||
For `+lookup/dictionary-definition', this is ignored on Mac, where Emacs users
|
||||
Dictionary.app behind the scenes to get definitions.")
|
||||
|
||||
(defvar +lookup--dash-docs-xwidget-webkit-last-session-buffer nil)
|
||||
|
||||
|
||||
;;
|
||||
;;; dumb-jump
|
||||
|
@ -200,20 +198,6 @@ See https://github.com/magit/ghub/issues/81"
|
|||
(let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
|
||||
(funcall orig-fn url)))
|
||||
|
||||
;; Dash docset + Xwidget integration
|
||||
(when (featurep! +xwidget)
|
||||
(defun +lookup-dash-docs-xwidget-webkit-browse-url-fn (url &optional new-session)
|
||||
(if (not (display-graphic-p))
|
||||
(eww url new-session)
|
||||
(setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer)
|
||||
(save-window-excursion
|
||||
(xwidget-webkit-browse-url url new-session))
|
||||
(with-popup-rules! '(("^\\*xwidget" :vslot -11 :size 0.35 :select nil))
|
||||
(pop-to-buffer xwidget-webkit-last-session-buffer))
|
||||
(setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer
|
||||
xwidget-webkit-last-session-buffer nil)))
|
||||
(setq dash-docs-browser-func #'+lookup-dash-docs-xwidget-webkit-browse-url-fn))
|
||||
|
||||
(cond ((featurep! :completion helm)
|
||||
(require 'helm-dash nil t))
|
||||
((featurep! :completion ivy)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue