fix(lib): vestigial call to missing cat function
This was brought over from `doom-info` in f33d8e7, but one of the lexical function calls wasn't refactored out. Ref:a5c80fcb4b/lisp/lib/debug.el (L216-L219)
Fix: #6698 Amend:c5e3f4d632
Co-authored-by: ivanbrennan <ivanbrennan@users.noreply.github.com>
This commit is contained in:
parent
c44bc81a05
commit
98b8f01de3
1 changed files with 13 additions and 6 deletions
|
@ -10,7 +10,8 @@
|
||||||
(IS-MAC 'macos)
|
(IS-MAC 'macos)
|
||||||
((and (file-exists-p "/etc/os-release")
|
((and (file-exists-p "/etc/os-release")
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents "/etc/os-release")
|
(let ((coding-system-for-read 'utf-8-auto))
|
||||||
|
(insert-file-contents "/etc/os-release"))
|
||||||
(when (re-search-forward "^ID=\"?\\([^\"\n]+\\)\"?" nil t)
|
(when (re-search-forward "^ID=\"?\\([^\"\n]+\\)\"?" nil t)
|
||||||
(intern (downcase (match-string 1)))))))
|
(intern (downcase (match-string 1)))))))
|
||||||
;; A few redundancies in case os-release fails us
|
;; A few redundancies in case os-release fails us
|
||||||
|
@ -28,7 +29,8 @@
|
||||||
(defun doom-system-distro-version ()
|
(defun doom-system-distro-version ()
|
||||||
"Return a distro name and version string."
|
"Return a distro name and version string."
|
||||||
(letf! (defun sh (&rest args) (cdr (apply #'doom-call-process args)))
|
(letf! (defun sh (&rest args) (cdr (apply #'doom-call-process args)))
|
||||||
(let ((distro (doom-system-distro)))
|
(let ((distro (doom-system-distro))
|
||||||
|
(coding-system-for-read 'utf-8-auto))
|
||||||
(cond
|
(cond
|
||||||
((eq distro 'windows)
|
((eq distro 'windows)
|
||||||
(format "Windows %s" "Unknown")) ; TODO
|
(format "Windows %s" "Unknown")) ; TODO
|
||||||
|
@ -40,12 +42,17 @@
|
||||||
(format "NixOS %s" (sh "nixos-version")))
|
(format "NixOS %s" (sh "nixos-version")))
|
||||||
((and (file-exists-p "/etc/os-release")
|
((and (file-exists-p "/etc/os-release")
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents "/etc/os-release")
|
(insert-file-contents "/etc/os-release")
|
||||||
(when (re-search-forward "^PRETTY_NAME=\"?\\([^\"\n]+\\)\"?" nil t)
|
(when (re-search-forward "^PRETTY_NAME=\"?\\([^\"\n]+\\)\"?" nil t)
|
||||||
(match-string 1)))))
|
(match-string 1)))))
|
||||||
((when-let (files (doom-glob "/etc/*-release"))
|
((when-let (files (doom-glob "/etc/*-release"))
|
||||||
(truncate-string-to-width
|
(truncate-string-to-width
|
||||||
(replace-regexp-in-string "\n" " " (cat (car files) 73) nil t)
|
(replace-regexp-in-string
|
||||||
|
"\n" " "
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents (car files) nil nil 73)
|
||||||
|
(buffer-string))
|
||||||
|
nil t)
|
||||||
64 nil nil "...")))
|
64 nil nil "...")))
|
||||||
((concat "Unknown " (sh "uname" "-v")))))))
|
((concat "Unknown " (sh "uname" "-v")))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue