aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/ycp-org.el3
-rw-r--r--emacs/.emacs.d/lisp/my/my-org.el8
2 files changed, 10 insertions, 1 deletions
diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el
index 71ed6bc..9c9191a 100644
--- a/emacs/.emacs.d/init/ycp-org.el
+++ b/emacs/.emacs.d/init/ycp-org.el
@@ -461,7 +461,8 @@
'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-edit-src-exit :before 'my-org-edit-src-before-exit))
+ (advice-add 'org-edit-src-exit :before 'my-org-edit-src-before-exit)
+ (advice-add 'org-edit-src-exit :after 'my-org-edit-src-after-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 1b99dc5..f02784d 100644
--- a/emacs/.emacs.d/lisp/my/my-org.el
+++ b/emacs/.emacs.d/lisp/my/my-org.el
@@ -79,6 +79,14 @@ With a prefix, insert inactive dates.
"A :before advice for org-edit-src-exit."
(delete-trailing-whitespace))
+(defun my-org-edit-src-after-exit ()
+ "An :after advice for org-edit-src-exit.
+
+Deactivate mark and move point to after the block."
+ (deactivate-mark)
+ (re-search-forward "^[ \t]*#\\+end_")
+ (beginning-of-line 2))
+
;; navigation
(defun my-org-jump-to-last-visible-child ()
"Goto the last visible child."