* doc/misc/tramp.texi (New operations): Extend example.

This commit is contained in:
Michael Albinus
2026-04-08 16:40:15 +02:00
parent 00207670e5
commit 65b984c21a

View File

@@ -6920,6 +6920,7 @@ Then we have the different use cases:
@end group
@end lisp
@findex with-parsed-tramp-file-name
@var{function} is implemented like an ordinary @value{tramp} backend
handler, see the examples in @code{tramp-<backend>-handle-*} and
@code{tramp-handle-*}. It can expect, that the first argument (or
@@ -6927,6 +6928,27 @@ handler, see the examples in @code{tramp-<backend>-handle-*} and
syntax. It shall use @value{tramp} internal macros and functions like
@code{with-parsed-tramp-file-name} and the different cache functions.
@findex tramp-run-real-handler
If @var{function} must call the original function, this can be done
via @code{tramp-run-real-handler}. The implementation of the example
could look like:
@lisp
@group
(defun handle-test-operation (file)
(message "Entry handler implementation for %s" file)
(tramp-run-real-handler #'test-operation (list file))
(message "Exit handler implementation for %s" file))
@end group
@group
(test-operation "/ssh::/a/b")
@result{} "Entry handler implementation for /ssh::/a/b
Original implementation for /ssh::/a/b
Exit handler implementation for /ssh::/a/b"
@end group
@end lisp
If the same @var{function} shall be used for different @value{tramp}
backends, @code{tramp-add-external-operation} must be called for every
backend, respectively.