Previous: Localname deconstruction, Up: Files directories and localnames

9.2 Integrating with external Lisp packages

9.2.1 File name completion.

Sometimes, it is not convenient to open a new connection to a remote host, including entering the password and alike. For example, this is nasty for packages providing file name completion. Such a package could signal to Tramp, that they don't want it to establish a new connection. Use the variable non-essential temporarily and bind it to non-nil value.

     (let ((non-essential t))
       ...)

9.2.2 File attributes cache.

Keeping a local cache of remote file attributes in sync with the remote host is a time-consuming operation. Flushing and re-querying these attributes can tax Tramp to a grinding halt on busy remote servers.

To get around these types of slow-downs in Tramp's responsiveness, set the process-file-side-effects to nil to stop Tramp from flushing the cache. This is helpful in situations where callers to process-file know there are no file attribute changes. The let-bind form to accomplish this:

     (let (process-file-side-effects)
       ...)

For asynchronous processes, Tramp uses a process sentinel to flush file attributes cache. When callers to start-file-process know beforehand no file attribute changes are expected, then the process sentinel should be set to the default state. In cases where the caller defines its own process sentinel, Tramp's process sentinel is overwritten. The caller can still flush the file attributes cache in its process sentinel with this code:

     (unless (memq (process-status proc) '(run open))
       (dired-uncache remote-directory))

Since Tramp traverses subdirectories starting with the root-directory, it is most likely sufficient to make the default-directory of the process buffer as the root directory.