![]() This looks fairly magical (and it is), but when you break it down into its building blocks, it's nothing more than recording your keystrokes and replaying them. (run-hook-with-args 'org-cycle-hook 'children)īeware, this was a minimal effort (with redundant code, duplication, etc) and should likely be considered a proof of concept of sorts, but the results look promising. ( when ( and backward (org-babel-where-is-src-block-head)) "Similar to ` org-next-block ' but for returning position. ( defun ar/org-next-block-pos ( &optional backward) ( and (not backward) (> pos-after pos-before)))) ( when ( and pos-after ( or ( and backward (> pos-before pos-after)) ( defun ar/org-next-link-pos ( &optional backward) ( when ( and pos-after (not (equal pos-before pos-after))) (org-next-visible-heading ( if backward -1 1)) "Similar to ` org-next-visible-heading ' but for returning position. ( defun ar/org-next-visible-heading-pos ( &optional backward) ![]() (closest-pos ( when ( or heading-pos link-pos block-pos) (block-pos (ar/org-next-block-pos backward)) (link-pos (ar/org-next-link-pos backward)) ( let* ((heading-pos (ar/org-next-visible-heading-pos backward)) ( if ( and backward (eq (point) (point-min))) Beginning of slide, go to previous slide. ( defun ar/org-present-next-item ( &optional backward) To restore balance to the galaxy, I also added ar/org-present-previous-item. Now that I can find out the next location of either of these items, I can subsequently glue the navigation logic in a function like ar/org-present-next-item. This gave me ar/rg-next-visible-heading-pos, ar/rg-next-link-pos, and ar/rg-next-block-pos respectively. I wrapped the existing functions to enable returning positions. While these make it easy to jump through jump between headings, links, org block on their own, I wanted to jump to whichever one of these is next (similar a web browser's tab behaviour). Collapse all but the current top-level heading within the slide, as navigation focus changes.Ī quick search for existing functions led me to org-next-visible-heading, org-next-link, and org-next-block.Subheadings, links, and code blocks would be a good start. Easily jump between areas of interest.There were two things I wanted to achieve: ![]() This lead me to think about slide navigation in general… I personally liked his practice of collapsing slide subheadings by default. David's touches bring the wonderfully stylish icing to the cake. Org-present's spartan but effective approach resonated with me. If you're looking for ways to present from Emacs itself, David's post is well worth a look. I had been meaning to check out David Wilson's System Crafters post detailing his presentations style achieved with the help of org-present and his own customizations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |