Skip to content

Commit

Permalink
Readd org-agenda support.
Browse files Browse the repository at this point in the history
* valign.el (valign-org-agenda-finalize-hook): New function.
(valign-mode): use valign-org-agenda-finalize-hook.
  • Loading branch information
tumashu committed May 29, 2020
1 parent 9a9a4a1 commit 2cd12a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions valign.el
Expand Up @@ -455,6 +455,11 @@ for the former, and 'multi-column for the latter."
(add-hook 'jit-lock-functions
#'valign-initial-alignment 90 t))

(defun valign-org-agenda-finalize-hook ()
"Valign hook function use by `org-agenda-finalize-hook'."
(valign-initial-alignment
(point-min) (point-max) t))

(define-minor-mode valign-mode
"valign minor mode."
:global t
Expand All @@ -464,9 +469,11 @@ for the former, and 'multi-column for the latter."
(if (and valign-mode window-system)
(progn
(add-hook 'org-mode-hook #'valign-org-mode-hook)
(add-hook 'org-agenda-finalize-hook #'valign-org-agenda-finalize-hook)
(advice-add 'org-table-next-field :after #'valign-table)
(advice-add 'org-table-previous-field :after #'valign-table))
(remove-hook 'org-mode-hook #'valign-org-mode-hook)
(remove-hook 'org-agenda-finalize-hook #'valign-org-agenda-finalize-hook)
(advice-remove 'org-table-next-field #'valign-table)
(advice-remove 'org-table-previous-field #'valign-table)))

Expand Down

0 comments on commit 2cd12a1

Please sign in to comment.