(feature): org-roam-diagnostics command (#653)

Automates collection of user environment information.
This commit is contained in:
N V 2020-05-17 01:57:38 -04:00 committed by GitHub
parent 74f12ee8aa
commit 7844827757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View file

@ -36,8 +36,8 @@ Example:
<!-- Example: File A is missing -->
### Versions
### Environment
<!-- Please M-x org-roam-diagnostics and paste results here -->
- Emacs (Paste `M-x emacs-version` output here)
- Org (Paste `M-x org-version` output here)
- Org-roam commit: https://github.com/jethrokuan/org-roam/commit/commithashhere

View file

@ -1019,6 +1019,7 @@ Otherwise, behave as if called interactively."
(org-roam-db--update-file file-from)))
(org-roam-db--update-file new-path))))
;;;; Diagnostics
;;;###autoload
(defun org-roam-version (&optional message)
"Return `org-roam' version.
@ -1035,5 +1036,21 @@ Interactively, or when MESSAGE is non-nil, show in the echo area."
(message "%s" version)
version)))
;;;###autoload
(defun org-roam-diagnostics ()
"Collect and print info for `org-roam' issues."
(interactive)
(with-current-buffer (switch-to-buffer-other-window (get-buffer-create "*org-roam diagnostics*"))
(erase-buffer)
(insert (propertize "Copy info below this line into issue:\n" 'face '(:weight bold)))
(insert (format "- Emacs: %s\n" (emacs-version)))
(insert (format "- Framework: %s\n"
(condition-case _
(completing-read "I'm using the following Emacs framework:"
'("Doom" "Spacemacs" "N/A" "I don't know"))
(quit "N/A"))))
(insert (format "- Org: %s\n" (org-version nil 'full)))
(insert (format "- Org-roam: %s" (org-roam-version)))))
(provide 'org-roam)
;;; org-roam.el ends here