lang/org: change recentf/persp clobbering fix
This commit is contained in:
parent
9b1385b725
commit
b6e2599358
|
@ -319,10 +319,14 @@ between the two."
|
||||||
(t . ,(cond (IS-MAC "open -R \"%s\"")
|
(t . ,(cond (IS-MAC "open -R \"%s\"")
|
||||||
(IS-LINUX "xdg-open \"%s\"")))))
|
(IS-LINUX "xdg-open \"%s\"")))))
|
||||||
|
|
||||||
(after! recentf
|
;; Don't clobber recentf or current workspace with agenda files
|
||||||
;; Don't clobber recentf with agenda files
|
(defun +org|exclude-agenda-buffers-from-workspace ()
|
||||||
(defun +org-is-agenda-file (filename)
|
(let (persp-autokill-buffer-on-remove)
|
||||||
(cl-find (file-truename filename) org-agenda-files
|
(persp-remove-buffer org-agenda-new-buffers (get-current-persp) nil)))
|
||||||
:key #'file-truename
|
(add-hook 'org-agenda-finalize-hook #'+org|exclude-agenda-buffers-from-workspace)
|
||||||
:test #'equal))
|
|
||||||
(push #'+org-is-agenda-file recentf-exclude)))
|
(defun +org*exclude-agenda-buffers-from-recentf (orig-fn &rest args)
|
||||||
|
(let ((recentf-exclude (list (lambda (_file) t))))
|
||||||
|
(apply orig-fn args)))
|
||||||
|
(advice-add #'org-get-agenda-file-buffer
|
||||||
|
:around #'+org*exclude-agenda-buffers-from-recentf))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user