emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dicom e5db7a09a1: Register Org links


From: ELPA Syncer
Subject: [elpa] externals/dicom e5db7a09a1: Register Org links
Date: Sun, 22 Dec 2024 07:00:07 -0500 (EST)

branch: externals/dicom
commit e5db7a09a1feed7fb74c2ac8ddd56276307a5d09
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Register Org links
    
    File links work too, but then the DICOM file content is loaded first into a
    buffer.
---
 dicom.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/dicom.el b/dicom.el
index fa07255870..a5639574d6 100644
--- a/dicom.el
+++ b/dicom.el
@@ -622,5 +622,20 @@ REUSE can be a buffer name to reuse."
   (add-to-list 'auto-mode-alist '("\\.\\(?:dcm\\|ima\\)\\'" . dicom-auto-mode))
   (add-to-list 'auto-mode-alist '("DICOMDIR" . dicom-auto-mode)))
 
+;;;###autoload
+(funcall 'eval-after-load 'ol
+  (lambda ()
+    (declare-function org-link-set-parameters "ol")
+    (declare-function org-link-store-props "ol")
+    (org-link-set-parameters
+     "dicom"
+     :follow (lambda (link _) (dicom-open link))
+     :store
+     (lambda ()
+       (when (eq major-mode 'dicom-mode)
+         (org-link-store-props
+          :type "dicom"
+          :link (concat "dicom:" (abbreviate-file-name dicom--file))))))))
+
 (provide 'dicom)
 ;;; dicom.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]