mirror of
https://github.com/org-roam/org-roam
synced 2025-09-16 15:56:48 -05:00
(fix): prevent org-roam-version from loading org-roam-dev (#659)
Instead of visiting file, insert library into temp buffer. Prevents loading .dir-local dev environment, accompanying unsafe-variable prompt. Prevents interference with org-roam.el if already open.
This commit is contained in:
15
org-roam.el
15
org-roam.el
@@ -1026,13 +1026,14 @@ Otherwise, behave as if called interactively."
|
|||||||
"Return `org-roam' version.
|
"Return `org-roam' version.
|
||||||
Interactively, or when MESSAGE is non-nil, show in the echo area."
|
Interactively, or when MESSAGE is non-nil, show in the echo area."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((version (with-current-buffer (find-file-noselect (locate-library "org-roam.el"))
|
(let* ((version
|
||||||
(save-excursion
|
(with-temp-buffer
|
||||||
(save-match-data
|
(insert-file-contents-literally (locate-library "org-roam.el"))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(if (re-search-forward "\\(?:;; Version: \\([^z-a]*?$\\)\\)" nil nil)
|
(save-match-data
|
||||||
(substring-no-properties (match-string 1))
|
(if (re-search-forward "\\(?:;; Version: \\([^z-a]*?$\\)\\)" nil nil)
|
||||||
"N/A"))))))
|
(substring-no-properties (match-string 1))
|
||||||
|
"N/A")))))
|
||||||
(if (or message (called-interactively-p 'interactive))
|
(if (or message (called-interactively-p 'interactive))
|
||||||
(message "%s" version)
|
(message "%s" version)
|
||||||
version)))
|
version)))
|
||||||
|
Reference in New Issue
Block a user