From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#26011: 26.0.50; tramp should respect large-file-warning-threshold Date: Tue, 07 Mar 2017 17:57:17 +0100 Message-ID: <87y3whnhxu.fsf@detlef> References: <87pohtuq0e.fsf@ctlt579.codethink.co.uk> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488905899 26730 195.159.176.226 (7 Mar 2017 16:58:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Mar 2017 16:58:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26011@debbugs.gnu.org To: Robert Marshall Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 07 17:58:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIR5-0005zd-5v for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Mar 2017 17:58:07 +0100 Original-Received: from localhost ([::1]:51675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clIRB-000385-1K for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Mar 2017 11:58:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clIR4-00037u-Lc for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2017 11:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clIR0-0005bv-Ql for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2017 11:58:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clIR0-0005bq-Nv for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2017 11:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1clIR0-0005zr-EA for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2017 11:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2017 16:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26011 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26011-submit@debbugs.gnu.org id=B26011.148890585123011 (code B ref 26011); Tue, 07 Mar 2017 16:58:02 +0000 Original-Received: (at 26011) by debbugs.gnu.org; 7 Mar 2017 16:57:31 +0000 Original-Received: from localhost ([127.0.0.1]:44844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIQU-0005z5-PD for submit@debbugs.gnu.org; Tue, 07 Mar 2017 11:57:30 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:64151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIQS-0005yo-6B for 26011@debbugs.gnu.org; Tue, 07 Mar 2017 11:57:29 -0500 Original-Received: from detlef.gmx.de ([87.146.52.210]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MHso5-1ciHDP47Kv-003abt; Tue, 07 Mar 2017 17:57:19 +0100 In-Reply-To: <87pohtuq0e.fsf@ctlt579.codethink.co.uk> (Robert Marshall's message of "Tue, 07 Mar 2017 14:21:05 +0000") X-Provags-ID: V03:K0:HmOJ4ceOsa5W2G/A4fI5IQ6UcLJ/asz053ZFDWusSIcF7NpUF5f a1iGJqn/h7HXg0DQFF8WfN18/3WFlShGN0vSUtoBRk9qlYyqpmi3Gm3rsgqY8IFkPMvBXSy e5mpjTynD9Qu2bV7EWueoXBqgt/8bpBbD9Kwd/mgHkrcx7AXoijnCgURjOL9X4iGx6e7PJr nL8aT8vXSXyoN3kiAT5pg== X-UI-Out-Filterresults: notjunk:1;V01:K0:JmweedQDRqM=:fI+meQuZ/1OedzbvUtnVMU 4XRVuTQyRsT5+UWZy+jmsT9GYk7S3Tk2KqJCWpv3x1sZl6EbCC5ysXvzTOFezH70TbOOOgF07 8r1qQGvEpDTGPXI5uZjGeEkWphYB8NCoXKqbiSlHwjufk4xcmWdGX/ZkfoLwLeapoU0F8gH6b L0LM5myKwrQHgR1yZt3ooSfFGuYFibJi51V2HLQUoia5EnuxvNm1D+70P+iEtMNBDZEoqbbPi 4koeWL2e/od+cSnswr5v4nihsgFG7sCnU2Fpn7Vv7mDmodiLwPCetKovUvpvg1E6dCAqhDI3v FAwK4JEQsSzhTzZyzd/5mo6JIVGcj9w0K4EAdpWVtvv7LD0xZDprEmQti/zBz+KAI/rp7cMCE v4EVqq8siP4XIkHmCnCGoKLKAo0okm0QRbti433CCqEwCLd/1eGTazKc4sP2ADPMUzmS9VjIW ezyMR0bl5Lk1uuKDdxyjPliR8EziQCsSbD57UlOsAdLsT2txuzcGL6uhyll2bVBE3HZg828nU iT6CgIlgayCIiIPTP1SIZlrLkUp5X1ODQx9NDPaubjGW/8qhUGU0jd25q47mk6RjdTiWPyW73 S/cvBxCYuVjFdBiJZddViisGxQy1QoEnsz7QjKqBgufWM3VOAWPx0pfbYFcP59/oY+sdLadjH qWinaEFr6shNUiMswD+KYGNwQhmJGy9WYxY9oTD041yn+JWgafqT9D0zAk/WN2fc1YPg2PkQE 6apJuuzC3yiBqN+WIoHSOaxliEKzf65Y6K9o94R8htQu7GUfPxmGlAiZdzbjIlcZhHl6f9fO X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130320 Archived-At: Robert Marshall writes: Hi Robert, > If from dired you attempt to copy a file to a tramp ssh dired (I have > dired-dwim-target set to t) and that file is very large, emacs will pause > for some time and eventually stop with: > > tramp-file-name-handler: Memory exhausted--use C-x s then exit and > restart Emacs > > If tramp is going to open the file and it is large I think it should > warn the user (respecting large-file-warning-threshold?) rather than > going ahead without confirmation and erroring with an alarming message! Well, this happens in case Tramp inserts the file into a temporary buffer. What about this patch: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index 071ef79..8561962 100644 --- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -2147,6 +2147,11 @@ file names." First arg OP is either `copy' or `rename' and indicates the operation. FILENAME is the source file, NEWNAME the target file. KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." + ;; Check, whether file is too large. Emacs checks in `insert-file-1' + ;; and `find-file-noselect', but that's not called here. + (abort-if-file-too-large + (tramp-compat-file-attribute-size (file-attributes (file-truename filename))) + (symbol-name op) filename) ;; We must disable multibyte, because binary data shall not be ;; converted. We don't want the target file to be compressed, so we ;; let-bind `jka-compr-inhibit' to t. `epa-file-handler' shall not --8<---------------cut here---------------end--------------->8--- > Robert Best regards, Michael.