aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 16:05:15 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 16:05:15 -0500
commited56da8c5b52c052ec3fdbf5e0b04b2040ca59d6 (patch)
treec95eda04a689afeda8d3d6187597135a914a5a40 /modules
parentd11f3d5a18271ffd8e4b9822988ccc2fd2e0bcde (diff)
downloaddotemacs-ed56da8c5b52c052ec3fdbf5e0b04b2040ca59d6.tar.gz
dotemacs-ed56da8c5b52c052ec3fdbf5e0b04b2040ca59d6.zip
fix(agenda): keep the agenda frame a single full-height agenda window
The frame spawned with the working buffer in its top quarter and the agenda below at 75%. The sticky setting inside the F custom command applies too late to name the buffer, so it rendered as plain *Org Agenda*, and that name matches the 0.75 below-selected display rule in org-agenda-config.el, which split the brand-new frame. I bind org-agenda-sticky and current-window dynamically around the render, so the buffer is *Org Agenda(F)* (no display rule matches it) and it takes the frame's sole window. A delete-other-windows after the render is the belt in case any future rule still splits. The frame is also named "Full Agenda" now so it's recognizable at a glance and WM rules can target it.
Diffstat (limited to 'modules')
-rw-r--r--modules/org-agenda-frame.el21
1 files changed, 17 insertions, 4 deletions
diff --git a/modules/org-agenda-frame.el b/modules/org-agenda-frame.el
index ef541c2f..efd74115 100644
--- a/modules/org-agenda-frame.el
+++ b/modules/org-agenda-frame.el
@@ -31,6 +31,8 @@
;; `with-eval-after-load' so a batch test-load runs no org-agenda side effects.
(defvar org-agenda-custom-commands)
(defvar org-agenda-finalize-hook)
+(defvar org-agenda-sticky)
+(defvar org-agenda-window-setup)
(declare-function cj/build-org-agenda-list "org-agenda-config" (&optional force-rebuild))
(declare-function cj/org-agenda-refresh-files "org-agenda-config" ())
(declare-function org-agenda-redo "org-agenda" (&optional all))
@@ -357,10 +359,11 @@ the timer and kills the sticky buffer."
"Return the frame parameters for the dedicated agenda frame.
A normal frame -- not fullscreen -- so a tiling window manager places it
side by side with the working frame rather than covering the whole output.
-It carries the `cj/agenda-frame' marker and a distinct name so window-manager
-rules can target it."
+It carries the `cj/agenda-frame' marker and a distinct, noticeable name
+\(\"Full Agenda\") so the frame is recognizable at a glance and
+window-manager rules can target it."
`((,cj/--agenda-frame-parameter . t)
- (name . "Org Agenda")))
+ (name . "Full Agenda")))
(defun cj/--agenda-frame-spawn ()
"Create, display, and focus the dedicated agenda frame.
@@ -378,7 +381,17 @@ Returns the new agenda frame on success."
;; Cached, non-forced: a frame spawned early after daemon startup
;; still shows the full project agenda, not the base-files-only view.
(cj/build-org-agenda-list)
- (org-agenda "a" cj/--agenda-frame-command-key)
+ ;; Bind sticky + current-window dynamically around the render. The
+ ;; custom command's own settings apply too late to name the buffer;
+ ;; without these the buffer is plain *Org Agenda*, which matches the
+ ;; 0.75 below-selected display rule in org-agenda-config.el -- the
+ ;; new frame gets split with the launch buffer left in the top 25%.
+ ;; Sticky names it *Org Agenda(F)*, which no display rule matches.
+ (let ((org-agenda-sticky t)
+ (org-agenda-window-setup 'current-window))
+ (org-agenda "a" cj/--agenda-frame-command-key))
+ ;; Belt: whatever a display rule did, the frame is one agenda window.
+ (delete-other-windows)
(let ((buffer (cj/--agenda-frame-sticky-buffer)))
(when (buffer-live-p buffer)
(with-current-buffer buffer