From 65b984c21a5237dfe544e37375e101fa5aa7a233 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 8 Apr 2026 16:40:15 +0200 Subject: [PATCH] * doc/misc/tramp.texi (New operations): Extend example. --- doc/misc/tramp.texi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 23b6dce2ec6..41455a47546 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -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--handle-*} and @code{tramp-handle-*}. It can expect, that the first argument (or @@ -6927,6 +6928,27 @@ handler, see the examples in @code{tramp--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.