From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 14 12:12:29 2020 Received: (at submit) by debbugs.gnu.org; 14 Sep 2020 16:12:29 +0000 Received: from localhost ([127.0.0.1]:56010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHr5g-00008e-Nu for submit@debbugs.gnu.org; Mon, 14 Sep 2020 12:12:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:50168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHr5d-00008T-RD for submit@debbugs.gnu.org; Mon, 14 Sep 2020 12:12:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHr5d-0008Ks-GB for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 12:12:25 -0400 Received: from sonic304-22.consmr.mail.ir2.yahoo.com ([77.238.179.147]:42232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHr5a-0003P2-7d for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 12:12:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1600099938; bh=MtjdQ4V5wSn6zkCG4EsgTKDouFdwAyfRMPcic7t8ICM=; h=From:To:Subject:Date:References:From:Subject; b=tw1kkjgyxtM0sKpPZhY0uCorgypCz5HWGX7hRv6xUplDn9tKlTO7l9aRdrrUtcNWrYiT0xTHoqphcbdTp7DGWpdE7Fb0h+OhL9UVDX++ZC77FI9WXayIb4GMiRX4DK1Kxmbw9N5DSzhB7WXCMvCW60tQFNjZsfCB0aw6mxmk5VFCOnCg3RJsDAESQ1RNE4/8QaHVEdPQd7tr5PpDvxNiddIIyJiS3am5Stalri6/1Yr7RKAel29evhtgYBVXANXwtijbP0W8V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1Pvb0tdQlcRMr3v67hOd17yPq9JXuzwALXQcNvG83UwkC1MPQxKIRb4sO_O3y qzv6kdWOsdQQVxAyWjvhnUids8BwcSrQoSnDyclSyySNNTvkNSR0WjFrZ1nrmdJGa8Og2kHCKISK 5_Ma1Yr3_egAFfbJSje5Srm1oEYwvjpS2UmVS.Yss0y6teXcs1ATlvpFpc5LGuAFE6CyeB4FumUX 2X8cNhABRMXeshgoAxLyQz1MFtYCOrgWeoqSiZe9dUMOQeAT4JO7Z0RUcQIGx2Ff3F86UbP.ik5U tAGhb1EdVt54kTUfJ42Bi2ajTiAvPuAEUz6RQGFftPplLnhxFuTaA8YmhU_J5GLoICbf_17KatAC JoDTEX8GrbmpauHvMZcEkndSuJEhMaRl.fFjzPrAnol.zG4kKx641ia.OhQqzoQ4RNaYFXB2FuFq 33Gw9fuB7VCzrFpcvyELDXmZ1Xo.MV1WWJksshdubyXuz1WB6e_BkzRhDYcelnf5z2cYSonZcL5F Os1oinrDccYlpC1RVXvV6X2nxCvVK6P64b_G_Xmcx7YNOA8R7azbW7Drg7MX1 Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Mon, 14 Sep 2020 16:12:18 +0000 Received: by smtp417.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID af2c6ca677efc03304816abff320d586; Mon, 14 Sep 2020 16:12:12 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: bug-gnu-emacs@gnu.org Subject: 28.0.50; [PATCH] Emacs Lisp type error when the buffer passed to diff-buffer-with-file is not visiting a file Date: Mon, 14 Sep 2020 18:12:11 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" References: X-Mailer: WebService/1.1.16565 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Content-Length: 1550 Received-SPF: pass client-ip=77.238.179.147; envelope-from=mardani29@yahoo.es; helo=sonic304-22.consmr.mail.ir2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 12:12:18 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Steps to reproduce the problem: emacs -Q C-x b "Sample" RET (that is, create an empty buffer) M-x diff-buffer-with-file RET RET (confirm the default buffer) Actual result: Emacs shows "Wrong type argument: stringp, nil" Expected result: Emacs shows a more descriptive error that explains why the command couldn't be executed. I've attached a patch that implements the expected result. Thank you very much. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Check-that-the-buffer-in-diff-buffer-with-file-is-vi.patch >From 5fdeef8b44a4742ef9f745981e3c202a43697085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Mon, 14 Sep 2020 17:58:58 +0200 Subject: [PATCH] Check that the buffer in diff-buffer-with-file is visiting a file * lisp/vc/diff.el (diff-buffer-with-file): Signal a specific error when the buffer passed to diff-buffer-with-file is not visiting a file. --- lisp/vc/diff.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 469888078c..b7f17bf3c7 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -258,6 +258,8 @@ diff-buffer-with-file (interactive "bBuffer: ") (let ((buf (get-buffer (or buffer (current-buffer))))) (with-current-buffer (or (buffer-base-buffer buf) buf) + (unless buffer-file-name + (error "Buffer is not visiting a file")) (diff buffer-file-name (current-buffer) nil 'noasync)))) ;;;###autoload -- 2.28.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 08:56:42 2020 Received: (at 43401) by debbugs.gnu.org; 15 Sep 2020 12:56:42 +0000 Received: from localhost ([127.0.0.1]:57692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIAVl-0002lV-Sl for submit@debbugs.gnu.org; Tue, 15 Sep 2020 08:56:42 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIAVk-0002lC-50 for 43401@debbugs.gnu.org; Tue, 15 Sep 2020 08:56:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=GsJawVGlMzWuAnX2cmHPfhFHHI5gcRAomk4Re3UVuVM=; b=PiswOxhP8n4aqwzp87OEQb0XlY RbUlSsqHMNjbntWq3k3G9IaYakPgfVuUHEfOVZDeLwSnrs+ucZHOn1ZXwrxUQKjc76PYDSE+edQRq cExOBGBCzPQzkn+2KJem8EwrzlWPFLl60gBdnQsGqKEODeOeV1hkZBMEABkZlm+m50kM=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIAVa-0000MJ-RS; Tue, 15 Sep 2020 14:56:33 +0200 From: Lars Ingebrigtsen To: Daniel =?utf-8?Q?Mart=C3=ADn?= Subject: Re: bug#43401: 28.0.50; [PATCH] Emacs Lisp type error when the buffer passed to diff-buffer-with-file is not visiting a file References: X-Now-Playing: Saito Koji's _433-1_: "433_018" Date: Tue, 15 Sep 2020 14:56:29 +0200 In-Reply-To: ("Daniel =?utf-8?Q?Mart=C3=ADn=22's?= message of "Mon, 14 Sep 2020 18:12:11 +0200") Message-ID: <87wo0v8agy.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel Martín writes: > Emacs shows a more descriptive error that explains why the command > couldn't be executed. > > I've attached a patch that implements the expected result. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43401 Cc: 43401@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Daniel Mart=C3=ADn writes: > Emacs shows a more descriptive error that explains why the command > couldn't be executed. > > I've attached a patch that implements the expected result. Thanks; applied to Emacs 28. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 08:56:48 2020 Received: (at control) by debbugs.gnu.org; 15 Sep 2020 12:56:48 +0000 Received: from localhost ([127.0.0.1]:57695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIAVs-0002ln-5h for submit@debbugs.gnu.org; Tue, 15 Sep 2020 08:56:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIAVq-0002lT-Hy for control@debbugs.gnu.org; Tue, 15 Sep 2020 08:56:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fk97rr9TRyCY/mvTPGf6D8W+HP2xbT+J1okg5CUbVG4=; b=H2gBG34YuAHaq6V6lilxhFP9Ny 3W41F1rWWi04T2GR52LpavAXCZ5o9WIDA1Etz3aOyuTBA5JlkyBx46PWQYtLHyP2UNKYfUYLWWOVh +sBYLi9qlAtqbz2mIQUbyfuqFCghEAogWjbok8hWVwfME/jKt64Nb+QwScNiy7+Au9JY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIAVi-0000MQ-N0 for control@debbugs.gnu.org; Tue, 15 Sep 2020 14:56:40 +0200 Date: Tue, 15 Sep 2020 14:56:37 +0200 Message-Id: <87v9gf8agq.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43401 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43401 fixed close 43401 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 43401 fixed close 43401 28.1 quit From unknown Sat Jun 21 12:31:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 14 Oct 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator