Redesign doom/info
+ Focus on the important information and cut down on excess. + Prompt the user to open pastebin.com after copying doom-info to clipboard. + Include timestamp in doom-info.
This commit is contained in:
parent
302a76a06e
commit
4192d87dcd
1 changed files with 79 additions and 80 deletions
|
@ -120,21 +120,26 @@ ready to be pasted in a bug report on github."
|
||||||
(regexp-opt (list (user-login-name)) 'words) "$USER"
|
(regexp-opt (list (user-login-name)) 'words) "$USER"
|
||||||
(abbreviate-file-name path)))
|
(abbreviate-file-name path)))
|
||||||
(defun symlink-path (file)
|
(defun symlink-path (file)
|
||||||
(format "%s%s" (abbrev-path file)
|
(let ((truefile (file-truename file)))
|
||||||
(if (file-symlink-p file)
|
(format "%s%s" (abbrev-path file)
|
||||||
(concat " -> " (file-truename file))
|
(if (equal file truefile) ""
|
||||||
""))))
|
(concat " -> " (abbrev-path truefile)))))))
|
||||||
`((system
|
`((generated . ,(format-time-string "%b %d, %Y %H:%M:%S"))
|
||||||
(info . ,(cons (doom-system-distro-version) (sh "uname" "-msr")))
|
(distro . ,(list (doom-system-distro-version) (sh "uname" "-msr")))
|
||||||
(shell . ,(abbrev-path shell-file-name))
|
(emacs . ,(delq
|
||||||
(path . ,(mapcar #'abbrev-path exec-path)))
|
nil (list emacs-version
|
||||||
(emacs
|
emacs-repository-branch
|
||||||
(dir . ,(symlink-path doom-emacs-dir))
|
(substring (or emacs-repository-version "") 0 9)
|
||||||
(version . ,(delq nil (list emacs-version emacs-repository-version (format-time-string "%b %d, %Y" emacs-build-time))))
|
(symlink-path doom-emacs-dir))))
|
||||||
(buildopts . ,system-configuration-options)
|
(doom . ,(list doom-version
|
||||||
(features . ,system-configuration-features)
|
(sh "git" "log" "-1" "--format=%D %h %ci")
|
||||||
(traits
|
(symlink-path doom-private-dir)))
|
||||||
. ,(delq
|
(shell . ,(abbrev-path shell-file-name))
|
||||||
|
(features . ,system-configuration-features)
|
||||||
|
(traits
|
||||||
|
. ,(mapcar
|
||||||
|
#'symbol-name
|
||||||
|
(delq
|
||||||
nil (list (cond ((not doom-interactive-p) 'batch)
|
nil (list (cond ((not doom-interactive-p) 'batch)
|
||||||
((display-graphic-p) 'gui)
|
((display-graphic-p) 'gui)
|
||||||
('tty))
|
('tty))
|
||||||
|
@ -157,58 +162,51 @@ ready to be pasted in a bug report on github."
|
||||||
,doom-private-dir)
|
,doom-private-dir)
|
||||||
:type 'files :match "\\.elc$")
|
:type 'files :match "\\.elc$")
|
||||||
'byte-compiled-config)))))
|
'byte-compiled-config)))))
|
||||||
(doom
|
(modules
|
||||||
(dir . ,(symlink-path doom-private-dir))
|
,@(or (cl-loop with cat = nil
|
||||||
(version . ,(list doom-version (sh "git" "log" "-1" "--format=%D %h %ci")))
|
for key being the hash-keys of doom-modules
|
||||||
,@(when doom-interactive-p
|
if (or (not cat)
|
||||||
`((font . ,(bound-and-true-p doom-font))
|
(not (eq cat (car key))))
|
||||||
(theme . ,(bound-and-true-p doom-theme))))
|
do (setq cat (car key))
|
||||||
(modules
|
and collect cat
|
||||||
,@(or (cl-loop with cat = nil
|
collect
|
||||||
for key being the hash-keys of doom-modules
|
(let* ((flags (doom-module-get cat (cdr key) :flags))
|
||||||
if (or (not cat)
|
(path (doom-module-get cat (cdr key) :path))
|
||||||
(not (eq cat (car key))))
|
(module (append (cond ((null path)
|
||||||
do (setq cat (car key))
|
(list '&nopath))
|
||||||
and collect cat
|
((file-in-directory-p path doom-private-dir)
|
||||||
collect
|
(list '&user)))
|
||||||
(let* ((flags (doom-module-get cat (cdr key) :flags))
|
(if flags
|
||||||
(path (doom-module-get cat (cdr key) :path))
|
`(,(cdr key) ,@flags)
|
||||||
(module (append (cond ((null path)
|
(list (cdr key))))))
|
||||||
(list '&nopath))
|
(if (= (length module) 1)
|
||||||
((file-in-directory-p path doom-private-dir)
|
(car module)
|
||||||
(list '&user)))
|
module)))
|
||||||
(if flags
|
'("n/a")))
|
||||||
`(,(cdr key) ,@flags)
|
(packages
|
||||||
(list (cdr key))))))
|
,@(or (condition-case e
|
||||||
(if (= (length module) 1)
|
(mapcar
|
||||||
(car module)
|
#'cdr (doom--collect-forms-in
|
||||||
module)))
|
(doom-path doom-private-dir "packages.el")
|
||||||
'("n/a")))
|
"package!"))
|
||||||
(packages
|
(error (format "<%S>" e)))
|
||||||
,@(or (condition-case e
|
'("n/a")))
|
||||||
(mapcar
|
,@(when-let (unpins (condition-case e
|
||||||
#'cdr (doom--collect-forms-in
|
(mapcan #'identity
|
||||||
(doom-path doom-private-dir "packages.el")
|
(mapcar
|
||||||
"package!"))
|
#'cdr (doom--collect-forms-in
|
||||||
(error (format "<%S>" e)))
|
(doom-path doom-private-dir "packages.el")
|
||||||
'("n/a")))
|
"unpin!")))
|
||||||
(unpin
|
(error (format "<%S>" e))))
|
||||||
,@(or (condition-case e
|
(cons 'unpin unpins))
|
||||||
(mapcan #'identity
|
(elpa
|
||||||
(mapcar
|
,@(or (condition-case e
|
||||||
#'cdr (doom--collect-forms-in
|
(progn
|
||||||
(doom-path doom-private-dir "packages.el")
|
(package-initialize)
|
||||||
"unpin!")))
|
(cl-loop for (name . _) in package-alist
|
||||||
(error (format "<%S>" e)))
|
collect (format "%s" name)))
|
||||||
'("n/a")))
|
(error (format "<%S>" e)))
|
||||||
(elpa
|
'("n/a")))))))
|
||||||
,@(or (condition-case e
|
|
||||||
(progn
|
|
||||||
(package-initialize)
|
|
||||||
(cl-loop for (name . _) in package-alist
|
|
||||||
collect (format "%s" name)))
|
|
||||||
(error (format "<%S>" e)))
|
|
||||||
'("n/a"))))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -246,21 +244,22 @@ copies it to your clipboard, ready to be pasted into bug reports!"
|
||||||
(let ((sexp (prin1-to-string (sexp-at-point))))
|
(let ((sexp (prin1-to-string (sexp-at-point))))
|
||||||
(delete-region beg end)
|
(delete-region beg end)
|
||||||
(insert sexp))))))
|
(insert sexp))))))
|
||||||
(insert "```\n")
|
(dolist (spec info)
|
||||||
(dolist (group info)
|
(insert! "%11s %s\n"
|
||||||
(insert! "%-8s%-10s %s\n"
|
((car spec)
|
||||||
((upcase (symbol-name (car group)))
|
(if (listp (cdr spec))
|
||||||
(caadr group)
|
(mapconcat (lambda (x) (format "%s" x))
|
||||||
(cdadr group)))
|
(cdr spec) " ")
|
||||||
(dolist (spec (cddr group))
|
(cdr spec))))))
|
||||||
(insert! (indent 8 "%-10s %s\n")
|
|
||||||
((car spec) (cdr spec)))))
|
|
||||||
(insert "```\n"))
|
|
||||||
(if (not doom-interactive-p)
|
(if (not doom-interactive-p)
|
||||||
(print! (buffer-string))
|
(print! (buffer-string))
|
||||||
(pop-to-buffer buffer)
|
(with-current-buffer (pop-to-buffer buffer)
|
||||||
(kill-new (buffer-string))
|
(setq buffer-read-only t)
|
||||||
(print! (green "Copied your doom info to clipboard"))))))
|
(goto-char (point-min))
|
||||||
|
(kill-new (buffer-string))
|
||||||
|
(when (y-or-n-p "Your doom-info was copied to the clipboard.\n\nOpen pastebin.com?")
|
||||||
|
(browse-url "https://pastebin.com")))))))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/am-i-secure ()
|
(defun doom/am-i-secure ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue