diff options
author | Raul Benencia <raul@thousandeyes.com> | 2024-10-11 15:08:06 -0700 |
---|---|---|
committer | Raul Benencia <raul@thousandeyes.com> | 2024-10-11 15:08:06 -0700 |
commit | 0e3dccbe05aedd4fb5a7afb677324e773458655b (patch) | |
tree | 1c3fe7980e6e39164528b1dcbc0e6bb95a291c77 | |
parent | 66ac4d8b55d1d5ad5da6be79ad5c756345b6ac00 (diff) |
emacs: rm delete-frame-after-capture logic
It's a bit buggy. I'll re-read and implement.
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-org.el | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/.emacs.d/rul-lisp/packages/rul-org.el b/.emacs.d/rul-lisp/packages/rul-org.el index d076948..3787769 100644 --- a/.emacs.d/rul-lisp/packages/rul-org.el +++ b/.emacs.d/rul-lisp/packages/rul-org.el @@ -84,39 +84,15 @@ ("L" "Web Link" entry (file+headline org-refile-path "Read later") - "* %?[[%:link][%:description]] %(progn (setq rul/delete-frame-after-capture 1) \"\")\n %:initial\n \nCaptured On: %U" + "* %?[[%:link][%:description]] \"\")\n %:initial\n \nCaptured On: %U" ) ("l" "Web Link with Selection" entry (file+headline org-refile-path "Read later") - "* [[%:link][%:description]] %(progn (setq rul/delete-frame-after-capture 1) \"\")\n %:initial\n \nCaptured On: %U") + "* [[%:link][%:description]] \n %:initial\n \nCaptured On: %U") ))) -(defvar rul/delete-frame-after-capture 0 "Whether to delete the last frame after the current capture") - -(defun rul/delete-frame-if-necessary () - "Delete the last frame if necessary." - (cond - ((= rul/delete-frame-after-capture 0) nil) - ((> rul/delete-frame-after-capture 1) - (setq rul/delete-frame-after-capture (- rul/delete-frame-after-capture 1))) - (t - (setq rul/delete-frame-after-capture 0) - (delete-frame)))) - -(defun rul/org-capture-before () - "Function to run before org capture." - (setq rul/delete-frame-after-capture (1+ rul/delete-frame-after-capture))) - -(defun rul/org-capture-after () - "Function to run after org capture." - (rul/delete-frame-if-necessary)) - -(advice-add 'org-capture-finalize :after 'rul/delete-frame-if-necessary) -(advice-add 'org-capture-kill :after 'rul/delete-frame-if-necessary) -(advice-add 'org-capture-refile :after 'rul/delete-frame-if-necessary) - ;; REFILE ;; ; Targets include this file and any file contributing to the agenda - up to 3 levels deep |