diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index c71b8370f..1c7456997 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -7,6 +7,8 @@ (unless org-agenda-files (setq org-agenda-files (list org-directory))) (setq-default + ;; Don't monopolize the whole frame just for the agenda + org-agenda-window-setup 'current-window ;; Hide blocked tasks in the agenda view. org-agenda-dim-blocked-tasks 'invisible org-agenda-inhibit-startup t @@ -84,8 +86,9 @@ (defun +org-init-babel-h () (setq org-src-preserve-indentation t ; use native major-mode indentation org-src-tab-acts-natively t - org-src-window-setup 'current-window - org-confirm-babel-evaluate nil) ; you don't need my permission + org-confirm-babel-evaluate nil ; you don't need my permission + ;; Show src buffer in popup, and don't monopolize the frame + org-src-window-setup 'other-window) ;; I prefer C-c C-c over C-c ' (more consistent) (define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit) @@ -707,8 +710,8 @@ between the two." '(("^\\*Org Links" :slot -1 :vslot -1 :size 2 :ttl 0) ("^\\*\\(?:Agenda Com\\|Calendar\\|Org \\(?:Export Dispatcher\\|Select\\)\\)" :slot -1 :vslot -1 :size #'+popup-shrink-to-fit :ttl 0) - ("^\\*Org Agenda" :size 0.35 :select t :ttl nil) - ("^\\*Org Src" :size 0.3 :quit nil :select t :autosave t :ttl nil) + ("^\\*Org Agenda" :ignore t) + ("^\\*Org Src" :size 0.4 :quit nil :select t :autosave t :modeline t :ttl nil) ("^CAPTURE.*\\.org$" :size 0.2 :quit nil :select t :autosave t)))) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index be5d2fa88..5c5616f1e 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -242,8 +242,8 @@ the command buffer." org-fast-tag-selection org-fast-todo-selection) (if +popup-mode - (cl-letf (((symbol-function 'delete-other-windows) - (symbol-function 'ignore))) + (cl-letf (((symbol-function #'delete-other-windows) + (symbol-function #'ignore))) (apply orig-fn args)) (apply orig-fn args))) @@ -254,58 +254,26 @@ Ugh, such an ugly hack." :around '(org-fast-tag-selection org-fast-todo-selection) (if +popup-mode - (cl-letf* ((old-fit-buffer-fn (symbol-function 'org-fit-window-to-buffer)) - ((symbol-function 'org-fit-window-to-buffer) + (cl-letf* ((old-fit-buffer-fn (symbol-function #'org-fit-window-to-buffer)) + ((symbol-function #'org-fit-window-to-buffer) (lambda (&optional window max-height min-height shrink-only) (when-let (buf (window-buffer window)) (delete-window window) - (setq window (display-buffer-in-side-window buf nil)) - (select-window window) + (select-window + (setq window (display-buffer-at-bottom buf nil))) (with-current-buffer buf (setq mode-line-format nil))) (funcall old-fit-buffer-fn window max-height min-height shrink-only)))) (apply orig-fn args)) (apply orig-fn args))) - (defadvice! +popup--org-src-pop-to-buffer-a (orig-fn buffer context) - "Hand off the src-block window to the popup system by using `display-buffer' -instead of switch-to-buffer-*." - :around #'org-src-switch-to-buffer - (if (and (eq org-src-window-setup 'popup-window) - +popup-mode) - (pop-to-buffer buffer) - (funcall orig-fn buffer context))) - (setq org-src-window-setup 'popup-window) - ;; Ensure todo, agenda, and other minor popups are delegated to the popup system. (defadvice! +popup--org-pop-to-buffer-a (orig-fn buf &optional norecord) "Use `pop-to-buffer' instead of `switch-to-buffer' to open buffer.'" :around #'org-switch-to-buffer-other-window (if +popup-mode (pop-to-buffer buf nil norecord) - (funcall orig-fn buf norecord))) - - ;; `org-agenda' - (setq org-agenda-window-setup 'popup-window - org-agenda-restore-windows-after-quit nil) - ;; Don't monopolize the frame! - (defadvice! +popup--org-agenda-suppress-delete-other-windows-a (orig-fn &rest args) - :around #'org-agenda-prepare-window - (cond ((not +popup-mode) - (apply orig-fn args)) - ((eq org-agenda-window-setup 'popup-window) - (let ((org-agenda-window-setup 'other-window) - org-agenda-restore-windows-after-quit) - (cl-letf (((symbol-function 'delete-other-windows) - (symbol-function 'ignore))) - (apply orig-fn args)))) - ((memq org-agenda-window-setup '(current-window other-window)) - (with-popup-rules! nil - (cl-letf (((symbol-function 'delete-other-windows) - (symbol-function 'ignore))) - (apply orig-fn args)))) - ((with-popup-rules! nil - (apply orig-fn args)))))) + (funcall orig-fn buf norecord)))) ;;;###package persp-mode