mirror of
https://github.com/librephoenix/nixos-config
synced 2025-04-21 01:34:34 +05:30
I finally got agenda + syncthing to behave
This commit is contained in:
parent
df4eeeb063
commit
e1c7251a70
|
@ -944,6 +944,30 @@ tasks."
|
||||||
;; Adds hook to org agenda mode, making follow mode active in org agenda
|
;; Adds hook to org agenda mode, making follow mode active in org agenda
|
||||||
(add-hook 'org-agenda-mode-hook 'org-agenda-open-hook)
|
(add-hook 'org-agenda-mode-hook 'org-agenda-open-hook)
|
||||||
|
|
||||||
|
;; Auto updates agenda on syncthing changes
|
||||||
|
;; from https://www.reddit.com/r/orgmode/comments/mu6n5b/org_agenda_auto_updating/
|
||||||
|
(defadvice org-agenda-list (before refresh-org-agenda-on-revert activate)
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(unless (verify-visited-file-modtime (get-file-buffer file))
|
||||||
|
(with-current-buffer (get-file-buffer file)
|
||||||
|
(when (eq major-mode 'org-mode)
|
||||||
|
(revert-buffer nil 'noconfirm)))))
|
||||||
|
(org-agenda-files)))
|
||||||
|
(defadvice org-agenda-redo (before refresh-org-agenda-on-revert activate)
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(unless (verify-visited-file-modtime (get-file-buffer file))
|
||||||
|
(with-current-buffer (get-file-buffer file)
|
||||||
|
(when (eq major-mode 'org-mode)
|
||||||
|
(revert-buffer nil 'noconfirm)))))
|
||||||
|
(org-agenda-files)))
|
||||||
|
(defadvice org-agenda-redo-all (before refresh-org-agenda-on-revert activate)
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(unless (verify-visited-file-modtime (get-file-buffer file))
|
||||||
|
(with-current-buffer (get-file-buffer file)
|
||||||
|
(when (eq major-mode 'org-mode)
|
||||||
|
(revert-buffer nil 'noconfirm)))))
|
||||||
|
(org-agenda-files)))
|
||||||
|
|
||||||
;; Function to list all my available org agenda files and switch to them
|
;; Function to list all my available org agenda files and switch to them
|
||||||
(defun list-and-switch-to-agenda-file ()
|
(defun list-and-switch-to-agenda-file ()
|
||||||
"Lists all available agenda files and switches to desired one"
|
"Lists all available agenda files and switches to desired one"
|
||||||
|
|
|
@ -1097,6 +1097,30 @@ On Wayland, EAF doesn't work.
|
||||||
;; Adds hook to org agenda mode, making follow mode active in org agenda
|
;; Adds hook to org agenda mode, making follow mode active in org agenda
|
||||||
(add-hook 'org-agenda-mode-hook 'org-agenda-open-hook)
|
(add-hook 'org-agenda-mode-hook 'org-agenda-open-hook)
|
||||||
|
|
||||||
|
;; Auto updates agenda on syncthing changes
|
||||||
|
;; from https://www.reddit.com/r/orgmode/comments/mu6n5b/org_agenda_auto_updating/
|
||||||
|
(defadvice org-agenda-list (before refresh-org-agenda-on-revert activate)
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(unless (verify-visited-file-modtime (get-file-buffer file))
|
||||||
|
(with-current-buffer (get-file-buffer file)
|
||||||
|
(when (eq major-mode 'org-mode)
|
||||||
|
(revert-buffer nil 'noconfirm)))))
|
||||||
|
(org-agenda-files)))
|
||||||
|
(defadvice org-agenda-redo (before refresh-org-agenda-on-revert activate)
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(unless (verify-visited-file-modtime (get-file-buffer file))
|
||||||
|
(with-current-buffer (get-file-buffer file)
|
||||||
|
(when (eq major-mode 'org-mode)
|
||||||
|
(revert-buffer nil 'noconfirm)))))
|
||||||
|
(org-agenda-files)))
|
||||||
|
(defadvice org-agenda-redo-all (before refresh-org-agenda-on-revert activate)
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(unless (verify-visited-file-modtime (get-file-buffer file))
|
||||||
|
(with-current-buffer (get-file-buffer file)
|
||||||
|
(when (eq major-mode 'org-mode)
|
||||||
|
(revert-buffer nil 'noconfirm)))))
|
||||||
|
(org-agenda-files)))
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Org Agenda Convenience Functions
|
*** Org Agenda Convenience Functions
|
||||||
#+BEGIN_SRC emacs-lisp :tangle config.el
|
#+BEGIN_SRC emacs-lisp :tangle config.el
|
||||||
|
|
Loading…
Reference in a new issue