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)]
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 2 (text/html, inline)]
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.