From 671149706bad590ca97fb9992b0ea375262aecda Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 3 Sep 2022 16:08:49 -0400 Subject: [PATCH] enhance use of popwin to include quick reference as a keycombo to open in a popwin --- common/_global.el | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/common/_global.el b/common/_global.el index f2567f5..6c479c7 100644 --- a/common/_global.el +++ b/common/_global.el @@ -414,9 +414,32 @@ position between last non-whitespace and `end-of-line'." ;;(setq golden-ratio-auto-scale t) (golden-ratio-mode t) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; quick reference notes as a pop up window +(defun kmn/popwin-quick-ref () + (interactive) + (when (eq system-type 'windows-nt) + (popwin:find-file "~/org/_quick_reference.org")) + (when kmn/is-termux + (popwin:find-file "~/storage/shared/org/_quick_reference.org"))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; scratch buffer as a pop up window +(defun kmn/popwin-scratch () + (interactive) + (popwin:display-buffer "*scratch*") +) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; popup windows -(require 'popwin) +(use-package popwin + :bind ( :map popwin:keymap + ("h" . popwin:close-popup-window) + ("q" . kmn/popwin-quick-ref) + ("r" . kmn/popwin-scratch)) + :config + (global-set-key (kbd "C-w") popwin:keymap) + (push "*scratch*" popwin:special-display-config) + (push "_quick_reference.org" popwin:special-display-config)) + (popwin-mode 1) -(global-set-key (kbd "C-w") popwin:keymap) -(push "*scratch*" popwin:special-display-config)