aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-03-13 14:53:16 +0800
committerGuangxiong Lin <[email protected]>2022-03-13 14:53:16 +0800
commit787be5e7794ef5bc7197c4e385f05708d2dca340 (patch)
tree9049fca473fcb99b173b54cf6b2cf44e7247f9a5
parent9ffcf0ee68093244c01de67bbe44b02c8c88dfc6 (diff)
downloaddotfiles-787be5e7794ef5bc7197c4e385f05708d2dca340.tar.gz
dotfiles-787be5e7794ef5bc7197c4e385f05708d2dca340.tar.bz2
dotfiles-787be5e7794ef5bc7197c4e385f05708d2dca340.zip
Override org-agenda-quit (emacs)
-rw-r--r--.emacs.d/lisp/init-org.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/.emacs.d/lisp/init-org.el b/.emacs.d/lisp/init-org.el
index 2cb2407..d5f7720 100644
--- a/.emacs.d/lisp/init-org.el
+++ b/.emacs.d/lisp/init-org.el
@@ -21,6 +21,11 @@
((org-ql-block-header "Stuck Projects")))
"A block showing stuck projects.")
+(defun gx/org-agenda-quit (fn)
+ (org-save-all-org-buffers)
+ (funcall fn))
+(advice-add 'org-agenda-quit :around 'gx/org-agenda-quit)
+
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-hook 'org-after-refile-insert-hook 'org-save-all-org-buffers)
@@ -168,12 +173,6 @@
;; (add-hook 'evil-org-mode-hook
;; (lambda ()
;; (setq evil-want-C-i-jump nil)))
-(with-eval-after-load 'evil
- (evil-define-key 'motion org-agenda-mode-map
- (kbd "q") (lambda ()
- (interactive)
- (org-save-all-org-buffers)
- (org-agenda-quit))))
(with-eval-after-load 'evil-org
(evil-org-set-key-theme '(navigation insert textobjects additional calendar todo))
(evil-org-agenda-set-keys)