diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1bf9e50..4825cc3 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -36,8 +36,8 @@ Example: -### Versions +### Environment + + -- 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 diff --git a/org-roam.el b/org-roam.el index 6f4bf8e..260714c 100644 --- a/org-roam.el +++ b/org-roam.el @@ -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