emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57800: closed (TRAMP insert-file-contents now fails for regions)


From: GNU bug Tracking System
Subject: bug#57800: closed (TRAMP insert-file-contents now fails for regions)
Date: Fri, 30 Sep 2022 19:59:02 +0000

Your message dated Fri, 30 Sep 2022 21:58:35 +0200
with message-id <87h70ofxck.fsf@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@gnu.org.)


-- 
57800: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57800
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: TRAMP insert-file-contents now fails for regions Date: Wed, 14 Sep 2022 14:11:00 +0200
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


--- End Message ---
--- Begin Message --- Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions Date: Fri, 30 Sep 2022 21:58:35 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Version: 29.1

Michael Albinus <michael.albinus@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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]