Function: org-agenda-finalize

org-agenda-finalize is a byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-finalize)

Documentation

Finishing touch for the agenda buffer.

This function is called just before displaying the agenda. If you want to add your own functions to the finalization of the agenda display, configure org-agenda-finalize-hook.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-finalize ()
  "Finishing touch for the agenda buffer.
This function is called just before displaying the agenda.  If
you want to add your own functions to the finalization of the
agenda display, configure `org-agenda-finalize-hook'."
  (unless org-agenda-multi
    (let ((inhibit-read-only t))
      (save-excursion
	(goto-char (point-min))
	(save-excursion
	  (while (org-activate-links (point-max))
	    (goto-char (match-end 0))))
	(unless (eq org-agenda-remove-tags t)
	  (org-agenda-align-tags))
	(unless org-agenda-with-colors
	  (remove-text-properties (point-min) (point-max) '(face nil)))
	(when (bound-and-true-p org-overriding-columns-format)
	  (setq-local org-local-columns-format
		      org-overriding-columns-format))
	(when org-agenda-view-columns-initially
	  (org-agenda-columns))
	(when org-agenda-fontify-priorities
	  (org-agenda-fontify-priorities))
	(when (and org-agenda-dim-blocked-tasks org-blocker-hook)
	  (org-agenda-dim-blocked-tasks))
	(org-agenda-mark-clocking-task)
	(when org-agenda-entry-text-mode
	  (org-agenda-entry-text-hide)
	  (org-agenda-entry-text-show))
	(when (and (featurep 'org-habit)
		   (save-excursion (next-single-property-change (point-min) 'org-habit-p)))
	  (org-habit-insert-consistency-graphs))
	(setq org-agenda-type (org-get-at-bol 'org-agenda-type))
	(unless (or (eq org-agenda-show-inherited-tags 'always)
		    (and (listp org-agenda-show-inherited-tags)
			 (memq org-agenda-type org-agenda-show-inherited-tags))
		    (and (eq org-agenda-show-inherited-tags t)
			 (or (eq org-agenda-use-tag-inheritance t)
			     (and (listp org-agenda-use-tag-inheritance)
				  (not (memq org-agenda-type
					     org-agenda-use-tag-inheritance))))))
	  (let (mrk)
	    (save-excursion
	      (goto-char (point-min))
	      (while (equal (forward-line) 0)
		(when (setq mrk (get-text-property (point) 'org-hd-marker))
                  (put-text-property (line-beginning-position) (line-end-position)
				     'tags
				     (org-with-point-at mrk
				       (org-get-tags))))))))
	(setq org-agenda-represented-tags nil
	      org-agenda-represented-categories nil)
	(when org-agenda-top-headline-filter
	  (org-agenda-filter-top-headline-apply
	   org-agenda-top-headline-filter))
	(when org-agenda-tag-filter
	  (org-agenda-filter-apply org-agenda-tag-filter 'tag t))
	(when (assoc-default 'tag org-agenda-filters-preset)
	  (org-agenda-filter-apply
	   (assoc-default 'tag org-agenda-filters-preset) 'tag t))
	(when org-agenda-category-filter
	  (org-agenda-filter-apply org-agenda-category-filter 'category))
	(when (assoc-default 'category org-agenda-filters-preset)
	  (org-agenda-filter-apply
	   (assoc-default 'category org-agenda-filters-preset) 'category))
	(when org-agenda-regexp-filter
	  (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
	(when (assoc-default 'regexp org-agenda-filters-preset)
	  (org-agenda-filter-apply
	   (assoc-default 'regexp org-agenda-filters-preset) 'regexp))
	(when org-agenda-effort-filter
	  (org-agenda-filter-apply org-agenda-effort-filter 'effort))
	(when (assoc-default 'effort org-agenda-filters-preset)
	  (org-agenda-filter-apply
	   (assoc-default 'effort org-agenda-filters-preset) 'effort))
	(add-hook 'kill-buffer-hook #'org-agenda-reset-markers 'append 'local))
      (run-hooks 'org-agenda-finalize-hook))))