diff options
| author | Glenn Morris | 2018-08-28 20:35:09 -0400 |
|---|---|---|
| committer | Glenn Morris | 2018-08-28 20:35:09 -0400 |
| commit | d0fc4f3f578ac33b4e11adea4a2281d2b849840e (patch) | |
| tree | 3eccc4362f001adaf2976fea29885c839d4ba2e0 | |
| parent | d4586b7a9cea6aac7d710d59fd29ce1b9a705449 (diff) | |
| download | emacs-d0fc4f3f578ac33b4e11adea4a2281d2b849840e.tar.gz emacs-d0fc4f3f578ac33b4e11adea4a2281d2b849840e.zip | |
* lisp/mail/emacsbug.el (report-emacs-bug--os-description):
Add MS Windows.
| -rw-r--r-- | lisp/mail/emacsbug.el | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index d4caeed7888..43ecddf265c 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el | |||
| @@ -116,6 +116,9 @@ This requires either the macOS \"open\" command, or the freedesktop | |||
| 116 | (concat "mailto:" to))) | 116 | (concat "mailto:" to))) |
| 117 | (error "Subject, To or body not found"))))) | 117 | (error "Subject, To or body not found"))))) |
| 118 | 118 | ||
| 119 | (defvar report-emacs-bug--os-description nil | ||
| 120 | "Cached value of operating system description.") | ||
| 121 | |||
| 119 | (defun report-emacs-bug--os-description () | 122 | (defun report-emacs-bug--os-description () |
| 120 | "Return a string describing the operating system, or nil." | 123 | "Return a string describing the operating system, or nil." |
| 121 | (cond ((eq system-type 'darwin) | 124 | (cond ((eq system-type 'darwin) |
| @@ -129,8 +132,25 @@ This requires either the macOS \"open\" command, or the freedesktop | |||
| 129 | nil t) | 132 | nil t) |
| 130 | (setq os (concat os " " (match-string 1))))))) | 133 | (setq os (concat os " " (match-string 1))))))) |
| 131 | os)) | 134 | os)) |
| 135 | ((eq system-type 'windows-nt) | ||
| 136 | (or report-emacs-bug--os-description | ||
| 137 | (setq | ||
| 138 | report-emacs-bug--os-description | ||
| 139 | (let (os) | ||
| 140 | (with-temp-buffer | ||
| 141 | ;; Seems like this command can be slow, because it | ||
| 142 | ;; unconditionally queries a bunch of other stuff | ||
| 143 | ;; we don't care about. | ||
| 144 | (when (eq 0 (ignore-errors | ||
| 145 | (call-process "systeminfo" nil '(t nil) nil))) | ||
| 146 | (dolist (s '("OS Name" "OS Version")) | ||
| 147 | (goto-char (point-min)) | ||
| 148 | (if (re-search-forward | ||
| 149 | (format "^%s\\s-*:\\s-+\\(.*\\)$" s) | ||
| 150 | nil t) | ||
| 151 | (setq os (concat os " " (match-string 1))))))) | ||
| 152 | os)))) | ||
| 132 | ;; TODO include other branches here. | 153 | ;; TODO include other branches here. |
| 133 | ;; MS Windows: systeminfo ? | ||
| 134 | ;; Cygwin, *BSD, etc: ? | 154 | ;; Cygwin, *BSD, etc: ? |
| 135 | (t | 155 | (t |
| 136 | (or (let ((file "/etc/os-release")) | 156 | (or (let ((file "/etc/os-release")) |