diff options
author | Yuchen Pei <id@ypei.org> | 2023-08-19 22:08:41 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-08-19 22:08:41 +1000 |
commit | ad4f5144f884f1f10d95dcb9e8ee6962c704341e (patch) | |
tree | 0aefbc99493c748680733568576de4a948e90562 | |
parent | 851b8f5fac389364c579aabb8e8fba344a3f6929 (diff) |
some tweaks in org
-rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-org.el | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index da56b51..71ed6bc 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -380,6 +380,7 @@ (my-package org-attach (:delay 15) (setq org-attach-store-link-p 'attached) + (setq org-attach-sync-delete-empty-dir t) (require 'my-org) (my-setq-from-local my-org-attach-copy-attached-targets) (add-to-list 'org-attach-commands '((?k) my-org-attach-copy-attached-docs @@ -459,7 +460,8 @@ (advice-add 'org-capture-place-template :around 'my-org-capture-place-template-dont-delete-windows)) - (advice-add 'org-insert-structure-template :after 'my-org-edit-special)) + (advice-add 'org-insert-structure-template :after 'my-org-edit-special) + (advice-add 'org-edit-src-exit :before 'my-org-edit-src-before-exit)) (my-package my-org (:delay 30) diff --git a/emacs/.emacs.d/lisp/my/my-org.el b/emacs/.emacs.d/lisp/my/my-org.el index 63db9fa..1b99dc5 100644 --- a/emacs/.emacs.d/lisp/my/my-org.el +++ b/emacs/.emacs.d/lisp/my/my-org.el @@ -75,6 +75,10 @@ With a prefix, insert inactive dates. (when (eq major-mode 'mhtml-mode) (browse-url-of-buffer))) +(defun my-org-edit-src-before-exit () + "A :before advice for org-edit-src-exit." + (delete-trailing-whitespace)) + ;; navigation (defun my-org-jump-to-last-visible-child () "Goto the last visible child." |