Merge branch 'maint'

This commit is contained in:
Kyle Meyer 2021-03-19 00:40:26 -04:00
commit 17e27ea634
1 changed files with 8 additions and 5 deletions

View File

@ -14,7 +14,10 @@
;; Maintainer: stardiviner [numbchild@gmail.com] ;; Maintainer: stardiviner [numbchild@gmail.com]
;;; Code: ;;; Code:
(require 'ob)
(require 'org-element)
;; Org-mode Babel ;; Org-mode Babel
(defun org-babel-execute:smiles (body params) (defun org-babel-execute:smiles (body params)
"Execute SMILES babel `BODY' with `PARAMS'." "Execute SMILES babel `BODY' with `PARAMS'."
@ -25,7 +28,7 @@
(defun molecule-jump (name) (defun molecule-jump (name)
"Jump to molecule `NAME' definition." "Jump to molecule `NAME' definition."
(org-mark-ring-push) (org-mark-ring-push)
(org-link-open-from-string (format "[[%s]]" path))) (org-link-open-from-string (format "[[%s]]" name)))
(defun molecule-export (path desc backend) (defun molecule-export (path desc backend)
"Export molecule to HTML format on `PATH' with `DESC' and `BACKEND'." "Export molecule to HTML format on `PATH' with `DESC' and `BACKEND'."
@ -36,10 +39,10 @@
((eq 'html backend) ((eq 'html backend)
(format "<a href=\"#%s\">%s</a>" name name))))) (format "<a href=\"#%s\">%s</a>" name name)))))
(org-add-link-type (org-link-set-parameters
"molecule" "molecule"
'molecule-jump :follow 'molecule-jump
'molecule-export) :export 'molecule-export)
;; org-mode element ;; org-mode element
(org-element-map (org-element-parse-buffer) (org-element-map (org-element-parse-buffer)