emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 c4596c8522: Fix a regression in 'decipher-digram-list'


From: Eli Zaretskii
Subject: emacs-28 c4596c8522: Fix a regression in 'decipher-digram-list'
Date: Fri, 18 Mar 2022 07:56:27 -0400 (EDT)

branch: emacs-28
commit c4596c8522e221ecff847a4d997c133436b07e1a
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix a regression in 'decipher-digram-list'
    
    * lisp/play/decipher.el (decipher-stats-buffer): Don't assume the
    statistics buffer always exists.  (Bug#54443)
---
 lisp/play/decipher.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index ae44ecd681..aeb4726bb9 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]