GNU bug report logs -
#57800
TRAMP insert-file-contents now fails for regions
Previous Next
Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>
Date: Wed, 14 Sep 2022 12:12:02 UTC
Severity: normal
Tags: moreinfo
Fixed in version 29.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 30 Sep 2022 21:58:35 +0200
with message-id <87h70ofxck.fsf <at> gmx.de>
and subject line Re: bug#57800: TRAMP insert-file-contents now fails for regions
has caused the debbugs.gnu.org bug report #57800,
regarding TRAMP insert-file-contents now fails for regions
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
57800: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57800
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Git commit fd1ee05977.
Open any file with TRAMP. From this buffer, evaluate:
(let ((file buffer-file-name)) (with-temp-buffer (insert-file-contents
file nil)))
This works fine. However, if you use a region:
(let ((file buffer-file-name)) (with-temp-buffer (insert-file-contents
file nil 1 10)))
this fails with an obviously wrong (file is certainly there) signal:
Debugger entered--Lisp error: (file-missing "/ssh:...")
signal(file-missing ("/ssh:..."))
tramp-error((tramp-file-name "ssh" "..." nil "..." "..." "..." nil)
file-missing "/ssh:...")
tramp-handle-insert-file-contents("/ssh:..." nil 1 10 nil)
apply(tramp-handle-insert-file-contents ("/ssh:..." nil 1 10 nil))
tramp-sh-file-name-handler(insert-file-contents "/ssh:..." nil 1 10
nil)
apply(tramp-sh-file-name-handler insert-file-contents ("/ssh:..." nil
1 10 nil))
tramp-file-name-handler(insert-file-contents "/ssh:..." nil 1 10 nil)
insert-file-contents("/ssh:..." nil 1 10)
(progn (insert-file-contents file nil 1 10))
Please add some automated tests for this.
Also, when a command fails with `file-missing' signal, Emacs UI only prints
the filename, as that seems to be the signal data. From user point of view
that says nothing. You can only understand what's wrong (even if this is
not a bug, as above) by setting `debug-on-error' to t, which is extremely
user-unfriendly.
Paul
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
Version: 29.1
Michael Albinus <michael.albinus <at> gmx.de> writes:
Hi Paul,
>> Yes, that fixes the problem. Does that mean I somehow have a mixup of
>> sources from different commits (not sure how) or that the cache is
>> persistent and can survive long times? Note that I also run Emacs 28
>> from time to time. Could it be that 29 reuses cache created by 28 that
>> contains no-longer-compatible values?
>
> Could be the latter, yes. "tmpdir" is the only cache value I know of
> which has changed its meaning(*). Perhaps I shall add a test that it
> ignores cached "tmpdir" values if they are remote. But hmm, it has
> changed its meaning also in Tramp 2.5.3.2, which is distributed via GNU
> ELPA.
Pushed this change to the emacs-28 branch, it will appear in the master
branch after merge.
It will also be contained in the upcoming Tramp 2.5.3.4 on GNU
ELPA. Closing the bug.
>> Paul
Best regards, Michael.
This bug report was last modified 2 years and 230 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.