aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shoshin-config.el5
-rw-r--r--shoshin-config.org17
2 files changed, 22 insertions, 0 deletions
diff --git a/shoshin-config.el b/shoshin-config.el
index 8bd307e..6fecaed 100644
--- a/shoshin-config.el
+++ b/shoshin-config.el
@@ -70,6 +70,11 @@
(package-install 'markdown-mode)
+(defun my-org-top-level-heading ()
+ (interactive)
+ (let ((moo 1))
+ (while moo (setq moo (org-up-heading-safe)))))
+
(package-install 'htmlize)
(recentf-mode)
diff --git a/shoshin-config.org b/shoshin-config.org
index e9accc2..b67f689 100644
--- a/shoshin-config.org
+++ b/shoshin-config.org
@@ -397,6 +397,23 @@ config might get what i want with vanilla built ins.
#+end_src
** org mode
+*** jump to top level parent heading
+
+a friend was wanting this functionality, so i dug around in the org functions
+to find one i could build a command out of:
+
+#+begin_src emacs-lisp
+ (defun my-org-top-level-heading ()
+ (interactive)
+ (let ((moo 1))
+ (while moo (setq moo (org-up-heading-safe)))))
+#+end_src
+
+~org-up-heading-safe~ is designed not to throw an error and returns the level
+of the headline found (as it goes up) or nil if no higher level is found.
+this just uses a dumb while loop to call it until it returns nil, which should
+get us where we are looking to go 😃
+
*** exporting
#+begin_src
(require 'ox-md)