mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-27 07:37:25 +00:00
Merge branch 'maint'
Conflicts: lisp/org-agenda.el
This commit is contained in:
commit
b622300c0c
@ -3587,10 +3587,12 @@ generating a new one."
|
||||
;; does not have org variables local
|
||||
org-agenda-this-buffer-is-sticky))))
|
||||
|
||||
(defun org-agenda-prepare-window (abuf)
|
||||
"Setup agenda buffer in the window."
|
||||
(let* ((awin (get-buffer-window abuf))
|
||||
wconf)
|
||||
(defun org-agenda-prepare-window (abuf filter-alist)
|
||||
"Setup agenda buffer in the window.
|
||||
ABUF is the buffer for the agenda window.
|
||||
FILTER-ALIST is an alist of filters we need to apply when
|
||||
`org-agenda-persistent-filter' is non-nil."
|
||||
(let* ((awin (get-buffer-window abuf)) wconf)
|
||||
(cond
|
||||
((equal (current-buffer) abuf) nil)
|
||||
(awin (select-window awin))
|
||||
@ -3604,66 +3606,70 @@ generating a new one."
|
||||
((equal org-agenda-window-setup 'reorganize-frame)
|
||||
(delete-other-windows)
|
||||
(org-switch-to-buffer-other-window abuf)))
|
||||
;; additional test in case agenda is invoked from within agenda
|
||||
;; buffer via elisp link
|
||||
(setq org-agenda-tag-filter (cdr (assoc 'tag filter-alist)))
|
||||
(setq org-agenda-category-filter (cdr (assoc 'cat filter-alist)))
|
||||
(setq org-agenda-regexp-filter (cdr (assoc 're filter-alist)))
|
||||
;; Additional test in case agenda is invoked from within agenda
|
||||
;; buffer via elisp link.
|
||||
(unless (equal (current-buffer) abuf)
|
||||
(org-pop-to-buffer-same-window abuf))
|
||||
(setq org-agenda-pre-window-conf
|
||||
(or org-agenda-pre-window-conf wconf))))
|
||||
|
||||
(defun org-agenda-prepare (&optional name)
|
||||
(if (org-agenda-use-sticky-p)
|
||||
(progn
|
||||
;; Popup existing buffer
|
||||
(org-agenda-prepare-window (get-buffer org-agenda-buffer-name))
|
||||
(message "Sticky Agenda buffer, use `r' to refresh")
|
||||
(or org-agenda-multi (org-agenda-fit-window-to-buffer))
|
||||
(throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
|
||||
(setq org-todo-keywords-for-agenda nil)
|
||||
(unless org-agenda-persistent-filter
|
||||
(setq org-agenda-tag-filter nil
|
||||
org-agenda-category-filter nil
|
||||
org-agenda-regexp-filter nil))
|
||||
(put 'org-agenda-tag-filter :preset-filter
|
||||
org-agenda-tag-filter-preset)
|
||||
(put 'org-agenda-category-filter :preset-filter
|
||||
org-agenda-category-filter-preset)
|
||||
(put 'org-agenda-regexp-filter :preset-filter
|
||||
org-agenda-regexp-filter-preset)
|
||||
(if org-agenda-multi
|
||||
(let ((filter-alist (if org-agenda-persistent-filter
|
||||
(list `(tag . ,org-agenda-tag-filter)
|
||||
`(re . ,org-agenda-regexp-filter)
|
||||
`(car . ,org-agenda-category-filter)))))
|
||||
(if (org-agenda-use-sticky-p)
|
||||
(progn
|
||||
(setq buffer-read-only nil)
|
||||
(goto-char (point-max))
|
||||
(unless (or (bobp) org-agenda-compact-blocks
|
||||
(not org-agenda-block-separator))
|
||||
(insert "\n"
|
||||
(if (stringp org-agenda-block-separator)
|
||||
org-agenda-block-separator
|
||||
(make-string (window-width) org-agenda-block-separator))
|
||||
"\n"))
|
||||
(narrow-to-region (point) (point-max)))
|
||||
(setq org-done-keywords-for-agenda nil)
|
||||
|
||||
;; Setting any org variables that are in org-agenda-local-vars
|
||||
;; list need to be done after the prepare call
|
||||
(org-agenda-prepare-window (get-buffer-create org-agenda-buffer-name))
|
||||
(setq buffer-read-only nil)
|
||||
(org-agenda-reset-markers)
|
||||
(let ((inhibit-read-only t)) (erase-buffer))
|
||||
(org-agenda-mode)
|
||||
(setq org-agenda-buffer (current-buffer))
|
||||
(setq org-agenda-contributing-files nil)
|
||||
(setq org-agenda-columns-active nil)
|
||||
(org-agenda-prepare-buffers (org-agenda-files nil 'ifmode))
|
||||
(setq org-todo-keywords-for-agenda
|
||||
(org-uniquify org-todo-keywords-for-agenda))
|
||||
(setq org-done-keywords-for-agenda
|
||||
(org-uniquify org-done-keywords-for-agenda))
|
||||
(setq org-agenda-last-prefix-arg current-prefix-arg)
|
||||
(setq org-agenda-this-buffer-name org-agenda-buffer-name)
|
||||
(and name (not org-agenda-name)
|
||||
(org-set-local 'org-agenda-name name)))
|
||||
(setq buffer-read-only nil)))
|
||||
;; Popup existing buffer
|
||||
(org-agenda-prepare-window (get-buffer org-agenda-buffer-name)
|
||||
filter-alist)
|
||||
(message "Sticky Agenda buffer, use `r' to refresh")
|
||||
(or org-agenda-multi (org-agenda-fit-window-to-buffer))
|
||||
(throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
|
||||
(setq org-todo-keywords-for-agenda nil)
|
||||
(put 'org-agenda-tag-filter :preset-filter
|
||||
org-agenda-tag-filter-preset)
|
||||
(put 'org-agenda-category-filter :preset-filter
|
||||
org-agenda-category-filter-preset)
|
||||
(put 'org-agenda-regexp-filter :preset-filter
|
||||
org-agenda-regexp-filter-preset)
|
||||
(if org-agenda-multi
|
||||
(progn
|
||||
(setq buffer-read-only nil)
|
||||
(goto-char (point-max))
|
||||
(unless (or (bobp) org-agenda-compact-blocks
|
||||
(not org-agenda-block-separator))
|
||||
(insert "\n"
|
||||
(if (stringp org-agenda-block-separator)
|
||||
org-agenda-block-separator
|
||||
(make-string (window-width) org-agenda-block-separator))
|
||||
"\n"))
|
||||
(narrow-to-region (point) (point-max)))
|
||||
(setq org-done-keywords-for-agenda nil)
|
||||
;; Setting any org variables that are in org-agenda-local-vars
|
||||
;; list need to be done after the prepare call
|
||||
(org-agenda-prepare-window
|
||||
(get-buffer-ecreate org-agenda-buffer-name) filter-alist)
|
||||
(setq buffer-read-only nil)
|
||||
(org-agenda-reset-markers)
|
||||
(let ((inhibit-read-only t)) (erase-buffer))
|
||||
(org-agenda-mode)
|
||||
(setq org-agenda-buffer (current-buffer))
|
||||
(setq org-agenda-contributing-files nil)
|
||||
(setq org-agenda-columns-active nil)
|
||||
(org-agenda-prepare-buffers (org-agenda-files nil 'ifmode))
|
||||
(setq org-todo-keywords-for-agenda
|
||||
(org-uniquify org-todo-keywords-for-agenda))
|
||||
(setq org-done-keywords-for-agenda
|
||||
(org-uniquify org-done-keywords-for-agenda))
|
||||
(setq org-agenda-last-prefix-arg current-prefix-arg)
|
||||
(setq org-agenda-this-buffer-name org-agenda-buffer-name)
|
||||
(and name (not org-agenda-name)
|
||||
(org-set-local 'org-agenda-name name)))
|
||||
(setq buffer-read-only nil))))
|
||||
|
||||
(defvar org-agenda-overriding-columns-format) ; From org-colview.el
|
||||
(defun org-agenda-finalize ()
|
||||
|
Loading…
Reference in New Issue
Block a user