diff --git a/init.el b/init.el index 4b0e898..87cd24e 100644 --- a/init.el +++ b/init.el @@ -1200,42 +1200,19 @@ DOCSTRING is an optional form that is discarded upon expansion." (diff-hl-flydiff-mode)) ;; ---------------------------------- ;; -;; eldoc-box +;; eldoc-frame ;; ---------------------------------- ;; -(external-package eldoc-box - "Displays documentation from Eldoc in a floating popup." - :preface - (defun user/scroll-eldoc-box (count) - "Scrolls the `eldoc-box' window by COUNT lines if it visible." - (when (and (boundp 'eldoc-box--frame) - eldoc-box--frame - (frame-visible-p eldoc-box--frame)) - (with-selected-frame eldoc-box--frame - (scroll-up count)))) - :config - (dolist (parameter '((left-fringe . 12) (right-fringe . 12) (alpha-background . 90))) - (add-to-list 'eldoc-box-frame-parameters parameter)) - (add-hook 'eldoc-box-buffer-hook (lambda (&rest _args) - (goto-char (point-min)) - (insert (propertize "\n\s" 'face '(:height 0.2))) - (goto-char (point-max)) - (insert (propertize "\n\s" 'face '(:height 0.2))))) - (add-hook 'eldoc-box-frame-hook (lambda (&rest _args) - (setq-local line-spacing 0.25 - pixel-scroll-precision-mode nil - global-hl-line-mode nil))) +(editor-feature eldoc-frame + "Displays ElDoc documentation in floating child frames." :custom - (eldoc-box-offset '(16 42 16) "Set a higher right offset for the popups to accomodate for the fringes") (eldoc-documentation-strategy 'eldoc-documentation-compose "Combine results from all documentation sources") - (eldoc-box-max-pixel-width (lambda () (min 500 (/ (frame-outer-width) 4))) "Limit doc popup to 500 pixels wide") - (eldoc-box-max-pixel-height (lambda () (min 300 (/ (frame-outer-height) 4))) "Limit doc popup to 300 pixels tall") - (eldoc-box-doc-separator (propertize "\n\s\n" 'display '(space :width text) 'face '(:strike-through t))) :hook - (eldoc-mode-hook . eldoc-box-hover-mode) + (eldoc-mode-hook . eldoc-frame-mode) :bind - ("M-" . (lambda () (interactive) (user/scroll-eldoc-box -1))) - ("M-" . (lambda () (interactive) (user/scroll-eldoc-box 1)))) + (:map eldoc-frame-mode-map + ("M-" . eldoc-frame-scroll-down-line) + ("M-" . eldoc-frame-scroll-up-line))) ;; ---------------------------------- ;; ;; eshell-up