summaryrefslogtreecommitdiff
path: root/lisp/play/decipher.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/play/decipher.el')
-rw-r--r--lisp/play/decipher.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index ae44ecd6817..aeb4726bb9b 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -983,13 +983,14 @@ if it can't, it signals an error."
decipher-stats-buffer)
;; Create a new buffer if requested:
(create
- (let ((stats-name (concat "*" (buffer-name) "*")))
+ (let* ((stats-name (concat "*" (buffer-name) "*"))
+ (buf (get-buffer stats-name)))
(setq decipher-stats-buffer
- (if (eq 'decipher-stats-mode
- (buffer-local-value 'major-mode
- (get-buffer stats-name)))
- ;; We just lost track of the statistics buffer:
- (get-buffer stats-name)
+ (if (and (bufferp buf)
+ (eq 'decipher-stats-mode
+ (buffer-local-value 'major-mode buf)))
+ buf
+ ;; We just lost track of the statistics buffer:
(generate-new-buffer stats-name))))
(with-current-buffer decipher-stats-buffer
(decipher-stats-mode))