diff --git a/core/autoload/debug.el b/core/autoload/debug.el index 2c3c5f653..8099ada26 100644 --- a/core/autoload/debug.el +++ b/core/autoload/debug.el @@ -111,52 +111,77 @@ ready to be pasted in a bug report on github." (require 'core-packages) (let ((default-directory doom-emacs-dir)) (letf! ((defun sh (&rest args) (cdr (apply #'doom-call-process args))) + (defun cat (file &optional limit) + (with-temp-buffer + (insert-file-contents file nil 0 limit) + (buffer-string))) (defun abbrev-path (path) (replace-regexp-in-string - (concat "\\<" (regexp-quote (user-login-name)) "\\>") "$USER" - (abbreviate-file-name path)))) + (regexp-opt (list (user-login-name)) 'words) "$USER" + (abbreviate-file-name path))) + (defun symlink-path (file) + (format "%s%s" (abbrev-path file) + (if (file-symlink-p file) + (concat " -> " (file-truename file)) + "")))) `((system - (type . ,system-type) - (config . ,system-configuration) + (info . ,(cons + (cond + (IS-WINDOWS "Windows") + (IS-MAC (format "MacOS "(sh "sw_vers" "-productVersion"))) + ((executable-find "lsb_release") + (sh "lsb_release" "-s" "-d")) + ((executable-find "nixos-version") + (format "NixOS %s" (sh "nixos-version"))) + ((file-exists-p "/etc/os-release") + (let ((release (cat "/etc/os-release"))) + (when (string-match "^PRETTY_NAME=\"\\([^\"]+\\)\"" release) + (match-string 1 release)))) + ((file-exists-p "/etc/debian_version") + (format "Debian %s" (car "/etc/debian_version"))) + ((when-let (files (doom-glob "/etc/*-release")) + (truncate-string-to-width + (replace-regexp-in-string "\n" " " (cat (car files) 73) nil t) + 64 nil nil "..."))) + ((concat "Unknown " (sh "uname" "-v")))) + (sh "uname" "-msr"))) (shell . ,(abbrev-path shell-file-name)) - (uname . ,(if IS-WINDOWS "n/a" (sh "uname" "-msrv"))) (path . ,(mapcar #'abbrev-path exec-path))) (emacs - (dir . ,(abbrev-path (file-truename doom-emacs-dir))) - (version . ,emacs-version) - (build . ,(format-time-string "%b %d, %Y" emacs-build-time)) + (dir . ,(symlink-path doom-emacs-dir)) + (version . ,(delq nil (list emacs-version emacs-repository-version (format-time-string "%b %d, %Y" emacs-build-time)))) (buildopts . ,system-configuration-options) (features . ,system-configuration-features) - (traits . ,(delq - nil (list (cond ((not doom-interactive-p) 'batch) - ((display-graphic-p) 'gui) - ('tty)) - (if (daemonp) 'daemon) - (if (and (require 'server) - (server-running-p)) - 'server-running) - (if (boundp 'chemacs-profiles-path) - 'chemacs) - (if (file-exists-p doom-env-file) - 'envvar-file) - (if (featurep 'exec-path-from-shell) - 'exec-path-from-shell) - (if (file-symlink-p user-emacs-directory) - 'symlinked-emacsdir) - (if (file-symlink-p doom-private-dir) - 'symlinked-doomdir))))) + (traits + . ,(delq + nil (list (cond ((not doom-interactive-p) 'batch) + ((display-graphic-p) 'gui) + ('tty)) + (if (daemonp) 'daemon) + (if (and (require 'server) + (server-running-p)) + 'server-running) + (if (boundp 'chemacs-profiles-path) + 'chemacs) + (if (file-exists-p doom-env-file) + 'envvar-file) + (if (featurep 'exec-path-from-shell) + 'exec-path-from-shell) + (if (file-symlink-p user-emacs-directory) + 'symlinked-emacsdir) + (if (file-symlink-p doom-private-dir) + 'symlinked-doomdir) + (if (doom-files-in `(,@doom-modules-dirs + ,doom-core-dir + ,doom-private-dir) + :type 'files :match "\\.elc$") + 'byte-compiled-config))))) (doom - (dir . ,(abbrev-path (file-truename doom-private-dir))) - (version . ,doom-version) + (dir . ,(symlink-path doom-private-dir)) + (version . ,(list doom-version (sh "git" "log" "-1" "--format=%D %h %ci"))) ,@(when doom-interactive-p `((font . ,(bound-and-true-p doom-font)) (theme . ,(bound-and-true-p doom-theme)))) - (build . ,(sh "git" "log" "-1" "--format=%D %h %ci")) - (elc-files - . ,(length (doom-files-in `(,@doom-modules-dirs - ,doom-core-dir - ,doom-private-dir) - :type 'files :match "\\.elc$"))) (modules ,@(or (cl-loop with cat = nil for key being the hash-keys of doom-modules