org-agenda.el: Fix some bugs about (indirect) windows handling
* org-agenda.el (org-agenda-quit): Delete last indirect buffer. (org-agenda-pre-follow-window-conf): New variable. (org-agenda-tree-to-indirect-buffer): Fix bug: don't split agenda window when there an indirect buffer is already displayed.
This commit is contained in:
parent
2a04d90d20
commit
33213dc99a
|
@ -6547,6 +6547,9 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
|
||||||
"Exit agenda by killing agenda buffer or burying it when
|
"Exit agenda by killing agenda buffer or burying it when
|
||||||
`org-agenda-sticky' is non-NIL"
|
`org-agenda-sticky' is non-NIL"
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(if (and (eq org-indirect-buffer-display 'other-window)
|
||||||
|
org-last-indirect-buffer)
|
||||||
|
(delete-window (get-buffer-window org-last-indirect-buffer)))
|
||||||
(if org-agenda-columns-active
|
(if org-agenda-columns-active
|
||||||
(org-columns-quit)
|
(org-columns-quit)
|
||||||
(if org-agenda-sticky
|
(if org-agenda-sticky
|
||||||
|
@ -7267,10 +7270,16 @@ so that the date SD will be in that range."
|
||||||
(remove-hook 'pre-command-hook 'org-unhighlight-once)
|
(remove-hook 'pre-command-hook 'org-unhighlight-once)
|
||||||
(org-unhighlight))
|
(org-unhighlight))
|
||||||
|
|
||||||
|
(defvar org-agenda-pre-follow-window-conf nil)
|
||||||
(defun org-agenda-follow-mode ()
|
(defun org-agenda-follow-mode ()
|
||||||
"Toggle follow mode in an agenda buffer."
|
"Toggle follow mode in an agenda buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(unless org-agenda-follow-mode
|
||||||
|
(setq org-agenda-pre-follow-window-conf
|
||||||
|
(current-window-configuration)))
|
||||||
(setq org-agenda-follow-mode (not org-agenda-follow-mode))
|
(setq org-agenda-follow-mode (not org-agenda-follow-mode))
|
||||||
|
(unless org-agenda-follow-mode
|
||||||
|
(set-window-configuration org-agenda-pre-follow-window-conf))
|
||||||
(org-agenda-set-mode-name)
|
(org-agenda-set-mode-name)
|
||||||
(org-agenda-do-context-action)
|
(org-agenda-do-context-action)
|
||||||
(message "Follow mode is %s"
|
(message "Follow mode is %s"
|
||||||
|
@ -7879,8 +7888,7 @@ use the dedicated frame)."
|
||||||
(unless (or (eq org-indirect-buffer-display 'new-frame)
|
(unless (or (eq org-indirect-buffer-display 'new-frame)
|
||||||
(eq org-indirect-buffer-display 'dedicated-frame))
|
(eq org-indirect-buffer-display 'dedicated-frame))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(unless (and indirect-window (window-live-p indirect-window))
|
||||||
(unless (and indirect-window (window-live-p indirect-window)))
|
|
||||||
(setq indirect-window (split-window agenda-window)))
|
(setq indirect-window (split-window agenda-window)))
|
||||||
(and indirect-window (select-window indirect-window))
|
(and indirect-window (select-window indirect-window))
|
||||||
(switch-to-buffer org-last-indirect-buffer :norecord)
|
(switch-to-buffer org-last-indirect-buffer :norecord)
|
||||||
|
|
Loading…
Reference in New Issue