]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change in tramp-sshfs.el
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 3 Oct 2021 15:01:30 +0000 (17:01 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 3 Oct 2021 15:01:30 +0000 (17:01 +0200)
lisp/net/tramp-sshfs.el

index 688e408bfb0c44ee28ef6de4dbc2925a2c2c8157..68230ee1ffe71bc8f7d98ca1363cac257df10302 100644 (file)
@@ -222,12 +222,14 @@ arguments to pass to the OPERATION."
 (defun tramp-sshfs-handle-insert-file-contents
   (filename &optional visit beg end replace)
   "Like `insert-file-contents' for Tramp files."
-  (let* (signal-hook-function
-         (result
-         (insert-file-contents
-          (tramp-fuse-local-file-name filename) visit beg end replace)))
-    (when visit (setq buffer-file-name filename))
-    (cons (expand-file-name filename) (cdr result))))
+  (setq filename (expand-file-name filename))
+  (let (signal-hook-function result)
+    (unwind-protect
+        (setq result
+             (insert-file-contents
+              (tramp-fuse-local-file-name filename) visit beg end replace))
+      (when visit (setq buffer-file-name filename))
+      (cons filename (cdr result)))))
 
 (defun tramp-sshfs-handle-process-file
   (program &optional infile destination display &rest args)