diff --git a/common/_global.el b/common/_global.el index 88a2293..311439e 100644 --- a/common/_global.el +++ b/common/_global.el @@ -533,6 +533,8 @@ (use-package popwin :bind ( :map popwin:keymap ("h" . popwin:close-popup-window) + ("r" . kmn/workspace-frame-scratch) + ("R" . kmn/popwin-scratch) ("q" . kmn/popwin-quick-ref)) :config (global-set-key (kbd "C-w") popwin:keymap) diff --git a/common/generic_functions.el b/common/generic_functions.el index de68f35..ba04a5e 100644 --- a/common/generic_functions.el +++ b/common/generic_functions.el @@ -150,6 +150,33 @@ ) ) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; open text-mode scratch in left side window +(defun kmn/scratch-prompt-on-left () + (defvar parameters + '(window-parameters . ((no-other-window . t) + (no-delete-other-windows . t)))) + + (setq fit-window-to-buffer-horizontally t) + (setq window-resize-pixelwise t) + + "Display `default-directory' in side window on left, hiding details." + (interactive) + (let ((buffer (scratch (let ((current-prefix-arg t)) (scratch--buffer-querymode))))) + (display-buffer-in-side-window + buffer `((side . left) (slot . -1) + (window-width . fit-window-to-buffer) + , parameters) + ) + ) +) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; text-mode scratch buffer as a pop up window +(defun kmn/popwin-scratch () + (interactive) + (popwin:popup-buffer (scratch 'text-mode))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; quick reference notes as a pop up window (defun kmn/popwin-quick-ref ()