all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#57800: TRAMP insert-file-contents now fails for regions
@ 2022-09-14 12:11 Paul Pogonyshev
  2022-09-14 18:08 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Paul Pogonyshev @ 2022-09-14 12:11 UTC (permalink / raw)
  To: 57800

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1902 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-10-01 16:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-14 12:11 bug#57800: TRAMP insert-file-contents now fails for regions Paul Pogonyshev
2022-09-14 18:08 ` Lars Ingebrigtsen
2022-09-14 18:18   ` Paul Pogonyshev
2022-09-14 18:23     ` Lars Ingebrigtsen
2022-09-14 18:33       ` Paul Pogonyshev
2022-09-15 10:30         ` Michael Albinus
2022-09-16  9:37           ` Lars Ingebrigtsen
2022-09-29  9:24             ` Paul Pogonyshev
2022-09-29 10:43               ` Lars Ingebrigtsen
2022-09-29 11:26                 ` Paul Pogonyshev
2022-09-29 11:27                   ` Paul Pogonyshev
2022-09-29 17:39                   ` Michael Albinus
2022-09-30  8:49                     ` Paul Pogonyshev
2022-09-30 18:39                       ` Michael Albinus
2022-09-30 18:52                         ` Paul Pogonyshev
2022-09-30 19:11                           ` Michael Albinus
2022-09-30 19:58                             ` Michael Albinus
2022-09-30 20:48                               ` Paul Pogonyshev
2022-10-01 15:18                                 ` Michael Albinus
2022-10-01 16:16                                   ` Paul Pogonyshev

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.