]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a regression in 'decipher-digram-list'
authorEli Zaretskii <eliz@gnu.org>
Fri, 18 Mar 2022 11:54:46 +0000 (13:54 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 18 Mar 2022 11:54:46 +0000 (13:54 +0200)
* lisp/play/decipher.el (decipher-stats-buffer): Don't assume the
statistics buffer always exists.  (Bug#54443)

lisp/play/decipher.el

index ae44ecd68174c69c5afdfd87815574c877067fda..aeb4726bb9be2cbc965122eb206155e929f30681 100644 (file)
@@ -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))