Extend & compact doom/info
+ Output is now a couple lines shorter + Now tries to guess Linux distro names and versions + Displays symlinked EMACSDIR and DOOMDIR + Replaces elc-files segment with 'byte-compiled-config trait
This commit is contained in:
parent
510bc7b5b4
commit
1a7536cbd1
1 changed files with 59 additions and 34 deletions
|
@ -111,52 +111,77 @@ ready to be pasted in a bug report on github."
|
||||||
(require 'core-packages)
|
(require 'core-packages)
|
||||||
(let ((default-directory doom-emacs-dir))
|
(let ((default-directory doom-emacs-dir))
|
||||||
(letf! ((defun sh (&rest args) (cdr (apply #'doom-call-process args)))
|
(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)
|
(defun abbrev-path (path)
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
(concat "\\<" (regexp-quote (user-login-name)) "\\>") "$USER"
|
(regexp-opt (list (user-login-name)) 'words) "$USER"
|
||||||
(abbreviate-file-name path))))
|
(abbreviate-file-name path)))
|
||||||
|
(defun symlink-path (file)
|
||||||
|
(format "%s%s" (abbrev-path file)
|
||||||
|
(if (file-symlink-p file)
|
||||||
|
(concat " -> " (file-truename file))
|
||||||
|
""))))
|
||||||
`((system
|
`((system
|
||||||
(type . ,system-type)
|
(info . ,(cons
|
||||||
(config . ,system-configuration)
|
(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))
|
(shell . ,(abbrev-path shell-file-name))
|
||||||
(uname . ,(if IS-WINDOWS "n/a" (sh "uname" "-msrv")))
|
|
||||||
(path . ,(mapcar #'abbrev-path exec-path)))
|
(path . ,(mapcar #'abbrev-path exec-path)))
|
||||||
(emacs
|
(emacs
|
||||||
(dir . ,(abbrev-path (file-truename doom-emacs-dir)))
|
(dir . ,(symlink-path doom-emacs-dir))
|
||||||
(version . ,emacs-version)
|
(version . ,(delq nil (list emacs-version emacs-repository-version (format-time-string "%b %d, %Y" emacs-build-time))))
|
||||||
(build . ,(format-time-string "%b %d, %Y" emacs-build-time))
|
|
||||||
(buildopts . ,system-configuration-options)
|
(buildopts . ,system-configuration-options)
|
||||||
(features . ,system-configuration-features)
|
(features . ,system-configuration-features)
|
||||||
(traits . ,(delq
|
(traits
|
||||||
nil (list (cond ((not doom-interactive-p) 'batch)
|
. ,(delq
|
||||||
((display-graphic-p) 'gui)
|
nil (list (cond ((not doom-interactive-p) 'batch)
|
||||||
('tty))
|
((display-graphic-p) 'gui)
|
||||||
(if (daemonp) 'daemon)
|
('tty))
|
||||||
(if (and (require 'server)
|
(if (daemonp) 'daemon)
|
||||||
(server-running-p))
|
(if (and (require 'server)
|
||||||
'server-running)
|
(server-running-p))
|
||||||
(if (boundp 'chemacs-profiles-path)
|
'server-running)
|
||||||
'chemacs)
|
(if (boundp 'chemacs-profiles-path)
|
||||||
(if (file-exists-p doom-env-file)
|
'chemacs)
|
||||||
'envvar-file)
|
(if (file-exists-p doom-env-file)
|
||||||
(if (featurep 'exec-path-from-shell)
|
'envvar-file)
|
||||||
'exec-path-from-shell)
|
(if (featurep 'exec-path-from-shell)
|
||||||
(if (file-symlink-p user-emacs-directory)
|
'exec-path-from-shell)
|
||||||
'symlinked-emacsdir)
|
(if (file-symlink-p user-emacs-directory)
|
||||||
(if (file-symlink-p doom-private-dir)
|
'symlinked-emacsdir)
|
||||||
'symlinked-doomdir)))))
|
(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
|
(doom
|
||||||
(dir . ,(abbrev-path (file-truename doom-private-dir)))
|
(dir . ,(symlink-path doom-private-dir))
|
||||||
(version . ,doom-version)
|
(version . ,(list doom-version (sh "git" "log" "-1" "--format=%D %h %ci")))
|
||||||
,@(when doom-interactive-p
|
,@(when doom-interactive-p
|
||||||
`((font . ,(bound-and-true-p doom-font))
|
`((font . ,(bound-and-true-p doom-font))
|
||||||
(theme . ,(bound-and-true-p doom-theme))))
|
(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
|
(modules
|
||||||
,@(or (cl-loop with cat = nil
|
,@(or (cl-loop with cat = nil
|
||||||
for key being the hash-keys of doom-modules
|
for key being the hash-keys of doom-modules
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue