Experimenting with org-krita

This commit is contained in:
Emmet 2024-04-02 23:13:28 -05:00
parent 9eccb97326
commit f4c52cc68e
3 changed files with 74 additions and 2 deletions

View file

@ -434,6 +434,30 @@ same directory as the org-buffer and insert a link to this file."
))
(openwith-mode 1)))
(add-load-path! "~/.emacs.d/org-krita")
(require 'org-krita)
(add-hook 'org-mode-hook 'org-krita-mode)
(defun org-krita-show-link (link)
(org-krita-hide-link link)
(let* ((start (org-element-property :begin link))
(end (org-element-property :end link))
(overlay (make-overlay (+ start 0) (+ end 0)))
(kra-path (org-element-property :path link)))
(overlay-put overlay 'display (create-image (org-krita-extract-png kra-path) 'png t :scale 0.5))
(push (cons kra-path overlay) org-krita-overlays)))
(defun org-krita-edit (path &optional full-mode)
"Edit given PATH in krita canvasonly mode.
If FULL-MODE is not null, run full krita."
(let ((kra-path (expand-file-name path)))
(when (f-exists-p kra-path)
(if full-mode
(call-process org-krita-executable nil 0 nil kra-path)
(call-process org-krita-executable nil 0 nil kra-path))
(org-krita-add-watcher kra-path))))
(defun org-copy-link-to-clipboard-at-point ()
"Copy current link at point into clipboard (useful for images and links)"
;; Remember to press C-g to kill this foreground process if it hangs!
@ -956,6 +980,8 @@ same directory as the org-buffer and insert a link to this file."
'(org-agenda-date-weekend :ineherit outline-2 :height 1.15)
'(org-agenda-date-weekend-today :inherit outline-4 :height 1.15)
'(org-super-agenda-header :inherit custom-button :weight bold :height 1.05)
'(link :foreground unspecified :underline nil :background "#46354a")
'(org-link :foreground unspecified)
)
;; Toggle completed entries function