unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Simon Pugnet <simon@polaris64.net>
Cc: 54443@debbugs.gnu.org
Subject: bug#54443: 29.0.50; decipher.el: (wrong-type-argument bufferp nil) when calling decipher-digram-list (and others)
Date: Fri, 18 Mar 2022 10:31:27 +0200	[thread overview]
Message-ID: <838rt7hdb4.fsf@gnu.org> (raw)
In-Reply-To: <878rt74sos.fsf@polaris64.net> (message from Simon Pugnet on Fri,  18 Mar 2022 07:37:44 +0000)

> Date: Fri, 18 Mar 2022 07:37:44 +0000
> From: Simon Pugnet <simon@polaris64.net>
> 
> I recently found out about the decipher package, but when trying it I
> get the following error: -
> 
> Debugger entered--Lisp error: (wrong-type-argument bufferp nil)
>   decipher-stats-buffer(t)
>   decipher-analyze-buffer()
>   decipher-analyze()
>   decipher-digram-list()
>   funcall-interactively(decipher-digram-list)
>   command-execute(decipher-digram-list)
> 
> To reproduce: -
> 
> 1. emacs -Q
> 2. M-x decipher
> 3. Press D to call decipher-digram-list

Thanks.  Does the patch below give good results?

diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index ae44ecd..aeb4726 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -983,13 +983,14 @@ decipher-stats-buffer
     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	other threads:[~2022-03-18  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  7:37 bug#54443: 29.0.50; decipher.el: (wrong-type-argument bufferp nil) when calling decipher-digram-list (and others) Simon Pugnet
2022-03-18  8:31 ` Eli Zaretskii [this message]
2022-03-18  9:07   ` Simon Pugnet
2022-03-18 11:57     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838rt7hdb4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=54443@debbugs.gnu.org \
    --cc=simon@polaris64.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).