(internal): org-roam-version save-excursion (#656)

Restore user's point in org-roam.el
This commit is contained in:
N V 2020-05-17 01:46:41 -04:00 committed by GitHub
parent 055669817a
commit 74f12ee8aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1025,11 +1025,12 @@ Otherwise, behave as if called interactively."
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 (with-current-buffer (find-file-noselect (locate-library "org-roam.el"))
(save-match-data (save-excursion
(goto-char (point-min)) (save-match-data
(if (re-search-forward "\\(?:;; Version: \\([^z-a]*?$\\)\\)" nil nil) (goto-char (point-min))
(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)))