From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <838rt7hdb4.fsf@gnu.org> References: <878rt74sos.fsf@polaris64.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31311"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54443@debbugs.gnu.org To: Simon Pugnet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 18 09:33:56 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nV83X-0007y2-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 09:33:56 +0100 Original-Received: from localhost ([::1]:43546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nV83W-0005jp-QP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 04:33:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nV81i-0004Ac-VE for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 04:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34083) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nV81i-0003fd-LA for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 04:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nV81i-0000i3-AG for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 04:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Mar 2022 08:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54443 X-GNU-PR-Package: emacs Original-Received: via spool by 54443-submit@debbugs.gnu.org id=B54443.16475922962693 (code B ref 54443); Fri, 18 Mar 2022 08:32:02 +0000 Original-Received: (at 54443) by debbugs.gnu.org; 18 Mar 2022 08:31:36 +0000 Original-Received: from localhost ([127.0.0.1]:56213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nV81I-0000hN-Dm for submit@debbugs.gnu.org; Fri, 18 Mar 2022 04:31:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nV81H-0000hA-6c for 54443@debbugs.gnu.org; Fri, 18 Mar 2022 04:31:35 -0400 Original-Received: from [2001:470:142:3::e] (port=45176 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nV81B-0003cz-Qy; Fri, 18 Mar 2022 04:31:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lDVzl6ci8PZejbikHnqGBoOoPrmNwTIg8Hfw1F4E160=; b=XBH9BnbilaD5 JuMCqMAV2/0yy2MuZs+BRSnstNVmnkxEWmy9ZfjSxd/IccFKEkhdrpDF5LTMKLNg87dyVb5oFjpf1 5zF5BdgJTwH1RcsGaJkh6I+nifh7yb+3GK7uaLIcfgNAXNzBW5/aCDCa0+W/oOyrULEuHpqK7kPMu QnAVXhDIIeV+F/xPZHTp/juOlgu8O8Nv/F7W5sFPnzktzRdXxukVHXrHN4FpxesDOlWUGElCQcFsh i/pZmxXhdHo7isntfisP0xrH/ggN2Crnwo6ROuJqAuJRfQnkko9Me+U2v2gTV70TG6ixtPFN7ElNA pMPA25ppzPyFU7UHUuWA2g==; Original-Received: from [87.69.77.57] (port=3705 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nV81B-0000uE-AA; Fri, 18 Mar 2022 04:31:29 -0400 In-Reply-To: <878rt74sos.fsf@polaris64.net> (message from Simon Pugnet on Fri, 18 Mar 2022 07:37:44 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228530 Archived-At: > Date: Fri, 18 Mar 2022 07:37:44 +0000 > From: Simon Pugnet > > 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))