diff options
author | Case Duckworth | 2021-10-12 00:02:51 -0500 |
---|---|---|
committer | Case Duckworth | 2021-10-12 00:02:51 -0500 |
commit | 244dc53be80e24bb142e03d0a00940f323a0d78f (patch) | |
tree | ba0e534aba173ebcfe9cf9f5bb25748b85c4ff61 | |
parent | Remove commented and restart-emacs (diff) | |
download | emacs-244dc53be80e24bb142e03d0a00940f323a0d78f.tar.gz emacs-244dc53be80e24bb142e03d0a00940f323a0d78f.zip |
Configure popper.el
-rw-r--r-- | init.el | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/init.el b/init.el index 09bd7f4..a5b77ba 100644 --- a/init.el +++ b/init.el | |||
@@ -2332,7 +2332,32 @@ the default is \"/\"." | |||
2332 | ,(rx "Output*" eol) | 2332 | ,(rx "Output*" eol) |
2333 | ,(rx "*Async Shell Command*") | 2333 | ,(rx "*Async Shell Command*") |
2334 | help-mode helpful-mode | 2334 | help-mode helpful-mode |
2335 | compilation-mode)) | 2335 | compilation-mode) |
2336 | popper-mode-line nil | ||
2337 | popper-display-control t | ||
2338 | popper-display-function | ||
2339 | (defun popper/select-popup-smartly (buffer &optional _alist) | ||
2340 | (let* ((widep (> (frame-pixel-width) (frame-pixel-height))) | ||
2341 | (window (display-buffer-in-side-window | ||
2342 | buffer | ||
2343 | `((side . ,(if widep 'right 'bottom)) | ||
2344 | (slot . 1) | ||
2345 | ,(if widep | ||
2346 | (cons 'window-width | ||
2347 | popper-window-height) | ||
2348 | (cons 'window-height | ||
2349 | popper-window-height)))))) | ||
2350 | (select-window window))) | ||
2351 | popper-window-height | ||
2352 | (defun popper/figure-window-height (window) | ||
2353 | (let* ((widep (> (frame-pixel-width) (frame-pixel-height))) | ||
2354 | (fit-window-to-buffer-horizontally widep)) | ||
2355 | (fit-window-to-buffer | ||
2356 | window | ||
2357 | (floor (frame-pixel-height) 2) | ||
2358 | (floor (frame-pixel-height) 4) | ||
2359 | fill-column | ||
2360 | fill-column)))) | ||
2336 | (:global "M-`" #'popper-toggle-latest | 2361 | (:global "M-`" #'popper-toggle-latest |
2337 | "C-`" #'popper-cycle) | 2362 | "C-`" #'popper-cycle) |
2338 | (popper-mode +1) | 2363 | (popper-mode +1) |