diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index df7348b..12c4c32 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2021.0622.201820 +;; Version: 2021.0630.111102 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons org-journal) ;; This program is free software; you can redistribute it and/or modify @@ -56,6 +56,21 @@ (expand-file-name "icons" oni-org-root) "The directory where ‘oni-org’ stores its icons.") +(defun oni-org-document-add-inline-images-startup () + "Add a line to the current org buffer that will make it load images inline." + (interactive) + (unless (derived-mode-p 'org-mode) + (error "Not currently in an org-mode buffer")) + (save-excursion + (goto-char (point-min)) + (let ((header-end (or (search-forward "\n\n" nil t) + (point-max))) + (case-fold-search t)) + (goto-char (point-min)) + (unless (search-forward "#+startup: inlineimages" header-end t) + (goto-char (1- header-end)) + (insert "#+STARTUP: inlineimages\n"))))) + (defun oni-org-expand-to-home (file-name) "Expand FILE-NAME to the base directory for that system. The base for all org files on Windows is u:/, but on my linux @@ -134,6 +149,9 @@ _l_: Store link ^^ _j_: Journal entry ^^ ^^ _f_: Add roam note ^^ ^^ _i_: Insert other note ^^ ^^ _I_: Insert and edit note +^^ ^Document^^^ +^^^^^^------------------------------------------------------------------------ +_di_: Add inlineimages STARTUP " ("l" org-store-link) ("a" org-agenda) @@ -151,7 +169,8 @@ _l_: Store link ^^ _j_: Journal entry (error "Couldn’t load org-roam, you should install ‘oni-org-roam’"))) ("I" (if (require 'oni-org-roam nil t) (call-interactively 'org-roam-insert) - (error "Couldn’t load org-roam, you should install ‘oni-org-roam’")))) + (error "Couldn’t load org-roam, you should install ‘oni-org-roam’"))) + ("di" oni-org-document-add-inline-images-startup)) (defun oni-org-in-dblock-p () "Non-nil when point belongs to a dynamic block."