- (let ((buf (get-buffer-create "*system info*"))
- (map (make-sparse-keymap)))
-
- (define-key map "q" 'kill-this-buffer)
- (display-buffer buf)
- (set-buffer buf)
- (setq show-trailing-whitespace nil)
- (erase-buffer)
-
- (let ((highlight nil))
-
- (mapc (lambda (x)
- (insert
- (if (setq highlight (not highlight))
- (propertize
- (with-temp-buffer (apply 'call-process x)
- (buffer-string))
- 'face '(:background "#d0d0ff"))
- (with-temp-buffer (apply 'call-process x)
- (buffer-string))
- ))
- )
+ (let* ((buf (get-buffer-create "*system info*"))
+ (win (get-buffer-window buf))
+ (map (make-sparse-keymap)))
+
+ (if win
+ (progn
+ (delete-window win)
+ (kill-buffer buf))
+
+ (define-key map "q" 'kill-this-buffer)
+ (display-buffer buf)
+ (set-buffer buf)
+ (setq show-trailing-whitespace nil)
+ (erase-buffer)
+
+ (let ((highlight nil))
+
+ (mapc (lambda (x)
+ (insert
+ (if (setq highlight (not highlight))
+ (propertize
+ (with-temp-buffer (apply 'call-process x)
+ (buffer-string))
+ 'face '(:background "#d0d0ff"))
+ (with-temp-buffer (apply 'call-process x)
+ (buffer-string))
+ ))
+ )